<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic GCP functions (Node.js) integration with Dynatrace in Cloud platforms</title>
    <link>https://community.dynatrace.com/t5/Cloud-platforms/GCP-functions-Node-js-integration-with-Dynatrace/m-p/294487#M2267</link>
    <description>&lt;P&gt;Hello experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm learning how to integrate GCP function traces with Dynatrace documentation for Node.js:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&lt;A href="https://docs.dynatrace.com/docs/ingest-from/google-cloud-platform/gcp-integrations/gcp-functions/opentelemetry-on-gcf#choose-config-method" target="_blank" rel="noopener"&gt;Set up OpenTelemetry monitoring for Google Cloud Functions — Dynatrace Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;&lt;A href="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" target="_blank" rel="noopener"&gt;Integrate on Google Cloud Functions Node.js — Dynatrace Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Sadly, I can't get the traces on Dynatrace's side using the doc samples for the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index.js (where helloHttp is my entry function):&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;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) =&amp;gt; {
    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) =&amp;gt; {
    handler(req,res);
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the same test with a Python function, and it worked without issues, which makes me think my code has an issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance for any comment or recommendation; it is well appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Feb 2026 08:46:54 GMT</pubDate>
    <dc:creator>annam</dc:creator>
    <dc:date>2026-02-10T08:46:54Z</dc:date>
    <item>
      <title>GCP functions (Node.js) integration with Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/GCP-functions-Node-js-integration-with-Dynatrace/m-p/294487#M2267</link>
      <description>&lt;P&gt;Hello experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm learning how to integrate GCP function traces with Dynatrace documentation for Node.js:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&lt;A href="https://docs.dynatrace.com/docs/ingest-from/google-cloud-platform/gcp-integrations/gcp-functions/opentelemetry-on-gcf#choose-config-method" target="_blank" rel="noopener"&gt;Set up OpenTelemetry monitoring for Google Cloud Functions — Dynatrace Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;&lt;A href="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" target="_blank" rel="noopener"&gt;Integrate on Google Cloud Functions Node.js — Dynatrace Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Sadly, I can't get the traces on Dynatrace's side using the doc samples for the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index.js (where helloHttp is my entry function):&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;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) =&amp;gt; {
    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) =&amp;gt; {
    handler(req,res);
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the same test with a Python function, and it worked without issues, which makes me think my code has an issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance for any comment or recommendation; it is well appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2026 08:46:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/GCP-functions-Node-js-integration-with-Dynatrace/m-p/294487#M2267</guid>
      <dc:creator>annam</dc:creator>
      <dc:date>2026-02-10T08:46:54Z</dc:date>
    </item>
  </channel>
</rss>

