zapdriver icon indicating copy to clipboard operation
zapdriver copied to clipboard

logging.googleapis.com/labels not processed in stackdriver

Open caskolkm opened this issue 5 years ago • 3 comments

As the docs describe labels needs to be logged in a JSON log field called: "logging.googleapis.com/labels".

After deploying our application to CloudRun, we seeing that the labels are not part of the labels in the LogEntry, but still are part of jsonPayload.

jsonPayload: { caller: "logging.go:61" logging.googleapis.com/labels: { x-cloud-debug: "test" } logging.googleapis.com/trace_sampled: "true" message: "passing metadata [x-rid]=[1234354]" timestamp: "2019-11-07T13:42:33.524859762Z" } labels: { instanceId: "00bf4bf02d6b0da606a48c835435d7757866a1931b821b6f7bc6402039a3ebd98be580e0cff0273b976d46eddbdc9f5b8f740972efa2866598246ddf6b4c9d9682436f" }

caskolkm avatar Nov 08 '19 06:11 caskolkm

Tried to use zapdriver 1.2.0 which uses labels in stead of logging.googleapis.com/labels and it also didn't work.

Does someone has a working example?

caskolkm avatar Nov 08 '19 07:11 caskolkm

We changed it to logging.googleapis.com/labels after this PR was landed: https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/pull/292.

But I don't think we are actively using labels in StackDriver right now, so there might definitely be something here that we are missing.

If you figure out what the right approach is, be sure to let us know so we can fix the library.

JeanMertz avatar Nov 08 '19 08:11 JeanMertz

Both labels and logging.googleapis.com/labels don't work in Cloud-Run, maybe it's a cloud-run thing, but i don't know yet.

caskolkm avatar Nov 08 '19 09:11 caskolkm