Skip to content

Otel: Standardize key constants #1294

Open

Description

@vprashrex

Is your feature request related to a problem?
The same concept goes to Sentry under different keys and types, so one filter never matches all signals.

Concept Keys in use today
Org / project tenant.org_id, kaapi.organization_id, gen_ai.request.organization_id; logs: org_id and organization_id
Job id llm.job_id, guardrails.job_id, collection.job_id
Provider / model llm.provider, llm.request.model next to gen_ai.provider.name, gen_ai.request.model
Request id kaapi.trace_id vs correlation_id
Metric names llm.call.total / llm.call.errors vs http.server.request.count / .error
No namespace completion_type, route_category

Describe the solution you'd like

  • Add app/core/telemetry/constants.py with one name per concept (tenant.org_id, tenant.project_id as strings, job.id, correlation_id, llm.completion_type, http.route_category, metric names).
  • Take GenAI keys from opentelemetry.semconv._incubating.attributes.gen_ai_attributes.
  • Use these constants everywhere (spans, tags, metrics, log_context); drop kaapi.* and gen_ai.request.organization_id/project_id.
  • Add the rule to docs/wiki/cross-cutting/observability.md.

Before merging, update the Sentry dashboards and alerts that use the old keys. Module and API version tags are tracked in #1305.

Activity

  1. changed the title [-]Observability: one telemetry key per concept (tenant, job, provider, metrics)[/-] [+]Telemetry: Standardize key constants[/+] on Oct 20, 2026
  2. self-assigned this
    on Oct 20, 2026
  3. changed the title [-]Telemetry: Standardize key constants[/-] [+]Otel: Standardize key constants[/+] on Oct 20, 2026
  4. moved this from To Do to In Progress in Kaapi-devon Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions