This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 81eec6f43f633661346e8a91affb0803ee7eab06 Author: Antonin Stefanutti <[email protected]> AuthorDate: Wed Apr 14 10:14:50 2021 +0200 chore(doc): Update Prometheus trait documentation with PodMonitor --- deploy/traits.yaml | 22 +++++++++------------- .../ROOT/pages/observability/integration.adoc | 12 ++++++------ .../ROOT/pages/observability/monitoring.adoc | 4 ++-- .../modules/ROOT/pages/observability/operator.adoc | 2 +- docs/modules/traits/pages/prometheus.adoc | 21 ++++++++------------- 5 files changed, 26 insertions(+), 35 deletions(-) diff --git a/deploy/traits.yaml b/deploy/traits.yaml index 69abaf6..75522d2 100755 --- a/deploy/traits.yaml +++ b/deploy/traits.yaml @@ -679,11 +679,10 @@ traits: - Knative - OpenShift description: 'The Prometheus trait configures a Prometheus-compatible endpoint. - This trait also exposes the integration with `Service` and `ServiceMonitor` resources, - 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 - `ServiceMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus - Operator] custom resource definition to be installed. You can set `service-monitor` + 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 + 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.' properties: @@ -691,16 +690,13 @@ traits: type: bool description: Can be used to enable or disable a trait. All traits share this common property. - - name: port - type: int - description: The Prometheus endpoint port (default `9779`, or `8080` with Quarkus). - - name: service-monitor + - name: pod-monitor type: bool - description: Whether a `ServiceMonitor` resource is created (default `true`). - - name: service-monitor-labels + description: Whether a `PodMonitor` resource is created (default `true`). + - name: pod-monitor-labels type: '[]string' - description: The `ServiceMonitor` resource labels, applicable when `service-monitor` - is `true`. + description: The `PodMonitor` resource labels, applicable when `pod-monitor` is + `true`. - name: pull-secret platform: false profiles: diff --git a/docs/modules/ROOT/pages/observability/integration.adoc b/docs/modules/ROOT/pages/observability/integration.adoc index 85dbbc6..4f5ce6a 100644 --- a/docs/modules/ROOT/pages/observability/integration.adoc +++ b/docs/modules/ROOT/pages/observability/integration.adoc @@ -55,26 +55,26 @@ It is possible to extend this set of metrics by using either, or both: The Prometheus trait automatically configures the resources necessary for the Prometheus Operator to reconcile, so that the managed Prometheus instance can scrape the integration _metrics_ endpoint. -By default, the Prometheus trait creates a `ServiceMonitor` resource, with the `camel.apache.org/integration` label, which must match the `serviceMonitorSelector` field from the `Prometheus` resource. -Additional labels can be specified with the `service-monitor-labels` parameter from the Prometheus trait, e.g.: +By default, the Prometheus trait creates a `PodMonitor` resource, with the `camel.apache.org/integration` label, which must match the `podMonitorSelector` field from the `Prometheus` resource. +Additional labels can be specified with the `pod-monitor-labels` parameter from the Prometheus trait, e.g.: [source,sh] ---- -$ kamel run -t prometheus.service-monitor-labels="label_to_be_match_by=prometheus_selector" ... +$ kamel run -t prometheus.pod-monitor-labels="label_to_be_match_by=prometheus_selector" ... ---- -The creation of the `ServiceMonitor` resource can be disabled using the `service-monitor` parameter, e.g.: +The creation of the `PodMonitor` resource can be disabled using the `pod-monitor` parameter, e.g.: [source,sh] ---- -$ kamel run -t prometheus.service-monitor=false ... +$ kamel run -t prometheus.pod-monitor=false ... ---- More information can be found in the xref:traits:prometheus.adoc[Prometheus trait] documentation. The Prometheus Operator https://github.com/coreos/prometheus-operator/blob/v0.38.0/Documentation/user-guides/getting-started.md#related-resources[getting started] guide documents the discovery mechanism, as well as the relationship between the operator resources. -In case your integration metrics are not discovered, you may want to rely on https://github.com/coreos/prometheus-operator/blob/v0.38.0/Documentation/troubleshooting.md#troubleshooting-servicemonitor-changes[Troubleshooting `ServiceMonitor` changes]. +In case your integration metrics are not discovered, you may want to rely on https://github.com/coreos/prometheus-operator/blob/v0.38.0/Documentation/troubleshooting.md#troubleshooting-servicemonitor-changes[Troubleshooting `ServiceMonitor` changes], which also applies to `PodMonitor` resources troubleshooting. == Alerting diff --git a/docs/modules/ROOT/pages/observability/monitoring.adoc b/docs/modules/ROOT/pages/observability/monitoring.adoc index 18e6f2e..e8cafab 100644 --- a/docs/modules/ROOT/pages/observability/monitoring.adoc +++ b/docs/modules/ROOT/pages/observability/monitoring.adoc @@ -32,7 +32,7 @@ kind: Prometheus metadata: name: prometheus spec: - serviceMonitorSelector: + podMonitorSelector: matchExpressions: - key: camel.apache.org/integration operator: Exists @@ -40,7 +40,7 @@ EOF ---- By default, the Prometheus instance discovers applications to be monitored in the same namespace. -You can use the `serviceMonitorNamespaceSelector` field from the `Prometheus` resource to enable cross-namespace monitoring. +You can use the `podMonitorNamespaceSelector` field from the `Prometheus` resource to enable cross-namespace monitoring. You may also need to specify a ServiceAccount with the `serviceAccountName` field, that's bound to a Role with the necessary permissions. [[openshift]] diff --git a/docs/modules/ROOT/pages/observability/operator.adoc b/docs/modules/ROOT/pages/observability/operator.adoc index 0f109c2..e405077 100644 --- a/docs/modules/ROOT/pages/observability/operator.adoc +++ b/docs/modules/ROOT/pages/observability/operator.adoc @@ -102,7 +102,7 @@ In case your operator metrics are not discovered, you may want to rely on https: [[alerting]] == Alerting -NOTE: The Prometheus Operator declares the `AlertManager` resource that can be used to configure _Alertmanager_ instances, along with `Prometheus` instances. The following section assumes an `AlertManager` resource already exists in your cluster. +NOTE: The Prometheus Operator declares the `AlertManager` resource that can be used to configure _AlertManager_ instances, along with `Prometheus` instances. The following section assumes an `AlertManager` resource already exists in your cluster. A `PrometheusRule` resource can be created for the Prometheus Operator to reconcile, so that the managed AlertManager instance can trigger alerts, based on the metrics exposed by the Camel K operator. diff --git a/docs/modules/traits/pages/prometheus.adoc b/docs/modules/traits/pages/prometheus.adoc index 6e11219..b372e18 100755 --- a/docs/modules/traits/pages/prometheus.adoc +++ b/docs/modules/traits/pages/prometheus.adoc @@ -1,15 +1,14 @@ = Prometheus Trait // Start of autogenerated code - DO NOT EDIT! (description) -The Prometheus trait configures a Prometheus-compatible endpoint. This trait also exposes the integration with -`Service` and `ServiceMonitor` resources, so that the endpoint can be scraped automatically, when using the -Prometheus Operator. +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 `ServiceMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator] +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 `service-monitor` to `false` for the Prometheus trait to work without the Prometheus Operator. +You can set `pod-monitor` to `false` for the Prometheus trait to work without the Prometheus Operator. The Prometheus trait is disabled by default. @@ -35,17 +34,13 @@ The following configuration options are available: | 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 +| prometheus.pod-monitor | bool -| Whether a `ServiceMonitor` resource is created (default `true`). +| Whether a `PodMonitor` resource is created (default `true`). -| prometheus.service-monitor-labels +| prometheus.pod-monitor-labels | []string -| The `ServiceMonitor` resource labels, applicable when `service-monitor` is `true`. +| The `PodMonitor` resource labels, applicable when `pod-monitor` is `true`. |===
