# Monitoring a Node.js web app running in GCP Cloud Run

**URL:** <https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703>\
**Category:** Cloud platforms\
**Tags:** nodejs, google-cloud-platform\
**Created:** [January 6, 2022, 3:11pm UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703 "2022-01-06T15:11:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AymericM](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aymericm/32/38607_2.png) [@AymericM](https://community.dynatrace.com/u/AymericM)\
**Post date:** [January 6, 2022, 3:11pm UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/1 "2022-01-06T15:11:56Z")

</div>

Hi, we’re trying to setup OneAgent to monitor a Node.js web app that runs in GCP Cloud Run.

From the documentation and Dynatrace support I understand that there is no out of the box solution (yet, hopefully ^^).

We found 2 methods to install OneAgent “in” the app :

1 -&nbsp;[https://www.npmjs.com/package/@dynatrace/oneagent](https://www.npmjs.com/package/@dynatrace/oneagent)

2 -&nbsp;[Instrument your JavaScript application on Node.js with OpenTelemetry — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/opent-nodejs)

We already tried option 1 but the only thing we see in Dynatrace UI is that the token is used when the app is launched, nothing seems to be captured, not a single web request.

Can someone explain the difference between 1 and 2 &nbsp;And tell if 2 has better chance to work?

---

<div class="post-metadata">

**Author:** ![andreborges](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@andreborges](https://community.dynatrace.com/u/andreborges)\
**Post date:** [January 6, 2022, 8:56pm UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/2 "2022-01-06T20:56:36Z")

</div>

Hi,

Have you tried to use the SDK?

> **[GitHub - Dynatrace/OneAgent-SDK-for-NodeJs: Enables custom tracing of Node.js applications in...](https://github.com/Dynatrace/OneAgent-SDK-for-NodeJs)**
>
> Enables custom tracing of Node.js applications in Dynatrace

Best,

---

<div class="post-metadata">

**Author:** ![AymericM](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aymericm/32/38607_2.png) [@AymericM](https://community.dynatrace.com/u/AymericM)\
**Post date:** [January 7, 2022, 9:41am UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/3 "2022-01-07T09:41:18Z")

</div>

If I understand the documentation correctly, using the SDK means hardcoding any trace that we want to see in Dynatrace.

---

<div class="post-metadata">

**Author:** ![andreborges](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@andreborges](https://community.dynatrace.com/u/andreborges)\
**Post date:** [January 10, 2022, 6:26pm UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/4 "2022-01-10T18:26:09Z")

</div>

Yes, that’s correct. It’s similar to option 2 - manual instrumentation. For sure, manual instrumentation will work but you have extra work to do.

I would give option 2 - automatic instrumentation, a try. Otherwise, you will have to hardcode every trace.

Best,

---

<div class="post-metadata">

**Author:** ![AymericM](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aymericm/32/38607_2.png) [@AymericM](https://community.dynatrace.com/u/AymericM)\
**Post date:** [January 13, 2022, 9:48am UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/5 "2022-01-13T09:48:29Z")

</div>

The automatic instrumentation is “With OneAgent” does that mean that I need a OneAgent running in Cloud Run at the same time ?

---

<div class="post-metadata">

**Author:** ![Aymeric\_M](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aymeric_m/32/35713_2.png) [@Aymeric\_M](https://community.dynatrace.com/u/Aymeric_M)\
**Post date:** [June 4, 2025, 10:24am UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/6 "2025-06-04T10:24:59Z")

</div>

We ended up doing exactly what is described in the documentation :  
[GCP Integration deploy OneAgent in the cloudrun container image](https://docs.dynatrace.com/docs/ingest-from/google-cloud-platform/gcp-integrations/cloudrun)

---

<div class="post-metadata">

**Author:** ![ECarlson](https://avatars.discourse-cdn.com/v4/letter/e/cab0a1/32.png) [@ECarlson](https://community.dynatrace.com/u/ECarlson)\
**Post date:** [June 11, 2025, 5:25pm UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/7 "2025-06-11T17:25:50Z")

</div>

[@Aymeric\_M](https://community.dynatrace.com/user/65101)&nbsp;[@AymericM](https://community.dynatrace.com/user/46944)&nbsp;- Was there something specific from the linked docs that did the trick for you?  
We are also trying to follow that documentation to integrate Dynatrace OneAgent into Cloud Run.  
We are encountering the following error though:  
ERROR: ld.so: object ‘/opt/dynatrace/oneagent/nonprod/agent/lib64/liboneagentproc.so  
2025-06-10T18:15:14.153350Z’ from LD\_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

---

<div class="post-metadata">

**Author:** ![Aymeric\_M](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aymeric_m/32/35713_2.png) [@Aymeric\_M](https://community.dynatrace.com/u/Aymeric_M)\
**Post date:** [June 12, 2025, 8:25am UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/8 "2025-06-12T08:25:17Z")

</div>

I don’t remember if we had this issue, but maybe this can help :&nbsp;[https://community.dynatrace.com/t5/Container-platforms/Docker-ERROR-ld-so-LD-PRELOAD-cannot-be-preloaded/m-p/215748](https://community.dynatrace.com/post/215748)

---

<div class="post-metadata">

**Author:** ![ECarlson](https://avatars.discourse-cdn.com/v4/letter/e/cab0a1/32.png) [@ECarlson](https://community.dynatrace.com/u/ECarlson)\
**Post date:** [June 17, 2025, 9:22pm UTC](https://community.dynatrace.com/t/monitoring-a-node-js-web-app-running-in-gcp-cloud-run/33703/9 "2025-06-17T21:22:52Z")

</div>

In case anyone else runs into the scenario we encountered the following is what resolved the issue for us.

**Original Error**  
ERROR: ld.so: object ‘/opt/dynatrace/oneagent/nonprod/agent/lib64/liboneagentproc.so  
2025-06-10T18:15:14.153350Z’ from LD\_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

**Resolution**

Our application was using Cloud Run execution env V2 which has a CPU architecture type of x86.

Specifying the arch type when retrieving the Dynatrace OneAgent resolved the issue.

$DT\_ENV\_FQDN/api/v1/deployment/installer/agent/unix/paas/latest?flavor=default&include=java&[u] **arch=x86**

[/u]cc:&nbsp;[@Aymeric\_M](https://community.dynatrace.com/user/65101)
