blob: 29e02effb1d11de21de6a82547d893947da9855f [file] [log] [blame]
= Prometheus Trait
// Start of autogenerated code - DO NOT EDIT! (description)
The Prometheus trait configures a Prometheus-compatible endpoint. It also exposes the integration with a `Service`
and a `ServiceMonitor` resources, so that the endpoint can be scraped automatically, when using the Prometheus
operator.
The metrics exposed vary depending on the configured runtime. With Quarkus, the metrics are exposed
using MicroProfile Metrics. While with the default runtime, they are exposed using the Prometheus JMX exporter.
WARNING: The creation of the `ServiceMonitor` resource requires the https://github.com/coreos/prometheus-operator[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**.
// End of autogenerated code - DO NOT EDIT! (description)
// Start of autogenerated code - DO NOT EDIT! (configuration)
== 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:
[cols="2,1,5a"]
|===
|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 `9779`, or `8080` with Quarkus).
| prometheus.service-monitor
| bool
| Whether a `ServiceMonitor` resource is created (default `true`).
| prometheus.service-monitor-labels
| string
| The `ServiceMonitor` resource labels, applicable when `service-monitor` is `true`.
| prometheus.configmap
| string
| To use a custom ConfigMap containing the Prometheus JMX exporter configuration (under the `content` ConfigMap key).
When this property is left empty (default), Camel K generates a standard Prometheus configuration for the integration.
It is not applicable when using Quarkus.
|===
// End of autogenerated code - DO NOT EDIT! (configuration)