-
Notifications
You must be signed in to change notification settings - Fork 111
adding app id to spans #2779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding app id to spans #2779
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@inkeep/agents-api": patch | ||
| --- | ||
|
|
||
| adding app.id to span attributes | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,7 @@ import { | |||||||||||||
| verifySlackUserToken, | ||||||||||||||
| verifyTempToken, | ||||||||||||||
| } from '@inkeep/agents-core'; | ||||||||||||||
| import { trace } from '@opentelemetry/api'; | ||||||||||||||
| import { createMiddleware } from 'hono/factory'; | ||||||||||||||
| import { HTTPException } from 'hono/http-exception'; | ||||||||||||||
| import { errors, jwtVerify } from 'jose'; | ||||||||||||||
|
|
@@ -708,6 +709,9 @@ async function runApiKeyAuthHandler( | |||||||||||||
| c.set('executionContext', buildExecutionContext(createDevContext(reqData), reqData)); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if (reqData.appId && attempt.authResult) { | ||||||||||||||
| trace.getActiveSpan()?.setAttribute('app.id', reqData.appId); | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💭 Consider: Add Issue: The new Why: Centralizing attribute names helps maintain a consistent telemetry schema and makes it easier to audit what attributes are being emitted. However, I note the codebase has some mixed patterns (e.g., Fix: Optionally add to APP_ID: 'app.id',Then import and use Refs:
|
||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+712
to
+714
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The dev-environment guard checks Since
Suggested change
|
||||||||||||||
| await next(); | ||||||||||||||
| return; | ||||||||||||||
| } | ||||||||||||||
|
|
@@ -757,6 +761,9 @@ async function runApiKeyAuthHandler( | |||||||||||||
| ); | ||||||||||||||
|
|
||||||||||||||
| c.set('executionContext', buildExecutionContext(attempt.authResult, reqData)); | ||||||||||||||
| if (reqData.appId) { | ||||||||||||||
| trace.getActiveSpan()?.setAttribute('app.id', reqData.appId); | ||||||||||||||
| } | ||||||||||||||
| await next(); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: changelog messages should start with a capitalized action verb per the repo conventions (e.g. "Add
app.idto span attributes").