Spring actuator endpoint seems to be called twice - spring

This does not block me in any way, just curious. Today during debugging my application I run into a weird logs:
{"#timestamp":"2020-04-17T16:30:55.128+0000","#version":"1","message":"Mapped to Actuator web endpoint 'health'","logger_name":"org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping","thread_name":"qtp250197932-43","level":"DEBUG","level_value":10000,"caller_class_name":"org.springframework.web.servlet.handler.AbstractHandlerMapping","caller_method_name":"getHandler","caller_file_name":"AbstractHandlerMapping.java","caller_line_number":414}
{"#timestamp":"2020-04-17T16:30:55.128+0000","#version":"1","message":"Mapped to Actuator web endpoint 'health'","logger_name":"org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping","thread_name":"qtp250197932-45","level":"DEBUG","level_value":10000,"caller_class_name":"org.springframework.web.servlet.handler.AbstractHandlerMapping","caller_method_name":"getHandler","caller_file_name":"AbstractHandlerMapping.java","caller_line_number":414}
Does anyone have an idea why I got two identical records about accessing health endpoint but from different threads?

Related

fix different traceId with istio sidecar proxy and spring boot sleuth

Spring boot apps with Sleuth are deployed in pods with istio sidecar injected alongside.
istio virtual service ingresses traffic into the mesh and proxies the request to pods correctly.
Both logs are seen in kibana - one for istio-proxy (sidecar) and another for the spring app using logback + sleuth.
However I would like to see same traceId (x-request-id) header for both requests. Is this a good practice or is rather what is the right way to join/tie these request logs ?
I did one test and found out that istio-proxy is sending 'x-request-id' which corresponds to the value of traceId. However spring creates a new traceId and wondering if there is a way to make them same ?

Spring boot - Netty returns 502 status

I have a Spring boot based application with reactive netty server. The application is running on multiple nodes with VIP in front of the nodes. Client applications connect to VIP and VIP routes to one of the node with hash based routing. VIP is returning 502 occasionally and VIP says, it received 502 response from Application. Application seems to be healthy and not sure why app is returning 502 occasionally and no logs in application logs related to 502. Is there any way to enable netty logs for 502? Any clue on how to narrow down the issue?
Our application implements WebFilter and logs each request and response, but unable to see anything related to 502. Is there anything in spring boot netty to enable more logs to triage 502.

Securing a Spring Boot which has just had endpoints exposed

I've just been playing around with Spring Boot and developed a small Spring Cloud Streams app which basically acts as a destination for incoming messages through a queue.
However, I wanted to expose a health check endpoint so that I can verify if the service is up and running.
Until now, spring.main.web-application-type has been none. However, tu run actuator I must have that on.
I want to think that having the previously mentioned property to none didn't make the service exposed to the outside world and now that it has been enabled I must check and prevent some kind of accesses?
Are there any security concerns I must check now?

Spring Boot health checks for non-web apps

After reading up on the Spring Boot Actuator features, specifically the health endpoint, I've found it quite useful for implementing docker container health checks for some of my services.
However some of my services are not webapps, and it seems like overkill to enable HTTP just to allow the container to check the app is up and running. Looking through the options, actuator seems to support HTTP endpoints, JMX, and SSH/Telnet, though that last one apparently requires you to be running a JDK, and is going away in boot 2.0.
Are there any established ways of doing container healthchecks for non-web spring boot apps?

How to collect Metrics in Spring-Cloud Zuul

We have created our application with Spring-Cloud Eureka and Spring-Cloud Zuul with multiple core / support micro services registering to Eureka and accessed via Zuul, everything works fine.
We wanted to collect metrics of the APIs that is accessed via ZUUL.
For example, API - ".../extract" need to know how many times its accessed in 5,15 and 60min time period.
We did some analysis and found various metrics library like Netflix Servo, Dropwiard Metrics, Spring Boot Actuator. Everything points to implementation at the service or API level. We wanted our metrics to be captured at ZUUL itself so that a simple counter is implemented in ZUUL and that would provide us the required metrics. Any suggestion in how to implement this would be helpful.

Resources