Skip to content

Conversation

YenguiSeddik
Copy link
Contributor

@YenguiSeddik YenguiSeddik commented Dec 17, 2024

As mentioned here spring-webflux-actuator-netty-thread-metrics, the metrics exposed by react-netty are not enabled by default in spring boot. To enable them, we add a custom bean

Seddik Yengui added 4 commits December 17, 2024 14:47
Signed-off-by: Seddik Yengui <seddik.yengui_externe@rte-france.com>
Signed-off-by: Seddik Yengui <seddik.yengui_externe@rte-france.com>
Signed-off-by: Seddik Yengui <seddik.yengui_externe@rte-france.com>

import java.util.function.Function;

// As discussed here https://stackoverflow.com/questions/66028195/spring-webflux-actuator-netty-thread-metrics,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I read in this, I think we should add either a template for the URI or disable the metrics that we don't use.

	 * It is strongly recommended to provide template-like form for the URIs. Without a conversion to a template-like form,
	 * each distinct URI leads to the creation of a distinct tag, which takes a lot of memory for the metrics.

from their doc.
See: https://quarkus.io/guides/telemetry-micrometer#define-tags

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can see all the metrics it generates here: http://localhost:9000/actuator/prometheus
if you navigate a bit in the app, it generates high cardinality metrics

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use something like:
https://gist.github.com/antoinebhs/8907cc2f9492ce84904d020b2d800977
to only store the metrics that we really use see documentation here: https://docs.micrometer.io/micrometer/reference/concepts/meter-filters.html
It works fine on my deployment, it only adds the two metrics (that are counter so no high cardinality issue/need to template etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


import java.util.function.Function;

// As discussed here https://stackoverflow.com/questions/66028195/spring-webflux-actuator-netty-thread-metrics,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the link, just explain

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Seddik Yengui added 2 commits December 23, 2024 15:53
Signed-off-by: Seddik Yengui <seddik.yengui_externe@rte-france.com>
Copy link
Contributor

@antoinebhs antoinebhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments improvements?

Signed-off-by: Seddik Yengui <seddik.yengui_externe@rte-france.com>
Copy link

@YenguiSeddik YenguiSeddik merged commit d2a317b into main Dec 26, 2024
4 checks passed
@YenguiSeddik YenguiSeddik deleted the enable_reactor_netty_configuraton branch December 26, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants