This package defines the canonical attribute keys for all telemetry (metrics, traces, logs) across Lantern services. It re-exports standard OTel semconv and adds custom keys for Lantern-specific concepts.
- Avoid hardcoded attribute key strings. Use
semconv.*constants to aid correlation. - Prefer standard OTel keys when one exists for the concept. DNS, database services, and internal OTel instrumentation already emit standard keys, so using them ensures correlation. Only use custom keys for Lantern-specific domains (proxies, routes, tracks, bandit, clients, EIPs).
- Align with existing usage. Before adding a new key, check
custom.goandstandard.go, and grep across services for how similar resources are already described. - Naming matters for incident response. These keys power dashboards and alerts. Consistent naming lets on-call engineers query across services.
standard.go— re-exports of standard OTel semconv symbols (pinned tov1.37.0). Add new re-exports here when a service needs an upstream key.custom.go— Lantern-specific attribute keys, grouped by domain
Add a const re-export to standard.go under the appropriate group. Use type
inference (no explicit attribute.Key). Check
https://pkg.go.dev/go.opentelemetry.io/otel/semconv for available keys.
Add a typed attribute.Key constant to custom.go under the appropriate
domain group. Use the domain.field_name naming convention, e.g.
proxy.protocol, route.region. If no group fits, create a new one with a
comment header.
Every service must set these on its telemetry resource. Dashboards and alerts depend on them for filtering and grouping during incident response.
semconv.ServiceNameKey— identifies the servicesemconv.ServiceVersionKey— deployment error rate monitoringsemconv.DeploymentEnvironmentNameKey— environment (prod/staging/dev)