8000 feat(telemetry): Adding instrumentation around http client for tracing by tjvkroll · Pull Request #986 · TwiN/gatus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(telemetry): Adding instrumentation around http client for tracing #986

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 6 commits into
base: master
Choose a base branch
from

Conversation

tjvkroll
Copy link

Summary

This is a feature that adds instrumentation around the http client to enable tracing. Configured a simple trace provider and wrapped the http transport with Open Telemetry instrumentation.

Checklist

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

@tjvkroll
Copy link
Author
tjvkroll commented Jan 29, 2025

Here is a screenshot of the tracing coming through in Honeycomb showing the value of the full request path through to an endpoint to identify any potential errors:

image

@tjvkroll
Copy link
Author

This testing was done with a local collector container using a http receiver, no encryption, and basic resource attributes being added as example. The env configuration being applied to my Gatus service was as follows:

      - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces
      - OTEL_SERVICE_NAME=gatus
      - OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
      - OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
      - OTEL_RESOURCE_ATTRIBUTES=deployment.environment=local,service.version=1.0.0

With no env variables in place the exporter will default to http://localhost:4318/v1/traces and will expect and insecure endpoint due to the http prefix. Also no resource attribute will be attached unless specified.

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.

1 participant
0