Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ElixirCL/tololo
Browse files Browse the repository at this point in the history
  • Loading branch information
clsource committed Jan 14, 2025
2 parents b8336d1 + fcef1f6 commit 5c8f414
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tololo/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ if config_env() == :prod do

maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []

config :opentelemetry_exporter,
otlp_protocol: :http_protobuf,
otlp_endpoint: System.fetch_env!("OTLP_ENDPOINT")

config :tololo, Tololo.Repo,
# ssl: true,
url: database_url,
Expand Down
12 changes: 12 additions & 0 deletions tololo/lib/tololo/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ defmodule Tololo.Application do

@impl true
def start(_type, _args) do
if System.get_env("ECTO_IPV6") do
:httpc.set_option(:ipfamily, :inet6fb4)
end

:ok = :opentelemetry_cowboy.setup()
:ok = OpentelemetryPhoenix.setup()

:ok =
Tololo.Repo.config()
|> Keyword.fetch!(:telemetry_prefix)
|> OpentelemetryEcto.setup()

children = [
Tololo.Prometheus,
TololoWeb.Telemetry,
Expand Down
8 changes: 7 additions & 1 deletion tololo/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ defmodule Tololo.MixProject do
{:bandit, "~> 1.5"},
{:kafka_ex, "~> 0.11"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:prom_ex, "~> 1.11.0"}
{:prom_ex, "~> 1.11.0"},
{:opentelemetry_exporter, "~> 1.8.0"},
{:opentelemetry, "~> 1.5.0"},
{:opentelemetry_api, "~> 1.4.0"},
{:opentelemetry_ecto, "~> 1.2.0"},
{:opentelemetry_phoenix, "~> 2.0.0"},
{:opentelemetry_cowboy, "~> 1.0"}
]
end

Expand Down
Loading

0 comments on commit 5c8f414

Please sign in to comment.