Search code examples
monitoringspring-boot-actuatormicrometerspring-micrometerapm

Is there a property in micrometer than can disable sending SFx metrics?


I am working on a spring-boot project that has SignalFx (APM) instrumented for monitoring, instrumentation is done using micrometer and actuator.
I don't want metrics to be sent to SFx when I run application on local i.e. when my profile is set to local.
Is there a property that can be used to disable metrics being sent from local?
I have a facility to configure profile specific properties.


Solution

  • Take a look at org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxMetricsExportAutoConfiguration in spring-boot-actuator-autoconfigure module Available Here

    This class loads beans relevant for SignalFx.

    It loads only if a property: management.metrics.export.signalfx.enabled has a value true or not defined at all.

    So in profile local you can create application-local.properties file that will contain:

    management.metrics.export.signalfx.enabled=false
    

    Of course the same is possible with yaml based configurations.