Class MicroProfileMetricsEndpoint

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @UriEndpoint(firstVersion="3.0.0",
                 scheme="microprofile-metrics",
                 title="MicroProfile Metrics",
                 syntax="microprofile-metrics:metricType:metricName",
                 producerOnly=true,
                 category=MONITORING,
                 headersClass=MicroProfileMetricsConstants.class)
    public class MicroProfileMetricsEndpoint
    extends org.apache.camel.support.DefaultEndpoint
    Expose metrics from Camel routes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.microprofile.metrics.MetricRegistry metricRegistry  
      • 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
      MicroProfileMetricsEndpoint​(String uri, org.apache.camel.Component component, org.eclipse.microprofile.metrics.MetricRegistry metricRegistry, org.eclipse.microprofile.metrics.MetricType metricType, String metricsName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)  
      org.apache.camel.Producer createProducer()  
      String getAction()  
      Long getCounterIncrement()  
      String getDescription()  
      String getDisplayName()
      Sets a display name within the metric metadata
      Boolean getGaugeDecrement()  
      Boolean getGaugeIncrement()  
      Number getGaugeValue()  
      Long getMark()  
      String getMetricName()  
      org.eclipse.microprofile.metrics.MetricRegistry getMetricRegistry()  
      org.eclipse.microprofile.metrics.MetricType getMetricType()  
      String getMetricUnit()  
      String getTags()  
      Long getValue()  
      void setAction​(String action)
      The action to use when using the Timer metric type
      void setCounterIncrement​(Long counterIncrement)
      The amount to increment to use when using the Counter metric type
      void setDescription​(String description)
      Sets a description within the metric metadata
      void setDisplayName​(String displayName)  
      void setGaugeDecrement​(Boolean gaugeDecrement)
      Decrements a gauge value when using the ConcurrentGauge metric type
      void setGaugeIncrement​(Boolean gaugeIncrement)
      Increments a gauge value when using the ConcurrentGauge metric type
      void setGaugeValue​(Number gaugeValue)
      Sets the gauge value when using the Gauge metric type
      void setMark​(Long mark)
      The mark value to set when using the Meter metric type
      void setMetricUnit​(String metricUnit)
      Sets a metric unit within the metric metadata
      void setTags​(String tags)  
      void setValue​(Long value)
      The value to set when using the Histogram metric type
      • Methods inherited from class org.apache.camel.support.DefaultEndpoint

        configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStart, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, 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 interface org.apache.camel.Endpoint

        getEndpointBaseUri, isSingletonProducer
      • 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
    • Field Detail

      • metricRegistry

        protected final org.eclipse.microprofile.metrics.MetricRegistry metricRegistry
    • Constructor Detail

      • MicroProfileMetricsEndpoint

        public MicroProfileMetricsEndpoint​(String uri,
                                           org.apache.camel.Component component,
                                           org.eclipse.microprofile.metrics.MetricRegistry metricRegistry,
                                           org.eclipse.microprofile.metrics.MetricType metricType,
                                           String metricsName)
    • Method Detail

      • createProducer

        public org.apache.camel.Producer createProducer()
                                                 throws Exception
        Throws:
        Exception
      • createConsumer

        public org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)
                                                 throws Exception
        Throws:
        Exception
      • getMetricRegistry

        public org.eclipse.microprofile.metrics.MetricRegistry getMetricRegistry()
      • getMetricType

        public org.eclipse.microprofile.metrics.MetricType getMetricType()
      • getMetricName

        public String getMetricName()
      • getTags

        public String getTags()
      • setTags

        public void setTags​(String tags)
      • getAction

        public String getAction()
      • setAction

        public void setAction​(String action)
        The action to use when using the Timer metric type
      • getMark

        public Long getMark()
      • setMark

        public void setMark​(Long mark)
        The mark value to set when using the Meter metric type
      • getValue

        public Long getValue()
      • setValue

        public void setValue​(Long value)
        The value to set when using the Histogram metric type
      • getCounterIncrement

        public Long getCounterIncrement()
      • setCounterIncrement

        public void setCounterIncrement​(Long counterIncrement)
        The amount to increment to use when using the Counter metric type
      • getGaugeIncrement

        public Boolean getGaugeIncrement()
      • setGaugeIncrement

        public void setGaugeIncrement​(Boolean gaugeIncrement)
        Increments a gauge value when using the ConcurrentGauge metric type
      • getGaugeDecrement

        public Boolean getGaugeDecrement()
      • setGaugeDecrement

        public void setGaugeDecrement​(Boolean gaugeDecrement)
        Decrements a gauge value when using the ConcurrentGauge metric type
      • getGaugeValue

        public Number getGaugeValue()
      • setGaugeValue

        public void setGaugeValue​(Number gaugeValue)
        Sets the gauge value when using the Gauge metric type
      • getDescription

        public String getDescription()
      • setDescription

        public void setDescription​(String description)
        Sets a description within the metric metadata
      • getDisplayName

        public String getDisplayName()
        Sets a display name within the metric metadata
      • setDisplayName

        public void setDisplayName​(String displayName)
      • getMetricUnit

        public String getMetricUnit()
      • setMetricUnit

        public void setMetricUnit​(String metricUnit)
        Sets a metric unit within the metric metadata