This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit d5b9466248fdcc2eedf6489cec978c6b527869ff Author: Gaelle Fournier <gaelle.fournier.w...@gmail.com> AuthorDate: Mon Apr 3 16:22:40 2023 +0200 feat(doc): Update prometheus trait doc --- docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 4 +++- docs/modules/traits/pages/prometheus.adoc | 20 +++++++++++++++++++- pkg/apis/camel/v1/trait/prometheus.go | 4 +++- resources/traits.yaml | 9 +++++---- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index f6646a775..a2b565eef 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -5482,12 +5482,14 @@ by using the `integration` container name. The Prometheus trait configures a Prometheus-compatible endpoint. It also creates a `PodMonitor` resource, so that the endpoint can be scraped automatically, when using the Prometheus operator. -The metrics are exposed using MicroProfile Metrics. +The metrics are exposed using Micrometer Metrics. WARNING: The creation of the `PodMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator] custom resource definition to be installed. You can set `pod-monitor` to `false` for the Prometheus trait to work without the Prometheus Operator. +WARNING: By default the metrics API is not available in JSON + The Prometheus trait is disabled by default. diff --git a/docs/modules/traits/pages/prometheus.adoc b/docs/modules/traits/pages/prometheus.adoc index b372e18fb..a786aa6ce 100755 --- a/docs/modules/traits/pages/prometheus.adoc +++ b/docs/modules/traits/pages/prometheus.adoc @@ -4,12 +4,14 @@ The Prometheus trait configures a Prometheus-compatible endpoint. It also creates a `PodMonitor` resource, so that the endpoint can be scraped automatically, when using the Prometheus operator. -The metrics are exposed using MicroProfile Metrics. +The metrics are exposed using Micrometer Metrics. WARNING: The creation of the `PodMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator] custom resource definition to be installed. You can set `pod-monitor` to `false` for the Prometheus trait to work without the Prometheus Operator. +WARNING: By default the metrics API is not available in JSON + The Prometheus trait is disabled by default. @@ -45,3 +47,19 @@ The following configuration options are available: |=== // End of autogenerated code - DO NOT EDIT! (configuration) +== Examples + +* To activate the metrics and default scrapping through a new PodMonitor: ++ +[source,console] +$ kamel run -t prometheus.enable=true ... + +* To activate the metrics when the Prometheus Operator is not available: ++ +[source,console] +$ kamel run -t prometheus.enable=true -t pod-monitor=false ... + +* To activate the metrics with JSON format available : ++ +[source,console] +$ kamel run -t prometheus.enable=true -t builder.properties="quarkus.micrometer.export.json.enabled=true"... diff --git a/pkg/apis/camel/v1/trait/prometheus.go b/pkg/apis/camel/v1/trait/prometheus.go index 416cfa7f9..552375c4a 100644 --- a/pkg/apis/camel/v1/trait/prometheus.go +++ b/pkg/apis/camel/v1/trait/prometheus.go @@ -20,12 +20,14 @@ package trait // The Prometheus trait configures a Prometheus-compatible endpoint. It also creates a `PodMonitor` resource, // so that the endpoint can be scraped automatically, when using the Prometheus operator. // -// The metrics are exposed using MicroProfile Metrics. +// The metrics are exposed using Micrometer Metrics. // // WARNING: The creation of the `PodMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator] // custom resource definition to be installed. // You can set `pod-monitor` to `false` for the Prometheus trait to work without the Prometheus Operator. // +// WARNING: By default the metrics API is not available in JSON +// // The Prometheus trait is disabled by default. // // +camel-k:trait=prometheus. diff --git a/resources/traits.yaml b/resources/traits.yaml index 77bac23af..1f8c03900 100755 --- a/resources/traits.yaml +++ b/resources/traits.yaml @@ -1179,11 +1179,12 @@ traits: - OpenShift description: 'The Prometheus trait configures a Prometheus-compatible endpoint. It also creates a `PodMonitor` resource, so that the endpoint can be scraped automatically, - when using the Prometheus operator. The metrics are exposed using MicroProfile - Metrics. WARNING: The creation of the `PodMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus + when using the Prometheus operator. The metrics are exposed using Micrometer Metrics. + WARNING: The creation of the `PodMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator] custom resource definition to be installed. You can set `pod-monitor` - to `false` for the Prometheus trait to work without the Prometheus Operator. The - Prometheus trait is disabled by default.' + to `false` for the Prometheus trait to work without the Prometheus Operator. WARNING: + By default the metrics API is not available in JSON The Prometheus trait is disabled + by default.' properties: - name: enabled type: bool