Skip to content

Commit 48ffaf9

Browse files
committed
feat(node)!: Use function.gcp span op for Firebase functions
1 parent d4e2799 commit 48ffaf9

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

MIGRATION.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,16 @@ Affected SDKs: All SDKs.
254254

255255
If you reference these attributes in custom instrumentation, `beforeSendSpan`, dashboards, or alerts, update them to the new names.
256256

257+
### Span operation changes
258+
259+
Affected SDKs: All SDKs.
260+
261+
Span operations (`sentry.op`) were aligned with the values defined in `@sentry/conventions`:
262+
263+
- `@sentry/node`: Firebase Functions spans now use `function.gcp` instead of `http.request`. The wrapper instruments all function trigger types (HTTP, Firestore, scheduler, storage), so a fixed HTTP op was wrong. The trigger type remains available on the `faas.trigger` attribute.
264+
265+
If you reference these operations in dashboards, alerts, or `beforeSendSpan`, update them to the new values.
266+
257267
### `thirdPartyErrorFilterIntegration` filters internal frames by default
258268

259269
Affected SDKs: All SDKs.

dev-packages/e2e-tests/test-applications/node-firebase/tests/functions.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ test('should only call the function once without any extra calls', async () => {
2020
'faas.provider': 'firebase',
2121
'faas.trigger': 'http.request',
2222
'sentry.kind': 'server',
23-
'sentry.op': 'http.request',
23+
'sentry.op': 'function.gcp',
2424
'sentry.origin': 'auto.firebase.otel.functions',
2525
'sentry.sample_rate': expect.any(Number),
2626
'sentry.source': 'route',
2727
},
28-
op: 'http.request',
28+
op: 'function.gcp',
2929
origin: 'auto.firebase.otel.functions',
3030
span_id: expect.any(String),
3131
status: 'ok',
@@ -97,12 +97,12 @@ test('should create a document and trigger onDocumentCreated and another with au
9797
'faas.provider': 'firebase',
9898
'faas.trigger': 'http.request',
9999
'sentry.kind': 'server',
100-
'sentry.op': 'http.request',
100+
'sentry.op': 'function.gcp',
101101
'sentry.origin': 'auto.firebase.otel.functions',
102102
'sentry.sample_rate': expect.any(Number),
103103
'sentry.source': 'route',
104104
},
105-
op: 'http.request',
105+
op: 'function.gcp',
106106
origin: 'auto.firebase.otel.functions',
107107
span_id: expect.any(String),
108108
status: 'ok',

packages/node/src/integrations/tracing/firebase/otel/patches/functions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { InstrumentationBase } from '@opentelemetry/instrumentation';
22
import { InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';
33
import { InstrumentationNodeModuleFile } from '../../../InstrumentationNodeModuleFile';
44
import { SENTRY_KIND } from '@sentry/conventions/attributes';
5+
import { FAAS_FUNCTION_GCP_SPAN_OP } from '@sentry/conventions/op';
56
import type { SpanAttributes } from '@sentry/core';
67
import {
78
captureException,
@@ -87,7 +88,7 @@ export function patchV2Functions<T extends FirebaseFunctions = FirebaseFunctions
8788
return startSpanManual(
8889
{
8990
name: `firebase.function.${triggerType}`,
90-
op: 'http.request',
91+
op: FAAS_FUNCTION_GCP_SPAN_OP,
9192
attributes,
9293
},
9394
async span => {

0 commit comments

Comments
 (0)