-
Notifications
You must be signed in to change notification settings - Fork 50
feat: autopopulate GCF metadata #276
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
feat: autopopulate GCF metadata #276
Conversation
@@ -154,13 +154,25 @@ export class LoggingCommon { | |||
entryMetadata.httpRequest = metadata.httpRequest; | |||
} | |||
|
|||
// If running on Google Cloud Functions, add labels for the function | |||
// name, project, and region. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: We are special casing cloud functions here. Should we also be doing something for GAE and other managed environments? Note that we already do provide some of this information in the resource
field of the LogEntry: https://github.com/googleapis/nodejs-logging/blob/34878be64cb4475e364624c5a5ea86d4f809fcff/src/log.ts#L825-L834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, providing info for GAE would be good too. I was thinking that could be a follow-up PR, but if you think it belongs in this PR, I can add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to know what kind of logic we need to add. Secondly, is there a way to put this logic in the common logging library rather than here? I expect the logging-bunyan
also needs it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I am still investigating what information we should auto-populate from GAE. Yes, putting this in @google-cloud/logging
would be better. I'll move this work there.
This needs the functionality of PR #278 to be able to add |
Codecov Report
@@ Coverage Diff @@
## master #276 +/- ##
==========================================
- Coverage 92.15% 90.65% -1.51%
==========================================
Files 6 6
Lines 102 107 +5
Branches 18 22 +4
==========================================
+ Hits 94 97 +3
Misses 4 4
- Partials 4 6 +2
Continue to review full report at Codecov.
|
This PR is no longer needed since |
@DominicKramer I thought this PR was about |
My mistake, I meant to say |
Fixes: #91