-
Notifications
You must be signed in to change notification settings - Fork 29
feat: Add support for library instrumentation #789
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
Conversation
…gleapis/java-logging-logback into losalex/feat-instrumentation
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.
The duplication of the instrumentation status flags raises concerns about possible duplicated flows. It also may lead to incorrect behavior in the future because the logic is maintained in multiple libraries. I would suggest to keep instrumentation logic in the core library and allow to the logback library to pass additional attributes instead.
src/main/java/com/google/cloud/logging/logback/LoggingAppender.java
Outdated
Show resolved
Hide resolved
As I mentioned earlier, I would like to prevent this flag to be manipulated externally and there is no good way to restrict access in Java to specific functionality to some packages only - please let me know if you think otherwise. I do believe maintaining a separate flag is not an issue - we do set instrumentation only on first write attempt and base library also inspects the payload. Actually, maintaining a separate flag provides an ability in base library to avoid log entries payload inspection once instrumentation is written, so we do save cycles. |
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.
lgtm. we will need to add an integration test that validating sending a single instrumentation entry when the app uses both logback and JUL and/or explicit log writing.
Yep, integration tests should be added - will open a work item to work on this. |
This feature provides an ability to log extra entry with diagnostics structure which contains logging library information. Such entry is logged only once when first entry is written by a process using logging library.
Fixes #<788> ☕️