-
Notifications
You must be signed in to change notification settings - Fork 4
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: add logs and update deps in java services #990
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gradlew scripts were already there for year service, so this is just an update to those files. other services did not have them at all. according to baeldung/gradle-wrapper, these are recommended to be checked into source control to allow devs to run the project without needing to install gradle.
So this works, but there's 2 main problems with it in my mind:
Edit: updated to include environment variable and added extra notes to PR description. This works OOTB for both 1.x and 2.x of otel-java, just needs the OTEL_LOGS_EXPORTER env var on 1.x. |
removing log4j2.xml bc its not used at all. log4j2-spring.xml would be used and it would require some changes to log pkgs so for now we'll just keep defaults. if using the sdk instead of the java agent, this work would be required, as would the other packages like the appender.
robbkidd
approved these changes
Mar 28, 2024
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
Short description of the changes
docker-compose.java.yml
to includeOTEL_LOGS_EXPORTER=otlp
Some findings:
OTEL_LOGS_EXPORTER=otlp
log4j2.xml
or in this specific service that uses Springboot, uselog4j2-spring.xml
. Some instructions are here and here.MapMessage
showed up in Honeycomb as an empty string""
, whereasObjectMessage
showed{selected_year=2015}
which is why I went with it. Maybe that's something to look further into, as MapMessage seems like it might be a nicer format.How to verify this has the expected result
From the root directory run
tilt up java
, or from the java year service set env vars includingOTEL_LOGS_EXPORTER=otlp
then./gradlew build
and./gradlew bootRun
... and curl the endpointcurl localhost:6001/year
.The log for selected year should show up in Honeycomb on the
YearService.getYear
span