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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoInit()protected voidprotected voiddoStart()org.apache.camel.CamelContextbooleanbooleanbooleanbooleanbooleanvoidsetBinders(String binders) Additional Micrometer binders to include such as jvm-memory, processor, jvm-thread, and so forth.voidsetCamelContext(org.apache.camel.CamelContext camelContext) voidsetClearOnReload(boolean clearOnReload) Clear the captured metrics data when Camel is reloading routes such as when using Camel JBang.voidsetEnableExchangeEventNotifier(boolean enableExchangeEventNotifier) Set whether to enable the MicrometerExchangeEventNotifier for capturing metrics on exchange processing times.voidsetEnableMessageHistory(boolean enableMessageHistory) Set whether to enable the MicrometerMessageHistoryFactory for capturing metrics on individual route node processing times.voidsetEnableRouteEventNotifier(boolean enableRouteEventNotifier) Set whether to enable the MicrometerRouteEventNotifier for capturing metrics on the total number of routes and total number of routes running.voidsetEnableRoutePolicy(boolean enableRoutePolicy) Set whether to enable the MicrometerRoutePolicyFactory for capturing metrics on route processing times.voidsetNamingStrategy(String namingStrategy) Controls the name style to use for metrics.voidsetTextFormatVersion(String textFormatVersion) The text-format version to use with Prometheus scraping.protected voidMethods 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, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods 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:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-
getNamingStrategy
-
setNamingStrategy
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
-
setTextFormatVersion
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
-
setBinders
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
- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStart
- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doShutdown
- Overrides:
doShutdownin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
setupHttpScraper
protected void setupHttpScraper()
-