Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Possible new keys for
|
| Needed key | Current raw string | Used in |
|---|---|---|
NetworkIODirectionKey |
(re-export from otel) | instrument.go — still using otelsc.NetworkIODirectionKey |
ClientPlatformVersionKey |
"client.platform_version" |
ProxiedBytes metric |
ClientKernelArchKey |
"client.kernel_arch" |
ProxiedBytes metric |
ClientLibraryVersionKey |
"client.library_version" |
ReportProxiedBytes, ReportOriginBytes spans |
ClientLocaleKey |
"client.locale" |
ReportProxiedBytes span |
ProxyLegacyKey |
"legacy" |
otel.go resource |
ProxyDCKey |
"dc" |
otel.go resource |
ProxyFrontendDCKey |
"frontend.dc" |
otel.go resource |
DatacapCohortKey |
"datacap_cohort" |
ProxiedBytes metric |
ProbingErrorKey |
"probing.error" |
ReportProxiedBytes span |
There was a problem hiding this comment.
Pull request overview
This PR standardizes OpenTelemetry resource/metric/span attribute keys by switching to the shared github.com/getlantern/semconv definitions (per engineering issue #3035), reducing ad-hoc attribute naming across the proxy.
Changes:
- Replace locally-defined/string OTEL attribute keys with
github.com/getlantern/semconvkeys in OTEL resource construction and instrumentation. - Update dependency set to include
github.com/getlantern/semconvand bump several Go module versions. - Add an
AGENTS.mdconvention pointer for telemetry attribute rules.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| otel/otel.go | Uses getlantern/semconv keys for resource attributes and adjusts resource attribute assembly/logging. |
| instrument/instrument.go | Aligns metric/span attributes to semconv keys and simplifies attribute construction. |
| go.mod | Adds github.com/getlantern/semconv and bumps several module versions (including OTEL API modules). |
| go.sum | Adds checksums for the new/updated modules. |
| AGENTS.md | Documents the convention to follow semconv rules for telemetry attributes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log.Debugf("Resource attributes: %v", attrs) | ||
| return resource.NewWithAttributes(semconv.SchemaURL, attrs...) |
There was a problem hiding this comment.
buildResource() now logs the full resource attributes slice, but this function is invoked for both the tracer provider and the meter provider, so it will emit the same log line multiple times and rebuild the resource twice. Consider caching the built *resource.Resource (or logging only once) to avoid duplicated work/log noise at startup.
| go.opentelemetry.io/otel v1.38.0 | ||
| go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0 | ||
| go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 | ||
| go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 | ||
| go.opentelemetry.io/otel/metric v1.36.0 | ||
| go.opentelemetry.io/otel/metric v1.38.0 | ||
| go.opentelemetry.io/otel/sdk v1.35.0 | ||
| go.opentelemetry.io/otel/sdk/metric v1.35.0 | ||
| go.opentelemetry.io/otel/trace v1.36.0 | ||
| go.opentelemetry.io/otel/trace v1.38.0 |
There was a problem hiding this comment.
OpenTelemetry module versions are now skewed (go.opentelemetry.io/otel, /metric, /trace at v1.38.0 while /sdk and OTLP exporters remain v1.35.0). Keeping these modules aligned to the same release line reduces upgrade risk and avoids potential cross-module API/type drift; consider bumping the remaining OTEL modules to v1.38.0 (or documenting why the split is required).
relates to https://github.com/getlantern/engineering/issues/3035