0

We are trying to set up trace across a number of node.js microservices.

node v10.14.2
google-cloud/pubsub v0.19.1
google-cloud/trace-agent v3.5.0

Services got http endpoint and pubsub integrtion. All services are talking to each other via pubsub.

Trace-agent picks up http requests and all other traces (ie mysql and pubsub.publish) correctly.

However, when a service get a message on a pubsub subscription, trace-agent see nothing.

Other trace (mysql and pubsub.publishing) are also not picked up when first request comming via pubsub.subscription.

We are using pull subscriptions that are listening for a message: subscription.on('message', processMessage);

How to enable trace-agent to pick up those traces that are comming via pubsub subscription?

Update 1: Enabled logs to include debug messages with start({ logLevel: 4 }); and found that a lot of trace messages are there, but not attached to the root span: 'Creating phantom child span because there is no root span.'

Andrinux
  • 364
  • 5
  • 9
  • When you check the API reporting [graphs](http://console.cloud.google.com/apis/api/cloudtrace.googleapis.com/overview), do you see if the calls is failing? Also, can you confirm if you have followed all the steps listed in this documentation for setting up [Trace](https://cloud.google.com/trace/docs/setup/nodejs) for Node.js? – Sunny J Jan 09 '19 at 19:28
  • API reporting graphs show no errors, only 2xx. Trace-agent was setup according to docs and http traces are picked up nicely and show up in all graphs. Only pubsub.subscriptions are under radar. – Andrinux Jan 10 '19 at 15:06
  • I was able to get ‘ERROR TraceWriter#publish: Received error with status code 400 while publishing traces to cloudtrace.googleapis.com: Error: Invalid trace ID’. Trying to figure out how to fix it. – Andrinux Jan 10 '19 at 16:32
  • 1
    This error seems to be related to a known issue which seems to have been fixed in Version 2.6.1. Hence, could you confirm what version you are using to ensure that you are not affected by this issue. See [Node.js Agent for Google Cloud Trace Changelog](https://github.com/googleapis/cloud-trace-nodejs/blob/v2.6.1/CHANGELOG.md#2018-04-02-version-261-beta-kjin) for more details. – Sunny J Jan 15 '19 at 18:43
  • we using the latest: ```google-cloud/trace-agent v3.5.0``` – Andrinux Jan 17 '19 at 11:28
  • Since this issue has been fixed in version 2.6.1 and you are in version 3.5.0 and are still experiencing similar behavior. I would recommend reporting it privately in the following issue tracker [page](https://issuetracker.google.com/issues/new?component=491273&template=1161129). This will create a private issue that only you and Googlers will have access to. provide as much information as possible including your project ID and this StackOverflow question link. – Sunny J Jan 22 '19 at 02:06
  • Thank you very much, we will do everything that depends on us. – Andrinux Jan 23 '19 at 09:49
  • Were you able to get traces from pubsub worker @Andrinux – Luv33preet Feb 24 '21 at 11:54

0 Answers0