For more structured learning, check out the OpenTelemetry Foundations course from Honeycomb Academy.
Instrumenting with OpenTelemetry
Select your application’s language for instructions on instrumenting with OpenTelemetry:OpenTelemetry for Go
Instrument your Go application with OpenTelemetry.
OpenTelemetry for Java
Instrument your Java application with OpenTelemetry.
OpenTelemetry for .NET
Instrument your .NET application with OpenTelemetry.
OpenTelemetry for Node.js
Instrument your Node.js application with OpenTelemetry.
OpenTelemetry for Python
Instrument your Python application with OpenTelemetry.
OpenTelemetry for Ruby
Instrument your Ruby application with OpenTelemetry.
Using the Honeycomb OpenTelemetry Endpoint
If your language is not listed above, you can send data to Honeycomb directly over OTLP with an OpenTelemetry SDK or the OpenTelemetry Collector. An OpenTelemetry integration should set the endpoint and headers.- Environment Variables
- In Code
-
Set the endpoint:
- For OTLP/gRPC:
- US instance:
export OTEL_EXPORTER_OTLP_ENDPOINT=api.honeycomb.io:443 - EU instance:
export OTEL_EXPORTER_OTLP_ENDPOINT=api.eu1.honeycomb.io:443
- US instance:
- For OTLP/HTTPS:
- US instance:
export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.io/ - EU instance:
export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.eu1.honeycomb.io/
- US instance:
- For OTLP/gRPC:
-
Set your API key:
-
Set the service name in the
OTEL_SERVICE_NAMEenvironment variable:Note: If you use Honeycomb Classic, set thex-honeycomb-datasetin the HTTP Headers.
About the OTEL_EXPORTER_OTLP_ENDPOINT environment variable
When using the OTEL_EXPORTER_OTLP_ENDPOINT environment variable with an SDK and an HTTP exporter, the final path of the endpoint is modified by the SDK to represent the specific signal being sent.
For example, when exporting trace data, the endpoint is updated to append v1/traces.
When exporting metrics data, the endpoint is updated to append v1/metrics.
So, if you were to set the OTEL_EXPORTER_OTLP_ENDPOINT to https://api.honeycomb.io, traces would be sent to https://api.honeycomb.io/v1/traces and metrics would be sent to https://api.honeycomb.io/v1/metrics.
The same modification is not necessary for gRPC.
OTEL_EXPORTER_OTLP_<SIGNAL>_ENDPOINT instead of the more generic OTEL_EXPORTER_OTLP_ENDPOINT.
When using a signal-specific environment variable, these paths must be appended manually.
Set OTEL_EXPORTER_OTLP_TRACES_ENDPOINT for traces, appending the endpoint with v1/traces, and OTEL_EXPORTER_OTLP_METRICS_ENDPOINT for metrics, appending the endpoint with v1/metrics.
Send both traces and metrics to Honeycomb using this method by setting the following variables:
Instrumented Fields
With its Automatic Instrumentation, OpenTelemetry automatically tracks trace and span relationships using the following fields:| Field | Description |
|---|---|
name | Name of the function or method where the span was created |
service.name | Name of the instrumented service |
duration_ms | Length of time the span took, in milliseconds |
trace.span_id | Unique identifier for each span |
trace.trace_id | Unique identifier of the trace this span belongs to |
trace.parent_id | Unique identifier of this span’s parent span, which is the call location this span was called from |