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.CamelContextgetPath()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetBaseEndpointURIExchangeEventNotifier(boolean baseEndpointURIExchangeEventNotifier) Set whether to use base endpoint URI when capturing metrics on exchange processing times.voidsetBinders(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.voidsetEnableInstrumentedThreadPoolFactory(boolean enableInstrumentedThreadPoolFactory) Set whether to gather performance information about Camel Thread Pools by injecting an InstrumentedThreadPoolFactory.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.voidThe path endpoint used to expose the metrics.voidsetRoutePolicyLevel(String routePolicyLevel) Sets the level of information to capture. all = both context and routes.voidsetSkipCamelInfo(boolean skipCamelInfo) Skip the evaluation of "app.info" metric which contains runtime provider information (default, `false`).voidsetTextFormatVersion(String textFormatVersion) The text-format version to use with Prometheus scraping.protected voidsetupHttpScraper(org.apache.camel.component.platform.http.vertx.VertxPlatformHttpRouter router) Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doStop, doSuspend, fail, getInternalLock, 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. -
getRoutePolicyLevel
-
setRoutePolicyLevel
Sets the level of information to capture. all = both context and routes. -
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. -
isBaseEndpointURIExchangeEventNotifier
public boolean isBaseEndpointURIExchangeEventNotifier() -
setBaseEndpointURIExchangeEventNotifier
public void setBaseEndpointURIExchangeEventNotifier(boolean baseEndpointURIExchangeEventNotifier) Set whether to use base endpoint URI when 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. -
isEnableInstrumentedThreadPoolFactory
public boolean isEnableInstrumentedThreadPoolFactory() -
setEnableInstrumentedThreadPoolFactory
public void setEnableInstrumentedThreadPoolFactory(boolean enableInstrumentedThreadPoolFactory) Set whether to gather performance information about Camel Thread Pools by injecting an InstrumentedThreadPoolFactory. -
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. -
isSkipCamelInfo
public boolean isSkipCamelInfo() -
setSkipCamelInfo
public void setSkipCamelInfo(boolean skipCamelInfo) Skip the evaluation of "app.info" metric which contains runtime provider information (default, `false`). -
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
-
getPath
-
setPath
The path endpoint used to expose the metrics. -
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(org.apache.camel.component.platform.http.vertx.VertxPlatformHttpRouter router)
-