-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(node)!: Use function.gcp span op for Firebase functions
#22659
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
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 |
|---|---|---|
|
|
@@ -24,12 +24,12 @@ test.fixme('should only call the function once without any extra calls', async ( | |
| 'faas.provider': 'firebase', | ||
| 'faas.trigger': 'http.request', | ||
| 'sentry.kind': 'server', | ||
| 'sentry.op': 'http.request', | ||
| 'sentry.op': 'function.gcp', | ||
| 'sentry.origin': 'auto.firebase.orchestrion.functions', | ||
| 'sentry.sample_rate': expect.any(Number), | ||
| 'sentry.source': 'route', | ||
| }, | ||
| op: 'http.request', | ||
| op: 'function.gcp', | ||
| origin: 'auto.firebase.orchestrion.functions', | ||
| span_id: expect.any(String), | ||
| status: 'ok', | ||
|
|
@@ -101,12 +101,12 @@ test.fixme('should create a document and trigger onDocumentCreated and another w | |
| 'faas.provider': 'firebase', | ||
| 'faas.trigger': 'http.request', | ||
| 'sentry.kind': 'server', | ||
| 'sentry.op': 'http.request', | ||
| 'sentry.op': 'function.gcp', | ||
| 'sentry.origin': 'auto.firebase.orchestrion.functions', | ||
| 'sentry.sample_rate': expect.any(Number), | ||
| 'sentry.source': 'route', | ||
| }, | ||
| op: 'http.request', | ||
| op: 'function.gcp', | ||
|
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. Incomplete op assertions in testsMedium Severity This Additional Locations (1)Triggered by project rule: PR Review Guidelines for Cursor Bot Reviewed by Cursor Bugbot for commit e1785e3. Configure here. |
||
| origin: 'auto.firebase.orchestrion.functions', | ||
| span_id: expect.any(String), | ||
| status: 'ok', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| import type { InstrumentationBase } from '@opentelemetry/instrumentation'; | ||
| import { InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation'; | ||
| import { InstrumentationNodeModuleFile } from '../../../InstrumentationNodeModuleFile'; | ||
| import { SENTRY_KIND } from '@sentry/conventions/attributes'; | ||
| import { SENTRY_KIND, SENTRY_OP } from '@sentry/conventions/attributes'; | ||
| import { FAAS_FUNCTION_GCP_SPAN_OP } from '@sentry/conventions/op'; | ||
| import type { SpanAttributes } from '@sentry/core'; | ||
| import { | ||
| captureException, | ||
|
|
@@ -68,6 +69,7 @@ export function patchV2Functions<T extends FirebaseFunctions = FirebaseFunctions | |
| const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown'; | ||
|
|
||
| const attributes: SpanAttributes = { | ||
| [SENTRY_OP]: FAAS_FUNCTION_GCP_SPAN_OP, | ||
| [SENTRY_KIND]: 'server', | ||
| [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.firebase.otel.functions', | ||
| 'faas.name': functionName, | ||
|
|
@@ -87,7 +89,6 @@ export function patchV2Functions<T extends FirebaseFunctions = FirebaseFunctions | |
| return startSpanManual( | ||
| { | ||
| name: `firebase.function.${triggerType}`, | ||
| op: 'http.request', | ||
|
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. Wrong Firebase path updatedHigh Severity The production change sets Additional Locations (2)Reviewed by Cursor Bugbot for commit 2c8a0b1. Configure here. |
||
| attributes, | ||
| }, | ||
| async span => { | ||
|
|
||


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.
Feat lacks runnable coverage
Medium Severity
This
featPR only updatestest.fixmee2e cases and does not add a runnable unit, integration, or e2e test that exercises the newfunction.gcpop on the changed instrumentation. Per the project PR review guidelines, feat PRs need at least one integration or e2e test covering the new behavior.Additional Locations (1)
packages/node/src/integrations/tracing/firebase/otel/patches/functions.ts#L71-L92Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 2c8a0b1. Configure here.