Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a OTEL_DEBUG env variable for enabling debug mode #1714

Open
KyleAMathews opened this issue Sep 16, 2024 · 0 comments
Open

Add a OTEL_DEBUG env variable for enabling debug mode #1714

KyleAMathews opened this issue Sep 16, 2024 · 0 comments

Comments

@KyleAMathews
Copy link
Contributor

KyleAMathews commented Sep 16, 2024

Right now we use an OTEL_EXPORT variable for switching between debug mode & exporting to an opentelemetry service —

case otel_export do
"otlp" ->
if endpoint = env!("OTLP_ENDPOINT", :string, nil) do
# Shortcut config for Honeycomb.io:
# users may set the optional HNY_API_KEY and HNY_DATASET environment variables
# and specify the Honeycomb URL in OTLP_ENDPOINT to export traces directly to
# Honeycomb, without the need to run an OpenTelemetry Collector.
honeycomb_api_key = env!("HNY_API_KEY", :string, nil)
honeycomb_dataset = env!("HNY_DATASET", :string, nil)
headers =
Enum.reject(
[
{"x-honeycomb-team", honeycomb_api_key},
{"x-honeycomb-dataset", honeycomb_dataset}
],
fn {_, val} -> is_nil(val) end
)
config :opentelemetry_exporter,
otlp_protocol: :http_protobuf,
otlp_endpoint: endpoint,
otlp_headers: headers,
otlp_compression: :gzip
end
"debug" ->
# In this mode, each span is printed to stdout as soon as it ends, without batching.
config :opentelemetry, :processors,
otel_simple_processor: %{exporter: {:otel_exporter_stdout, []}}
_ ->
config :opentelemetry,
processors: [],
traces_exporter: :none
end

Instead we should add an OTEL_DEBUG which enable debug mode and otherwise export if the other otel configuration is correct.

@KyleAMathews KyleAMathews changed the title Only require OTEL_EXPORT for enabling debug mode Add a OTEL_DEBUG env variable for enabling debug mode Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant