Skip to content

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