Comments (16)
Endpoints can be manually excluded as well, see: https://github.com/opentracing-contrib/java-spring-web/blob/master/opentracing-spring-web-starter/src/test/resources/application-test.yml#L22
But definitely the actuator endpoints should not be taken into account
from java-spring-web.
Thanks @pavolloffay and @geoand for the replies.
Per default, the actuator health endpoint is already ignored in the skip pattern, which is fine. However, the queries for the healthiness of a database (e.g. Mysql or Mongo) produce a span, which are invoked as part of the request to /actuator/health
.
from java-spring-web.
I think this should not happen, the helthcheck probes should not be traced.
@ask4gilles could you please comment on this one? It will also transfer it to web repository.
from java-spring-web.
@mariusgiger do you know which URLs are used for querying the healthiness of the database?
from java-spring-web.
@geoand these spans get produced when calling /actuator/health
.
from java-spring-web.
OK, thanks.
@ask4gilles any idea off the top of your head?
from java-spring-web.
Hi @mariusgiger @geoand and @pavolloffay
All actuator endpoints are skipped by default.
Per default, the actuator health endpoint is already ignored in the skip pattern, which is fine. However, the queries for the healthiness of a database (e.g. Mysql or Mongo) produce a span, which are invoked as part of the request to
/actuator/health
.
From what I understand from the above, this could be caused by the underlying select queries targeting the database(s) in the health actuator itself. I think you could verify it easily by either disabling the DB health check inside the actuator (management.health.db.enabled=false
) or disabling the SQL tracing.
If this is the issue, the sanity SQL query should probably be excluded from the SQL tracing.
If this does not solve your issue, can you please provide a minimal sample project in order to reproduce?
(BTW, this one opentracing-contrib/java-spring-jaeger#63 (comment) can be closed)
from java-spring-web.
Hi @ask4gilles,
Indeed, there are no more spans if the healthcheck for the database is disabled.
i.e. in my case:
management:
health:
db:
enabled: false
mongo:
enabled: false
Most probably this also happens for other dependencies for healthchecks that support tracing.
Is it possible to disable tracing for a package resp. set of classes? If that is the case, either the concrete classes could be disabled (e.g. DataSourceHealthIndicator) or the base classes (e.g. AbstractHealthIndicator and AbstractReactiveHealthIndicator) or the whole package org.springframework.boot.actuate
.
from java-spring-web.
@mariusgiger thanks for the feedback.
If you want to keep your DB health checks and avoid them to be traced, you could:
- If you are not interested in JDBC tracing:
opentracing.spring.cloud.jdbc.enabled=false
- If you want to keep the JDBC tracing but exclude the health query, add it to this property
opentracing.spring.cloud.jdbc.ignoreStatements
I don't see the equivalent properties for Mongo DB in the opentracing-spring-cloud-mongo-starter, but apparently there is also a way, see here: https://github.com/opentracing-contrib/java-mongo-driver#exclude-commands-from-tracing
Regarding the other types of health checks in the link and a possible global exclusion for them I don't think it's foreseen but I may be wrong here (@pavolloffay @geoand ?) I think that it would be more on case by case basis.
To summarize, this is not something related to the tracing of the actuators endpoints by themselves (and the title of this issue should be modified). This is also not related to this repo but to starters provided by opentracing-spring-cloud. So it could be moved there as an enhancement request.
from java-spring-web.
Thanks for checking @ask4gilles!
from java-spring-web.
Thank you @ask4gilles for the response! This resolves the issue for me.
from java-spring-web.
@mariusgiger Awesome, glad it helped!
from java-spring-web.
@geoand this one can be closed 😉
from java-spring-web.
👍
from java-spring-web.
Please any update for this issue ?
from java-spring-web.
The actuator/health endpoint is traced even without a DB, and I cannot figure out how to turn this off. Looking at generated span, this is coming from io.opentelemetry.spring-webmvc-6.0. I never imported that dependency, I searched and cannot find any clue how to configure that. Any idea?
from java-spring-web.
Related Issues (20)
- Spring MVC integration example HOT 1
- Why is TracingHandlerInterceptor conditional on missing TracingFilter? HOT 3
- upgrade to opentracing 0.33.0 HOT 1
- Clarify project status HOT 3
- Error when running @SpringBootTest with SpringBootTest.WebEnvironment.NONE HOT 1
- `Scope` should be closed in the method of `afterConcurrentHandlingStarted` for async request
- Putting handlers into log fields makes ZipkinV2Reporter cause Gson errors
- Version 0.3.4 fails with OpenTracing API 0.33.0 HOT 3
- Bug: Span has already been finished; will not be reported again HOT 2
- spans not marked as error when Exceptions handled by @ControllerAdvice
- TracingHandlerInterceptor order cannot be changed and even overridden
- Span not finished when subscription is cancelled HOT 8
- Span finishes before webclient completes
- Span customization - Extend WebFluxSpanDecorator HOT 1
- Skip patterns does not apply to RestTemplate client requests
- use controller method name as operation name in webflux
- Span object is null when passing RequestEntity<?> as a request parameter
- TracingRestTemplateInterceptor does not support sorting
- Bug: (java.lang.IllegalArgumentException) Service name must not be null or empty HOT 1
- opentracing-spring-web-starter incompatible with Spring Boot 2.6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-spring-web.