Skip to main content

mix.exs

defmodule Impact.MixProject do
  use Mix.Project

  @version "0.0.1"

  def project do
    [
      app: :impact,
      version: @version,
      elixir: "~> 1.16",
      elixirc_paths: elixirc_paths(Mix.env()),
      start_permanent: Mix.env() == :prod,
      deps: deps(),
      description:
        "OpenTelemetry-native LLM/AI tracing SDK for Elixir, exporting to Impact via OTLP.",
      package: package(),
      name: "Impact",
      docs: [main: "Impact"],
      test_paths: ["test"],
      dialyzer: [plt_add_apps: [:mix, :ex_unit]]
    ]
  end

  def application do
    [
      extra_applications: [:logger],
      mod: {Impact.Application, []}
    ]
  end

  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  defp deps do
    [
      # OpenTelemetry core
      {:opentelemetry, "~> 1.5"},
      {:opentelemetry_api, "~> 1.4"},
      {:opentelemetry_exporter, "~> 1.8"},
      {:opentelemetry_semantic_conventions, "~> 1.27"},

      # Telemetry bridge (Phoenix / Ecto / Finch / Req / langchain emit :telemetry events)
      {:telemetry, "~> 1.2"},

      # Optional ecosystem instrumentations (apps opt in via `mix.exs`):
      {:opentelemetry_phoenix, "~> 2.0", optional: true},
      {:opentelemetry_ecto, "~> 1.2", optional: true},
      {:opentelemetry_finch, "~> 0.2", optional: true},
      # Required if you use Impact.Instrumentation.Bedrock (Req-based path):
      {:req, "~> 0.5", optional: true},

      # Dev / test
      {:bypass, "~> 2.1", only: :test},
      {:mox, "~> 1.2", only: :test},
      {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
      {:credo, "~> 1.7", only: [:dev, :test], runtime: false},
      {:ex_doc, "~> 0.34", only: :dev, runtime: false}
    ]
  end

  defp package do
    [
      maintainers: ["Impact AI"],
      licenses: ["Apache-2.0"],
      links: %{},
      files: ~w(lib config mix.exs README.md LICENSE)
    ]
  end
end