You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Instrumenting Cloud Functions for Firebase with Open Telemetry
2
+
This sample demonstrates instrumenting your Cloud Functions for Firebase using [OpenTelemetry](https://opentelemetry.io).
3
+
4
+
See Firebase Summit 2022 Talk "Observability in Cloud Functions for Firebase" for motivations and context.
5
+
6
+
Open Telemetry SDK provides both automatic and manual instrumentation, both of which are demonstrated here. See [OpenTelemetry JS documentations](https://opentelemetry.io/docs/instrumentation/js/) for more information about how to use and configure OpenTelemetry for your javascript project.
7
+
8
+
## Notable Files
9
+
*`./tracing.js`: Initializes OpenTelemetry SDK to automatically instrument HTTP/GRPC/Express modules and export the generated traces to Google Cloud Trace.
10
+
11
+
*`./.env`: Configures `NODE_OPTIONS` to preload the `tracing.js` module. This is important because OpenTelemtry SDK works by monkey-patching instrumented modules and must run first before other module is loaded.
12
+
13
+
*`./index.js`: Includes sample code for generating custom spans using the OpenTelemetry API. e.g.:
0 commit comments