Skip to content

[ENH]: Empty OTEL endpoint won't cause panic + OTEL standard exporter env var support #4622

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tazarov
Copy link
Contributor

@tazarov tazarov commented May 23, 2025

Closes #4609

Description of changes

Summarize the changes made by this PR.

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

TBD

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor Author

tazarov commented May 23, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

propel-code-bot bot commented May 23, 2025

Handle Empty OTEL Endpoint Gracefully & Add OTEL Exporter Env Var Support

This PR improves the OpenTelemetry (OTEL) initialization logic in the Rust tracing module by ensuring that an empty OTEL endpoint no longer causes a panic-instead, it falls back to a no-operation (Identity) layer. Additionally, it enhances environment variable support to align with OTEL standards by checking OTEL_EXPORTER_OTLP_TRACES_ENDPOINT and OTEL_EXPORTER_OTLP_ENDPOINT variables per upstream SDK configuration guidelines.

Key Changes:
• init_otel_layer checks OTEL_EXPORTER_OTLP_TRACES_ENDPOINT and OTEL_EXPORTER_OTLP_ENDPOINT environment variables for endpoint value, falling back to parameter if unset.
• If the resolved OTEL endpoint is empty, the function returns an Identity (noop) tracing layer instead of causing a panic.
• Metric exporter now also uses OTEL_EXPORTER_OTLP_METRICS_ENDPOINT, falling back to the final endpoint if not set.
• Function signatures updated to use &str, improving ergonomics and reducing unnecessary String cloning.

Affected Areas:
• rust/tracing/src/init_tracer.rs

This summary was automatically generated by @propel-code-bot

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

Successfully merging this pull request may close these issues.

[Bug]: Open Telemetry is configured when environment variables are blank
1 participant