Class MicrometerPrometheus

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.micrometer.prometheus.MicrometerPrometheus
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.CamelMetricsService, org.apache.camel.spi.HasCamelContext, org.apache.camel.StatefulService, org.apache.camel.StaticService, org.apache.camel.SuspendableService

@JdkService("micrometer-prometheus") @Configurer @ManagedResource(description="Micrometer Metrics Prometheus") public class MicrometerPrometheus extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.CamelMetricsService, org.apache.camel.StaticService
  • Field Summary

    Fields inherited from class org.apache.camel.support.service.BaseService

    BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
     
    protected void
     
     
    org.apache.camel.CamelContext
     
     
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    void
    setBinders(String binders)
    Additional Micrometer binders to include such as jvm-memory, processor, jvm-thread, and so forth.
    void
    setCamelContext(org.apache.camel.CamelContext camelContext)
     
    void
    setClearOnReload(boolean clearOnReload)
    Clear the captured metrics data when Camel is reloading routes such as when using Camel JBang.
    void
    setEnableExchangeEventNotifier(boolean enableExchangeEventNotifier)
    Set whether to enable the MicrometerExchangeEventNotifier for capturing metrics on exchange processing times.
    void
    setEnableMessageHistory(boolean enableMessageHistory)
    Set whether to enable the MicrometerMessageHistoryFactory for capturing metrics on individual route node processing times.
    void
    setEnableRouteEventNotifier(boolean enableRouteEventNotifier)
    Set whether to enable the MicrometerRouteEventNotifier for capturing metrics on the total number of routes and total number of routes running.
    void
    setEnableRoutePolicy(boolean enableRoutePolicy)
    Set whether to enable the MicrometerRoutePolicyFactory for capturing metrics on route processing times.
    void
    setNamingStrategy(String namingStrategy)
    Controls the name style to use for metrics.
    void
    setTextFormatVersion(String textFormatVersion)
    The text-format version to use with Prometheus scraping.
    protected void
     

    Methods inherited from class org.apache.camel.support.service.BaseService

    build, doBuild, doFail, doLifecycleChange, doResume, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Constructor Details

    • MicrometerPrometheus

      public MicrometerPrometheus()
  • Method Details

    • getCamelContext

      public org.apache.camel.CamelContext getCamelContext()
      Specified by:
      getCamelContext in interface org.apache.camel.spi.HasCamelContext
    • setCamelContext

      public void setCamelContext(org.apache.camel.CamelContext camelContext)
      Specified by:
      setCamelContext in interface org.apache.camel.CamelContextAware
    • getNamingStrategy

      public String getNamingStrategy()
    • setNamingStrategy

      public void setNamingStrategy(String namingStrategy)
      Controls the name style to use for metrics.

      Default = uses micrometer naming convention. Legacy = uses the classic naming style (camelCase)

    • isEnableRoutePolicy

      public boolean isEnableRoutePolicy()
    • setEnableRoutePolicy

      public void setEnableRoutePolicy(boolean enableRoutePolicy)
      Set whether to enable the MicrometerRoutePolicyFactory for capturing metrics on route processing times.
    • isEnableMessageHistory

      public boolean isEnableMessageHistory()
    • setEnableMessageHistory

      public void setEnableMessageHistory(boolean enableMessageHistory)
      Set whether to enable the MicrometerMessageHistoryFactory for capturing metrics on individual route node processing times.

      Depending on the number of configured route nodes, there is the potential to create a large volume of metrics. Therefore, this option is disabled by default.

    • isEnableExchangeEventNotifier

      public boolean isEnableExchangeEventNotifier()
    • setEnableExchangeEventNotifier

      public void setEnableExchangeEventNotifier(boolean enableExchangeEventNotifier)
      Set whether to enable the MicrometerExchangeEventNotifier for capturing metrics on exchange processing times.
    • isEnableRouteEventNotifier

      public boolean isEnableRouteEventNotifier()
    • setEnableRouteEventNotifier

      public void setEnableRouteEventNotifier(boolean enableRouteEventNotifier)
      Set whether to enable the MicrometerRouteEventNotifier for capturing metrics on the total number of routes and total number of routes running.
    • isClearOnReload

      public boolean isClearOnReload()
    • setClearOnReload

      public void setClearOnReload(boolean clearOnReload)
      Clear the captured metrics data when Camel is reloading routes such as when using Camel JBang.
    • getTextFormatVersion

      public String getTextFormatVersion()
    • setTextFormatVersion

      public void setTextFormatVersion(String textFormatVersion)
      The text-format version to use with Prometheus scraping.

      0.0.4 = text/plain; version=0.0.4; charset=utf-8 1.0.0 = application/openmetrics-text; version=1.0.0; charset=utf-8

    • getBinders

      public String getBinders()
    • setBinders

      public void setBinders(String binders)
      Additional Micrometer binders to include such as jvm-memory, processor, jvm-thread, and so forth. Multiple binders can be separated by comma.

      The following binders currently is available from Micrometer: class-loader, commons-object-pool2, file-descriptor, hystrix-metrics-binder, jvm-compilation, jvm-gc, jvm-heap-pressure, jvm-info, jvm-memory, jvm-thread, log4j2, logback, processor, uptime

    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doShutdown

      protected void doShutdown() throws Exception
      Overrides:
      doShutdown in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • setupHttpScraper

      protected void setupHttpScraper()