# GCP functions (Node.js) integration with Dynatrace

**URL:** <https://community.dynatrace.com/t/gcp-functions-node-js-integration-with-dynatrace/54938>\
**Category:** OpenTelemetry\
**Tags:** nodejs, google-cloud-platform, clouds, opentelemetry\
**Created:** [February 10, 2026, 12:04am UTC](https://community.dynatrace.com/t/gcp-functions-node-js-integration-with-dynatrace/54938 "2026-02-10T00:04:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![annam](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@annam](https://community.dynatrace.com/u/annam)\
**Post date:** [February 10, 2026, 12:04am UTC](https://community.dynatrace.com/t/gcp-functions-node-js-integration-with-dynatrace/54938/1 "2026-02-10T00:04:53Z")

</div>

Hello experts,

I’m learning how to integrate GCP function traces with Dynatrace documentation for Node.js:

1.[Set up OpenTelemetry monitoring for Google Cloud Functions — Dynatrace Docs](https://docs.dynatrace.com/docs/ingest-from/google-cloud-platform/gcp-integrations/gcp-functions/opentelemetry-on-gcf#choose-config-method)

2.&nbsp;[Integrate on Google Cloud Functions Node.js — Dynatrace Docs](https://docs.dynatrace.com/docs/ingest-from/google-cloud-platform/gcp-integrations/gcp-functions/opentelemetry-on-gcf-nodejs#starting-spans--start-an-active-span-recommended)

Sadly, I can’t get the traces on Dynatrace’s side using the doc samples for the code:

index.js (where helloHttp is my entry function):

```javascript
const functions = require('@google-cloud/functions-framework');

const { Resource } = require('@opentelemetry/resources');
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { DtSpanExporter, DtSpanProcessor, DtTextMapPropagator, DtSampler } = require('@dynatrace/opentelemetry-gcf');

const processor = new DtSpanProcessor(new DtSpanExporter());
const provider = new NodeTracerProvider({
  resource: new Resource({
   "my.resource.attribute": "My Resource",
  }),
  sampler: new DtSampler(),
  // for @opentelemetry/sdk-trace-node versions lower than 1.29.0 use `provider.addSpanProcessor(processor)` instead
  spanProcessors: [processor]
  // ...other configurations
});

provider.register({
  propagator: new DtTextMapPropagator(),
  // ...other configurations
});

/////////////

// ...tracing initialization code

const { startActiveHttpSpan, endHttpSpanAndFlush } = require('@dynatrace/opentelemetry-gcf');

// ...tracing initialization code

async function handler(req, res) {
  await startActiveHttpSpan(req, async (span) => {
    let error;
    try {
      // do something
      console.log("Hello Console...")
    } catch (e) {
      error = e;
    }

    // status should be set before span ends
    res.status(error != null ? 500 : 200);
    /**
     * Span must be ended and flushed before handler sends response.
     * This limitiation comes from GCF, for details see:
     * https://cloud.google.com/functions/docs/concepts/nodejs-runtime#signal-termination
     */
    await endHttpSpanAndFlush(span, res, error);
    res.send("hello world!");
  });
}

/////////////

functions.http('helloHttp', (req, res) => {
    handler(req,res);
});

```

I ran the same test with a Python function, and it worked without issues, which makes me think my code has an issue.

Thank you in advance for any comment or recommendation; it is well appreciated.
