-
Notifications
You must be signed in to change notification settings - Fork 39
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
Spring Boot Open Telemetry Starter + Auto Exporter interaction #366
Comments
Hi @pan-daniel, The GCP Resource Detector is bundled with the OpenTelemetry Spring Boot Starter, but is disabled by default. You need to enable the GCP resource detector. A few other things I noticed:
Let me know if this helps. |
Hey! Thanks for getting back to me. After enabling the GCP resource detection again and upgrading the library to The recommendation of using the shaded version (latest) also did not work out, just fyi:
Would you however be able to advice about the path filtering as well from the original question? Thank you a lot again |
Hi @pan-daniel, Regarding the Regarding your path filtering question - are you intentionally trying to drop some spans before export so that they don't show up? Based on the config snippet you shared, it seems like you are trying to drop all traces that would be generated when visiting "/actuator". I have not used sampler customizer before, but I think the custom sampler you have used should work. If it is not working, I suspect you are not supplying this customizer returned from your It is difficult to debug this further without looking at your code, but my suspicion is that because you want to customize the You need to build an extension JAR in which you customize the sampling as you have shown above. This JAR would then be supplied through JVM args of you application: Note: The above information is based on my experience with Java AutoInstrumentation Agent, but I think Spring Boot Starter agent works in a similar fashion. Let me know if this helps. |
Closing this issue, please feel free to reopen in case there are any follow-up questions or concerns. |
@pan-daniel, I looked into this a bit more and seems like Java Auto agent advice is not applicable to Spring boot starter. As a quick follow-up: Are you using Spring Boot Native images ? If not, the default recommendation is to use OpenTelemetry Java Agent. For Spring Boot Native images I have created a separate issue to document its support through an example in this repo: #376 Let me know if there are any additional questions. |
Added sample Spring boot Application that uses OpenTelemetry Spring Starter Agent for auto-instrumentation. The sample can be located here. |
Good morning!
I have been reading through the documentation trying to make our project work with Spring Boot Open Telemetry starter, but to no avail.
I have project that is configured as such (relevant parts from POM):
And here are our application.yml:
Spring Boot version is 3.3.3. The application is deployed on the GKE.
The auto export of tracing is working flawlessly, so I cannot say anything about it.
However, the monitoring is constantly complaining in the container, with the following message:
The obvious point in here is that the resource labels are incomplete, so I checked out containers and indeed we didn't have those, but using the downward API I filled these out. I can see that the resource has the correct labels now.
But still, no avail. Later on I have found this relevant piece of documentation here about this other library:
https://opentelemetry.io/docs/zero-code/java/agent/configuration/#enable-resource-providers-that-are-disabled-by-default
This documentation has shown me that my thinking was right and I needed the labels for the resource, which now I have. But even after activating the resource provider either with env variables or properties, this doesn't change the behaviour of the exporter.
In fact, I am not even sure if they play nicely together, or is the auto-exporter not taking the detected resources into consideration. My thinking right now is that yes, we have the labels in the resource of k8s_container, but I guess the resource can also be TimeSeries and they do not have those appended?
So! Could you please assist me or point me to the right direction? Basically I want to achieve with just the Spring Boot Open Telemetry starter and the auto exporters the metrics to work. With tracing it does.
Additionally, is there a way to limit what kind of spans does the exporter take into account? I followed the Spring Boot's documentation in disabling the actuator from being traced, but it seems also to have no effect on the exporter.
Thank you for your assistance!
The text was updated successfully, but these errors were encountered: