I have a spring boot application and I want to configure log tracing to all the application, I added the setup for **datadog Agent ** as in in the documentation: https://docs.datadoghq.com/tracing/setup_overview/setup/java/?tabs=containers and I can see trace ids and spanIds associated with each request, there are other options such as Spring cloud Sleuth to add tracing and span ids as well:
https://spring.io/projects/spring-cloud-sleuth
and also in the datadog documentation, there is a way for connecting Java logs and tracing in https://docs.datadoghq.com/tracing/connect_logs_and_traces/java/?tabs=log4j2
I have a confusion with this three approaches and which one of them I can use for the tracing purpose, with spring sleuth I know that is easier to generate span a trace ids, but not sure if them are sent to datadog or I need to configure something additional.
Also the connecting Java logs and tracing vs datadog agent its not clear for me.
I am new with this topic and it is not clear for me how can I implement tracing for all the process included in a request.
For exporting the metrics (to Prometheus) from the spring boot micro service, we can use the spring boot actuator and one more option is to use the Prometheus JMX exporter(https://github.com/prometheus/jmx_exporter) as a javaAgent when running the service. Though both of the options serve the same purpose, I do see that the JMX exporter is exporting way lot more metrics than the spring boot actuator. I was scouting through some spring boot documentations to see if there is any option to enable more metrics with spring boot actuator, looks like all the JMX metrics are enabled by default. So the questions is, is there a way to expose more metrics from spring boot actuator? Is there any recommendation or comparison study available for both the options mentioned above?
Any help here is greatly appreciated. Thanks!
If you are using Spring boot 2.x, then it works like this:
In Spring Boot 2.0, the in-house metrics were replaced with Micrometer support, so we can expect breaking changes. If our application was using metric services such as GaugeService or CounterService, they will no longer be available.
Instead, we're expected to interact with Micrometer directly. In Spring Boot 2.0, we'll get a bean of type MeterRegistry autoconfigured for us.
for Spring boot 1.x:
The metrics endpoint publishes information about OS and JVM as well as application-level metrics. Once enabled, we get information such as memory, heap, processors, threads, classes loaded, classes unloaded, and thread pools along with some HTTP metrics as well.
and this seems to work like Prometheus JMX
I have a Spring Boot application with Spring Cloud components, namely org.springframework.cloud:spring-cloud-starter-aws-parameter-store-config.
The component produces logs at WARN level when the application starts which I want to suppress.
Setting a log level in the application.yml like
logging:
level:
org.springframework.cloud.aws.paramstore.AwsParamStorePropertySourceLocator: ERROR
did not work. Apparently its because this cloud component works at bootstrap time before the Spring Boot context starts and the application.yml is read.
How can I suppress this component logs in the best way?
Currently I'm upgrading from Spring Boot 1.5 to Spring Boot 2.1.5.
I know the migration guide https://www.thymeleaf.org/doc/articles/thymeleaf3migration.html
But I have some huge Tenant based template in template wrapping mechanism which is strongly relying on IResourceResolver.
As I see here https://github.com/thymeleaf/thymeleaf/issues/419 this topic was refactored completely.
How can I use Spring Boot 2 with the old thymeleaf 2?
We plan a complete frontend rework in a few months, than I would not use thymeleaf anymore. But I have to upgrade to spring boot 2 because auf some spring security topics.
I have seen a video whereby they enable debug logging for spring framework in a spring boot project. they created an application.properties file and entered logging.level.org.springframework = debug in the file.
I would like to do same for my application but I am not using spring boot. I have added dependencies like log4j but I am not sure about the settings.
Can someone share a link please?
thanks.