Repository navigation
Conversation
Move every span attribute, Sentry tag and metric name into core/telemetry/constants.py. Standard OTel keys (GenAI, HTTP body size, db.system, user.id) come from semconv; tenant ids are always strings. Replaces kaapi.organization_id/project_id with tenant.*, *.job_id with job.id, kaapi.trace_id with correlation_id, llm.provider/llm.request.model with gen_ai.*, and llm.call.total/errors with llm.call.count/error. log_context now uses org_id. Existing key names are otherwise unchanged so dashboards keep working.
Contributor
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue
Closes #1294
Summary
core/telemetry/constants.py, eliminating string literals for keys.semconv.Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
Before merging, update the Sentry dashboard Kaapi · LLM Call: it still filters on
kaapi.organization_id,kaapi.project_idandcompletion_type. No alert rule uses the old keys.Original PR description
Issue
Closes #1294
Summary
The same concept went to Sentry under different keys and types (
tenant.org_idvskaapi.organization_id,llm.job_idvsguardrails.job_id, int vs string), so one filter never matched every signal.core/telemetry/constants.py; no key is written as a string literal anymore.http.request.body.size,db.system,user.id) are imported from semconv.kaapi.organization_id/project_id→tenant.org_id/project_id(always strings),*.job_id→job.id,kaapi.trace_id→correlation_id,llm.provider/llm.request.model→gen_ai.*,completion_type→llm.completion_type,route_category→http.route_category,llm.call.total/errors→llm.call.count/error.log_context(...)usesorg_id.Stacked on #1090.
Checklist
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
Before merging, update the Sentry dashboard Kaapi · LLM Call: it still filters on
kaapi.organization_id,kaapi.project_idandcompletion_type. No alert rule uses the old keys.