Skip to content

Commit b936c72

Browse files
dprotasoCali0707
andauthored
[serving] OTel Metrics Documentation (#6352)
* Updating collecting metrics steps * remove collector installation steps and separate out shared metrics into a snippet * combine notes * update nav to remove stutter * include webhook metrics * update common metrics with attributes and include serving metrics * update notice banners for eventing and serving * fix typos * Update docs/eventing/observability/metrics/collecting-metrics.md Co-authored-by: Calum Murray <[email protected]> --------- Co-authored-by: Calum Murray <[email protected]>
1 parent 31cca91 commit b936c72

File tree

11 files changed

+371
-541
lines changed

11 files changed

+371
-541
lines changed

config/nav.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ nav:
188188
- Configuring logging: serving/observability/logging/config-logging.md
189189
- Configuring Request logging: serving/observability/logging/request-logging.md
190190
- Collecting metrics: serving/observability/metrics/collecting-metrics.md
191-
- Knative Serving metrics: serving/observability/metrics/serving-metrics.md
191+
- Metrics Reference: serving/observability/metrics/serving-metrics.md
192192
# Serving - troubleshooting
193193
- Troubleshooting:
194194
- Debugging application issues: serving/troubleshooting/debugging-application-issues.md
@@ -307,7 +307,7 @@ nav:
307307
- Collecting logs: eventing/observability/logging/collecting-logs.md
308308
- Configuring logging: eventing/observability/logging/config-logging.md
309309
- Collecting metrics: eventing/observability/metrics/collecting-metrics.md
310-
- Knative Eventing metrics: eventing/observability/metrics/eventing-metrics.md
310+
- Metrics Reference: eventing/observability/metrics/eventing-metrics.md
311311
- Features:
312312
- About Eventing features: eventing/features/README.md
313313
- DeliverySpec.Timeout field: eventing/features/delivery-timeout.md

docs/eventing/observability/metrics/collecting-metrics.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,40 @@ function: how-to
66
---
77

88
--8<-- "collecting-metrics.md"
9+
10+
### Enabling Metric Collection
11+
12+
1. To enable prometheus metrics collection you will want to update `config-observability` ConfigMap and set the `metrics-protocol` to `prometheus`.
13+
14+
```yaml
15+
apiVersion: v1
16+
kind: ConfigMap
17+
metadata:
18+
name: config-observability
19+
namespace: knative-eventing
20+
data:
21+
# metrics-protocol field specifies the protocol used when exporting metrics
22+
# It supports either 'none' (the default), 'prometheus', 'http/protobuf' (OTLP HTTP), 'grpc' (OTLP gRPC)
23+
metrics-protocol: prometheus
24+
25+
tracing-protocol: http/protobuf
26+
tracing-endpoint: http://jaeger-collector.observability.svc:4318/v1/traces
27+
tracing-sampling-rate: "1"
28+
```
29+
30+
### Apply the Eventing Service/Pod Monitors
31+
32+
1. Apply the ServiceMonitors/PodMonitors to collect metrics from Knative Eventing Control Plane
33+
34+
```bash
35+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/eventing-monitors.yaml
36+
```
37+
### Import Grafana dashboards
38+
39+
1. Grafana dashboards can be imported from the [`monitoring` repository](https://github.com/knative-extensions/monitoring).
40+
41+
1. If you are using the Grafana Helm Chart with the dashboard sidecar enabled (the default), you can load the dashboards by applying the following configmaps.
42+
43+
```bash
44+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-eventing-dashboard.yaml
45+
```

docs/eventing/observability/metrics/collector.yaml

Lines changed: 0 additions & 96 deletions
This file was deleted.

docs/eventing/observability/metrics/eventing-metrics.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ components:
55
function: reference
66
---
77

8-
# Knative Eventing metrics
8+
# Knative Eventing Metrics
9+
10+
!!! warning
11+
12+
The metrics below have not been updated to reflect our migration from
13+
OpenCensus to OpenTelemetry. We are in the process of updating them.
14+
15+
These metrics may change as we flush out our migration from OpenCensus
16+
to OpenTelemetry.
917

1018
Administrators can view metrics for Knative Eventing components.
1119

@@ -42,11 +50,6 @@ By aggregating the metrics over the http code, events can be separated into two
4250
| event_count | Number of events dispatched by the in-memory channel | Counter | container_name<br>event_type=<br>namespace_name=<br>response_code<br>response_code_class<br>unique_name | Dimensionless | Stable
4351
| event_dispatch_latencies | The time spent dispatching an event from a in-memory Channel | Histogram | container_name<br>event_type<br>namespace_name=<br>response_code<br>response_code_class<br>unique_name | Milliseconds | Stable
4452

45-
!!! note
46-
A number of metrics eg. controller, Go runtime and others are omitted here as they are common
47-
across most components. For more about these metrics check the
48-
[Serving metrics API section](../../../serving/observability/metrics/serving-metrics.md).
49-
5053
## Eventing sources
5154

5255
Eventing sources are created by users who own the related system, so they can trigger applications with events.
@@ -57,3 +60,5 @@ to verify that events have been delivered from the source side, thus verifying t
5760
|:-|:-|:-|:-|:-|:-|
5861
| event_count | Number of events sent by the source | Counter | event_source<br>event_type<br>name<br>namespace_name<br>resource_group<br>response_code<br>response_code_class<br>response_error<br>response_timeout | Dimensionless | Stable |
5962
| retry_event_count | Number of events sent by the source in retries | Counter | event_source<br>event_type<br>name<br>namespace_name<br>resource_group<br>response_code<br>response_code_class<br>response_error<br>response_timeout | Dimensionless | Stable
63+
64+
--8<-- "observability-shared-metrics.md"

docs/eventing/observability/metrics/system-diagram.svg

Lines changed: 0 additions & 67 deletions
This file was deleted.

docs/serving/observability/metrics/collecting-metrics.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,46 @@ function: how-to
66
---
77

88
--8<-- "collecting-metrics.md"
9+
10+
11+
### Enabling Metric Collection
12+
13+
1. To enable prometheus metrics collection you will want to update `config-observability` ConfigMap and set the `metrics-protocol` to `prometheus`. For request-metrics we recommend setting up pushing metrics to prometheus. This requires enabling the Prometheus OLTP receiver. This is already configured in our monitoring example.
14+
15+
16+
```yaml
17+
apiVersion: v1
18+
kind: ConfigMap
19+
metadata:
20+
name: config-observability
21+
namespace: knative-serving
22+
data:
23+
# metrics-protocol field specifies the protocol used when exporting metrics
24+
# It supports either 'none' (the default), 'prometheus', 'http/protobuf' (OTLP HTTP), 'grpc' (OTLP gRPC)
25+
metrics-protocol: prometheus
26+
27+
# request-metrics-protocol
28+
request-metrics-protocol: http/protobuf
29+
request-metrics-endpoint: http://knative-kube-prometheus-st-prometheus.observability.svc:9090/api/v1/otlp/v1/metrics
30+
31+
tracing-protocol: http/protobuf
32+
tracing-endpoint: http://jaeger-collector.observability.svc:4318/v1/traces
33+
tracing-sampling-rate: "1"
34+
35+
```
36+
37+
1. Apply the ServiceMonitors/PodMonitors to collect metrics from Knative Serving Control Plane.
38+
39+
```bash
40+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/serving-monitors.yaml
41+
```
42+
43+
### Import Grafana dashboards
44+
45+
1. Grafana dashboards can be imported from the [`monitoring` repository](https://github.com/knative-extensions/monitoring).
46+
47+
1. If you are using the Grafana Helm Chart with the dashboard sidecar enabled (the default), you can load the dashboards by applying the following configmaps.
48+
49+
```bash
50+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-serving-dashboard.yaml
51+
```

docs/serving/observability/metrics/collector.yaml

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)