Golang
ClickStack uses the OpenTelemetry standard for collecting telemetry data (logs and traces). Traces are auto-generated with automatic instrumentation, so manual instrumentation isn't required to get value out of tracing.
This Guide Integrates:
✅ Logs | ✅ Metrics | ✅ Traces |
Getting started
Install OpenTelemetry instrumentation packages
To install the OpenTelemetry and HyperDX Go packages, use the command below. It is recommended to check out the current instrumentation packages and install the necessary packages to ensure that the trace information is attached correctly.
Native HTTP server example (net/http)
For this example, we will be using net/http/otelhttp
.
Refer to the commented sections to learn how to instrument your Go application.
Gin application example
For this example, we will be using gin-gonic/gin
.
Refer to the commented sections to learn how to instrument your Go application.
Configure environment variables
Afterwards you'll need to configure the following environment variables in your shell to ship telemetry to ClickStack:
The OTEL_EXPORTER_OTLP_HEADERS
environment variable contains the API Key available via HyperDX app in Team Settings → API Keys
.