Git Product home page Git Product logo

Comments (16)

geoand avatar geoand commented on May 27, 2024 3

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.

mariusgiger avatar mariusgiger commented on May 27, 2024 1

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.

spans

from java-spring-web.

pavolloffay avatar pavolloffay commented on May 27, 2024

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.

geoand avatar geoand commented on May 27, 2024

@mariusgiger do you know which URLs are used for querying the healthiness of the database?

from java-spring-web.

mariusgiger avatar mariusgiger commented on May 27, 2024

@geoand these spans get produced when calling /actuator/health.

from java-spring-web.

geoand avatar geoand commented on May 27, 2024

OK, thanks.

@ask4gilles any idea off the top of your head?

from java-spring-web.

ask4gilles avatar ask4gilles commented on May 27, 2024

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.

mariusgiger avatar mariusgiger commented on May 27, 2024

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.

ask4gilles avatar ask4gilles commented on May 27, 2024

@mariusgiger thanks for the feedback.
If you want to keep your DB health checks and avoid them to be traced, you could:

  1. If you are not interested in JDBC tracing: opentracing.spring.cloud.jdbc.enabled=false
  2. 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.

geoand avatar geoand commented on May 27, 2024

Thanks for checking @ask4gilles!

from java-spring-web.

mariusgiger avatar mariusgiger commented on May 27, 2024

Thank you @ask4gilles for the response! This resolves the issue for me.

from java-spring-web.

ask4gilles avatar ask4gilles commented on May 27, 2024

@mariusgiger Awesome, glad it helped!

from java-spring-web.

ask4gilles avatar ask4gilles commented on May 27, 2024

@geoand this one can be closed 😉

from java-spring-web.

geoand avatar geoand commented on May 27, 2024

👍

from java-spring-web.

ahmedju avatar ahmedju commented on May 27, 2024

Please any update for this issue ?

from java-spring-web.

EricBuist avatar EricBuist commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.