Fix OpenTelemetry configuration for HoneyComb integration using standard OTEL environment variables #331
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The vendor-only telemetry implementation was not properly sending metrics and traces to HoneyComb. The issue was that the OpenTelemetry SDK was being configured with custom OTLP exporter URLs and headers instead of using the standard OpenTelemetry environment variables that HoneyComb requires.
Changes Made
Set standard OpenTelemetry environment variables before SDK initialization:
OTEL_SERVICE_NAME=trx-parserOTEL_EXPORTER_OTLP_PROTOCOL=http/protobufOTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.ioOTEL_EXPORTER_OTLP_HEADERS=x-honeycomb-team={API_KEY}Simplified exporter configuration to use standard OTLP exporters without custom URLs or headers, allowing the SDK to pick up the environment variables automatically.
Added test coverage to validate that the required environment variables are properly set during telemetry initialization.
Why This Fixes the Issue
HoneyComb's documentation specifies that these standard OpenTelemetry environment variables must be set for proper integration. The previous implementation manually configured exporters with custom endpoints (
/v1/traces,/v1/metrics) and headers, which may not have been compatible with HoneyComb's expected format.By using the standard OTEL environment variables and letting the SDK handle the configuration automatically, the telemetry data should now properly reach HoneyComb.
Testing
Fixes #330.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
api.honeycomb.ionode /home/REDACTED/work/trx-parser/trx-parser/node_modules/.bin/jest __tests__/telemetry.test.ts(dns block)/usr/local/bin/node /home/REDACTED/work/trx-parser/trx-parser/node_modules/jest-worker/build/workers/processChild.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.