From 558180297abf628c5f22c979e88384255699a9fe Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 24 Apr 2024 10:50:18 -0400 Subject: [PATCH] Configure OTLP exporter in prod --- config/runtime.exs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/runtime.exs b/config/runtime.exs index 5e1d616..c8b8364 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -87,4 +87,16 @@ if config_env() == :prod do key_id: System.fetch_env!("APNS_KEY_ID"), team_id: System.fetch_env!("APNS_TEAM_ID"), bundle_id: System.fetch_env!("APNS_BUNDLE_ID") + + otlp_endpoint = System.get_env("OTLP_ENDPOINT") + + if otlp_endpoint do + config :opentelemetry, + span_processor: :batch, + traces_exporter: :otlp + + config :opentelemetry_exporter, + otlp_protocol: :grpc, + otlp_endpoint: otlp_endpoint + end end