cloud-logging-data-source-plugin icon indicating copy to clipboard operation
cloud-logging-data-source-plugin copied to clipboard

message from jsonPayload doesn't show up in Grafana

Open larsivi opened this issue 1 year ago • 1 comments

Our logs are created using https://www.npmjs.com/package/@google-cloud/logging-bunyan, which gives us a jsonPayload with a message property that is an object with properties.

In Grafana I get the jsonPayload.logName:"projects/{{projectId}}/logs/bunyan_log_applog" label, but not anything resembling the message object.

Looking at the go-code, it seems it is extracted as body and put into something content, but I don't find this anywhere in Grafana.

larsivi avatar Jul 25 '24 18:07 larsivi

We're seeing a similar issue in our project. The data displays without issue in GCP's log explorer, but the Cloud Logging plugin appears to omit this field entirely.

Any word on workarounds or fixes?

ak185158 avatar Apr 25 '25 17:04 ak185158

This message actually is showing as the main text of the log in Grafana. For example:

For the log entry:

{"name":"my-service","hostname":"shenxiang-macbookpro2.roam.internal","pid":76794,"level":30,"msg":"shields at 99%","time":"2025-05-19T22:43:55.153Z","v":0}

In Grafana: Image

In Cloud Logging: Image

However, if the message is an object itself, you will see a blank field. We can probably stringfy the object though. If that's acceptable, we can add a fix in the next release.

xiangshen-dk avatar May 19 '25 22:05 xiangshen-dk

Close it for now. Feel free to reopen or create a new one if you have further issues.

xiangshen-dk avatar Jul 01 '25 04:07 xiangshen-dk