Skip to content

Conversation

fredzolio
Copy link

Please describe the purpose of this pull request.
This PR adds support for exporting OpenTelemetry traces using the HTTP protocol in addition to the existing gRPC option. The setup_tracing function now detects if the provided endpoint starts with "http" and configures the appropriate OTLP exporter (HTTP or gRPC) accordingly.

Is it to add a new feature? Is it to fix a bug?
This is a new feature. It enhances the tracing setup by allowing the use of HTTP endpoints for OTLP trace exporting, increasing compatibility with different observability backends.

How to test

  1. Set the tracing endpoint to an HTTP OTLP collector (e.g., http://localhost:4318/v1/traces) in your configuration or environment.
  2. Start the application.
  3. Trigger some requests to the API.
  4. Verify that traces are being sent to the collector via HTTP (you can check the collector logs or UI).
  5. Optionally, repeat the process with a gRPC endpoint to ensure backward compatibility.

Have you tested this PR?
Yes, I have tested the latest commit. When using an HTTP endpoint, traces are successfully exported via HTTP. When using a gRPC endpoint, traces are exported via gRPC as before. No errors were observed in the logs.

Related issues or PRs
No related issues or PRs at this time.

Is your PR over 500 lines of code?
No, this PR is well under 500 lines of code.

Additional context
This change improves flexibility for deployments where only HTTP OTLP endpoints are available or preferred. No breaking changes were introduced.

carenthomas and others added 30 commits March 26, 2025 11:03
Co-authored-by: Sarah Wooders <[email protected]>
Co-authored-by: Shubham Naik <[email protected]>
Co-authored-by: Shubham Naik <[email protected]>
Co-authored-by: Charles Packer <[email protected]>
sarahwooders and others added 21 commits April 24, 2025 11:47
Co-authored-by: Matthew Zhou <[email protected]>
Co-authored-by: Andy Li <[email protected]>
This commit brings back the changes introduced in commit ec95703, which were missing in the current main branch since 546996e.

Co-authored-by: Miao <[email protected]>
@cliandy
Copy link
Contributor

cliandy commented May 20, 2025

Thanks for your contribution!

sarahwooders pushed a commit that referenced this pull request Jun 6, 2025
@kianjones9 kianjones9 force-pushed the main branch 2 times, most recently from b6907a4 to ae775db Compare September 15, 2025 22:26
carenthomas pushed a commit that referenced this pull request Sep 15, 2025
carenthomas pushed a commit that referenced this pull request Oct 7, 2025
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.