Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the "operation" field #842

Open
niklasschloegel opened this issue Feb 1, 2024 · 0 comments · May be fixed by #843
Open

Add support for the "operation" field #842

niklasschloegel opened this issue Feb 1, 2024 · 0 comments · May be fixed by #843
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@niklasschloegel
Copy link

I wanted to add operation details to my logs as described in https://cloud.google.com/logging/docs/structured-logging#structured_logging_special_fields.

When writing logs like

logger.info("logmessage...", {"logging.googleapis.com/operation": { id: "doStuff", producer: requestId }})

I expected the log entries to have an "operation" field in the Log Explorer UI, although they just appeared in messages.jsonPayload.metadata as a string.

Similar to how traceIds are handled in common.ts, I would want to implement the same handling for operations, as passing traceIds works like this as intended:

logger.info("logmessage...", {"logging.googleapis.com/trace": "projects/projectid/..."})
@niklasschloegel niklasschloegel added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Feb 1, 2024
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/nodejs-logging-winston API. label Feb 1, 2024
niklasschloegel added a commit to niklasschloegel/nodejs-logging-winston that referenced this issue Feb 2, 2024
@niklasschloegel niklasschloegel linked a pull request Feb 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants