Prometheus Trait
The Prometheus trait configures the Prometheus JMX exporter and exposes the integration with a Service
and a ServiceMonitor
resources so that the Prometheus endpoint can be scraped.
The creation of the ServiceMonitor resource requires the Prometheus Operator
custom resource definition to be installed.
You can set service-monitor to false for the Prometheus trait to work without the Prometheus operator.
|
It’s disabled by default.
This trait is available in the following profiles: Kubernetes, Knative, OpenShift.
Configuration
Trait properties can be specified when running any integration with the CLI:
kamel run --trait prometheus.[key]=[value] --trait prometheus.[key2]=[value2] integration.groovy
The following configuration options are available:
Property | Type | Description |
---|---|---|
prometheus.enabled |
bool |
Can be used to enable or disable a trait. All traits share this common property. |
prometheus.port |
int |
The Prometheus endpoint port (default |
prometheus.service-monitor |
bool |
Whether a |
prometheus.service-monitor-labels |
string |
The |
prometheus.configmap |
string |
To use a custom ConfigMap containing the Prometheus exporter configuration (under the |