-
Notifications
You must be signed in to change notification settings - Fork 1.8k
OSSM-11009 [DOCS] Update OSSM metrics docs for ambient mode #102972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: service-mesh-docs-main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * service-mesh-docs-main/metrics/ossm-metrics.adoc | ||
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="ossm-config-openshift-monitoring-ambient-mode_{context}"] | ||
| = Configuring OpenShift Monitoring with Service Mesh ambient mode | ||
|
|
||
| [role="_abstract"] | ||
| You can integrate {SMProductName} with user-workload monitoring to enable observability in your service mesh ambient mode. User-workload monitoring provides access to essential built-in tools and is required to run Kiali, the dedicated console for {istio}. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You have installed the {SMProductName} Operator. | ||
| * You have enabled the user-workload monitoring. | ||
| + | ||
| [NOTE] | ||
| ==== | ||
| You can enable user-workload monitoring by applying the `ConfigMap` change for metrics integration. For more information, see link:https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/monitoring/configuring-user-workload-monitoring[Configuring user workload monitoring]. | ||
| ==== | ||
|
|
||
| .Procedure | ||
|
|
||
| . Create a `Service` resource to define a port that uses the metrics exposed by the ztunnel, similar to the following example: | ||
|
|
||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: ztunnel | ||
| namespace: ztunnel | ||
| labels: | ||
| app: ztunnel | ||
| service: ztunnel | ||
| spec: | ||
| selector: | ||
| app: ztunnel | ||
| ports: | ||
| - name: http-monitoring | ||
| protocol: TCP | ||
| port: 15020 | ||
| targetPort: 15020 | ||
| ---- | ||
|
|
||
| . Create a `ServiceMonitor` resource that monitors the {istio} control plane, similar to the following example: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| name: istiod-monitor | ||
| namespace: istio-system | ||
| spec: | ||
| targetLabels: | ||
| - app | ||
| selector: | ||
| matchLabels: | ||
| istio: pilot | ||
| endpoints: | ||
| - port: http-monitoring | ||
| interval: 30s | ||
| ---- | ||
|
|
||
| . Create a `ServiceMonitor` resource that collects the ztunnel metrics, similar to the following example: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| name: ztunnel-monitor | ||
| namespace: ztunnel | ||
| spec: | ||
| targetLabels: | ||
| - app | ||
| selector: | ||
| matchLabels: | ||
| service: ztunnel | ||
| endpoints: | ||
| - port: http-monitoring | ||
| interval: 30s | ||
| ---- | ||
|
|
||
| . Optional: Deploy a waypoint proxy to enable the Layer 7 (L7) features, such as HTTP metrics and traces in ambient mode: | ||
|
|
||
| .. Deploy a custom waypoint proxy with additional labels and ports, similar to the following example: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| labels: | ||
| istio.io/waypoint-for: service | ||
| app: waypoint | ||
| service: waypoint | ||
| name: waypoint | ||
| namespace: bookinfo | ||
| spec: | ||
| gatewayClassName: istio-waypoint | ||
| listeners: | ||
| - name: mesh | ||
| port: 15008 | ||
| protocol: HBONE | ||
| - name: http-monitoring | ||
| protocol: TCP | ||
| port: 15020 | ||
| ---- | ||
| `<http-monitoring>`:: Specifies an additional port that exposes the metrics used by the waypoint proxy. | ||
|
|
||
| .. Enroll the namespace to use the waypoint by running the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc label namespace bookinfo istio.io/use-waypoint=waypoint | ||
| ---- | ||
shreyasiddhartha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| .. Create a `ServiceMonitor` resource that collects the waypoint proxy metrics, similar to the following example: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| name: waypoint-monitor | ||
| namespace: bookinfo | ||
| spec: | ||
| targetLabels: | ||
| - app | ||
| selector: | ||
| matchLabels: | ||
| service: waypoint | ||
| endpoints: | ||
| - port: http-monitoring | ||
| interval: 30s | ||
| ---- | ||
| + | ||
| [NOTE] | ||
| ==== | ||
| A waypoint proxy generates Layer 4 (L4) and L7 metrics. It scopes these statistics by Envoy proxy functions. The Envoy statistic functions are described in Envoy proxy documentation, for example, `Upstream connection`, `Listener`, `HTTP Connection Manager`, `TCP proxy`, and `Router`. | ||
| ==== | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,25 +6,24 @@ | |||||||||||||||||||||||||||||||
| [id="ossm-config-openshift-monitoring-only_{context}"] | ||||||||||||||||||||||||||||||||
| = Configuring OpenShift Monitoring with Service Mesh | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // This is WITHOUT Kiali. | ||||||||||||||||||||||||||||||||
| // TP1 content. TP banner is persistent and handled by Tim O'Keefe in a different PR. | ||||||||||||||||||||||||||||||||
| // Possible file name may change | ||||||||||||||||||||||||||||||||
| // Possible assembly file may change | ||||||||||||||||||||||||||||||||
| // Assemblies, topic map info needs to be worked out still for 3.0. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| [role="_abstract"] | ||||||||||||||||||||||||||||||||
| You can integrate {SMProductName} with user-workload monitoring to enable observability in your service mesh. User-workload monitoring provides access to essential built-in tools and is required to run Kiali, the dedicated console for {istio}. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| .Prerequisites | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| * {SMProductName} is installed. | ||||||||||||||||||||||||||||||||
| * You have installed the {SMProductName} Operator. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| * User-workload monitoring is enabled. See link:https://docs.openshift.com/container-platform/4.16/observability/monitoring/enabling-monitoring-for-user-defined-projects.html[Enabling monitoring for user-defined projects]. | ||||||||||||||||||||||||||||||||
| * You have enabled the user-workload monitoring. | ||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above: It will break the parallelism, if I insert an example in prerqs (which I don't think we have done in docs before). The link below already points the user to Configuring user workload monitoring. So, currently I will skip inserting this. |
||||||||||||||||||||||||||||||||
| + | ||||||||||||||||||||||||||||||||
| [NOTE] | ||||||||||||||||||||||||||||||||
| ==== | ||||||||||||||||||||||||||||||||
| You can enable user-workload monitoring by applying the `ConfigMap` change for metrics integration. For more information, see link:https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/monitoring/configuring-user-workload-monitoring[Configuring user workload monitoring]. | ||||||||||||||||||||||||||||||||
| ==== | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| .Procedure | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| . Create a YAML file named `servicemonitor.yml` to monitor the {istio} control plane: | ||||||||||||||||||||||||||||||||
| . Create a `ServiceMonitor` resource that monitors the {istio} control plane, similar to the following example: | ||||||||||||||||||||||||||||||||
| + | ||||||||||||||||||||||||||||||||
| .Example `ServiceMonitor` object | ||||||||||||||||||||||||||||||||
| [source,yaml] | ||||||||||||||||||||||||||||||||
| ---- | ||||||||||||||||||||||||||||||||
| apiVersion: monitoring.coreos.com/v1 | ||||||||||||||||||||||||||||||||
|
|
@@ -43,76 +42,6 @@ spec: | |||||||||||||||||||||||||||||||
| interval: 30s | ||||||||||||||||||||||||||||||||
| ---- | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| . Apply the YAML file by running the following command: | ||||||||||||||||||||||||||||||||
| + | ||||||||||||||||||||||||||||||||
| [source,terminal] | ||||||||||||||||||||||||||||||||
| ---- | ||||||||||||||||||||||||||||||||
| $ oc apply -f servicemonitor.yml | ||||||||||||||||||||||||||||||||
| ---- | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| . Create a YAML file named `podmonitor.yml` to collect metrics from the {istio} proxies: | ||||||||||||||||||||||||||||||||
| + | ||||||||||||||||||||||||||||||||
| .Example `PodMonitor` object | ||||||||||||||||||||||||||||||||
| [source,yaml] | ||||||||||||||||||||||||||||||||
| ---- | ||||||||||||||||||||||||||||||||
| apiVersion: monitoring.coreos.com/v1 | ||||||||||||||||||||||||||||||||
| kind: PodMonitor | ||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||
| name: istio-proxies-monitor | ||||||||||||||||||||||||||||||||
| namespace: istio-system # <1> | ||||||||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||||||||
| selector: | ||||||||||||||||||||||||||||||||
| matchExpressions: | ||||||||||||||||||||||||||||||||
| - key: istio-prometheus-ignore | ||||||||||||||||||||||||||||||||
| operator: DoesNotExist | ||||||||||||||||||||||||||||||||
| podMetricsEndpoints: | ||||||||||||||||||||||||||||||||
| - path: /stats/prometheus | ||||||||||||||||||||||||||||||||
| interval: 30s | ||||||||||||||||||||||||||||||||
| relabelings: | ||||||||||||||||||||||||||||||||
| - action: keep | ||||||||||||||||||||||||||||||||
| sourceLabels: ["__meta_kubernetes_pod_container_name"] | ||||||||||||||||||||||||||||||||
| regex: "istio-proxy" | ||||||||||||||||||||||||||||||||
| - action: keep | ||||||||||||||||||||||||||||||||
| sourceLabels: ["__meta_kubernetes_pod_annotationpresent_prometheus_io_scrape"] | ||||||||||||||||||||||||||||||||
| - action: replace | ||||||||||||||||||||||||||||||||
| regex: (\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}) | ||||||||||||||||||||||||||||||||
| replacement: '[$2]:$1' | ||||||||||||||||||||||||||||||||
| sourceLabels: ["__meta_kubernetes_pod_annotation_prometheus_io_port","__meta_kubernetes_pod_ip"] | ||||||||||||||||||||||||||||||||
| targetLabel: "__address__" | ||||||||||||||||||||||||||||||||
| - action: replace | ||||||||||||||||||||||||||||||||
| regex: (\d+);((([0-9]+?)(\.|$)){4}) | ||||||||||||||||||||||||||||||||
| replacement: '$2:$1' | ||||||||||||||||||||||||||||||||
| sourceLabels: ["__meta_kubernetes_pod_annotation_prometheus_io_port","__meta_kubernetes_pod_ip"] | ||||||||||||||||||||||||||||||||
| targetLabel: "__address__" | ||||||||||||||||||||||||||||||||
| - sourceLabels: ["__meta_kubernetes_pod_label_app_kubernetes_io_name","__meta_kubernetes_pod_label_app"] | ||||||||||||||||||||||||||||||||
| separator: ";" | ||||||||||||||||||||||||||||||||
| targetLabel: "app" | ||||||||||||||||||||||||||||||||
| action: replace | ||||||||||||||||||||||||||||||||
| regex: "(.+);.*|.*;(.+)" | ||||||||||||||||||||||||||||||||
| replacement: "${1}${2}" | ||||||||||||||||||||||||||||||||
| - sourceLabels: ["__meta_kubernetes_pod_label_app_kubernetes_io_version","__meta_kubernetes_pod_label_version"] | ||||||||||||||||||||||||||||||||
| separator: ";" | ||||||||||||||||||||||||||||||||
| targetLabel: "version" | ||||||||||||||||||||||||||||||||
| action: replace | ||||||||||||||||||||||||||||||||
| regex: "(.+);.*|.*;(.+)" | ||||||||||||||||||||||||||||||||
| replacement: "${1}${2}" | ||||||||||||||||||||||||||||||||
| - sourceLabels: ["__meta_kubernetes_namespace"] | ||||||||||||||||||||||||||||||||
| action: replace | ||||||||||||||||||||||||||||||||
| targetLabel: namespace | ||||||||||||||||||||||||||||||||
| - action: replace | ||||||||||||||||||||||||||||||||
| replacement: "the-mesh-identification-string" # <2> | ||||||||||||||||||||||||||||||||
| targetLabel: mesh_id | ||||||||||||||||||||||||||||||||
| ---- | ||||||||||||||||||||||||||||||||
| <1> Specifies that the `PodMonitor` object must be applied in all mesh namespaces, including the Istio control plane namespace, because {ocp-product-title} monitoring ignores the `namespaceSelector` spec in `ServiceMonitor` and `PodMonitor` objects. | ||||||||||||||||||||||||||||||||
| <2> Specify the actual mesh ID. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| . Apply the YAML file by running the following command: | ||||||||||||||||||||||||||||||||
| + | ||||||||||||||||||||||||||||||||
| [source,terminal] | ||||||||||||||||||||||||||||||||
| ---- | ||||||||||||||||||||||||||||||||
| $ oc apply -f podmonitor.yml | ||||||||||||||||||||||||||||||||
| ---- | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| . On the {ocp-short-name} Console go to **Observe** -> **Metrics**, and run the query `istio_requests_total`. | ||||||||||||||||||||||||||||||||
| + | ||||||||||||||||||||||||||||||||
| [NOTE] | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * service-mesh-docs-main/metrics/ossm-metrics.adoc | ||
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="ossm-validating-metrics-ambient-mode_{context}"] | ||
| = Verifying metrics in ambient mode | ||
|
|
||
| [role="_abstract"] | ||
| You can verify that the metrics for the Bookinfo application that are available in the OpenShift Console. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You have deployed the Bookinfo application in ambient mode to use the following example. For more information, see https://docs.redhat.com/en/documentation/red_hat_openshift_service_mesh/3.2/html/installing/ossm-istio-ambient-mode#ossm-deploying-bookinfo-application-istio-ambient-mode_ossm-istio-ambient-mode[Deploying the Bookinfo application in Istio ambient mode]. | ||
|
|
||
| .Procedure | ||
|
|
||
| . On the {ocp-short-name} Console go to *Observe* -> *Targets*. | ||
|
|
||
| . Find the status of `Metrics Targets` by searching for targets such as `istiod-monitor`, `ztunnel-monitor` and `waypoint-monitor`. | ||
| + | ||
| [NOTE] | ||
| ==== | ||
| The `ServiceMonitor` resource configuration can take a few minutes to show in the `Metrics Targets` results. | ||
| ==== | ||
|
|
||
| . Send some traffic to the Bookinfo `productpage` service for generating metrics, by running the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ curl "http://${GATEWAY_URL}/productpage" | grep "<title>" | ||
| ---- | ||
|
|
||
| . On the {ocp-short-name} Console go to *Observe* -> *Metrics* and run a query such as, `istio_build`, `istio_tcp_received_bytes_total`, or `istio_requests_total`. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we mention "the
ConfigMapchange" below, it's better to give an example and that's all user need to configure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will break the parallelism, if I insert an example in prerqs (which I don't think we have done in docs before). The link below already points the user to Configuring user workload monitoring. So, currently I will skip inserting this.