Skip to content

Commit 18a7930

Browse files
committed
Cherry-pick (knative#6352)
1 parent 4d6bfdc commit 18a7930

File tree

11 files changed

+385
-541
lines changed

11 files changed

+385
-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
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
11
--8<-- "collecting-metrics.md"
2+
3+
### Enabling Metric Collection
4+
5+
1. To enable prometheus metrics collection you will want to update `config-observability` ConfigMap and set the `metrics-protocol` to `prometheus`.
6+
7+
```yaml
8+
apiVersion: v1
9+
kind: ConfigMap
10+
metadata:
11+
name: config-observability
12+
namespace: knative-eventing
13+
data:
14+
# metrics-protocol field specifies the protocol used when exporting metrics
15+
# It supports either 'none' (the default), 'prometheus', 'http/protobuf' (OTLP HTTP), 'grpc' (OTLP gRPC)
16+
metrics-protocol: prometheus
17+
18+
tracing-protocol: http/protobuf
19+
tracing-endpoint: http://jaeger-collector.observability.svc:4318/v1/traces
20+
tracing-sampling-rate: "1"
21+
```
22+
23+
### Apply the Eventing Service/Pod Monitors
24+
25+
1. Apply the ServiceMonitors/PodMonitors to collect metrics from Knative Eventing Control Plane
26+
27+
```bash
28+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/eventing-monitors.yaml
29+
```
30+
### Import Grafana dashboards
31+
32+
1. Grafana dashboards can be imported from the [`monitoring` repository](https://github.com/knative-extensions/monitoring).
33+
34+
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.
35+
36+
```bash
37+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-eventing-dashboard.yaml
38+
```

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: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
# Knative Eventing metrics
1+
---
2+
audience: developer
3+
components:
4+
- eventing
5+
function: reference
6+
---
7+
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.
217

318
Administrators can view metrics for Knative Eventing components.
419

@@ -35,11 +50,6 @@ By aggregating the metrics over the http code, events can be separated into two
3550
| 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
3651
| 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
3752

38-
!!! note
39-
A number of metrics eg. controller, Go runtime and others are omitted here as they are common
40-
across most components. For more about these metrics check the
41-
[Serving metrics API section](../../../serving/observability/metrics/serving-metrics.md).
42-
4353
## Eventing sources
4454

4555
Eventing sources are created by users who own the related system, so they can trigger applications with events.
@@ -50,3 +60,5 @@ to verify that events have been delivered from the source side, thus verifying t
5060
|:-|:-|:-|:-|:-|:-|
5161
| 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 |
5262
| 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.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
11
--8<-- "collecting-metrics.md"
2+
3+
4+
### Enabling Metric Collection
5+
6+
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.
7+
8+
9+
```yaml
10+
apiVersion: v1
11+
kind: ConfigMap
12+
metadata:
13+
name: config-observability
14+
namespace: knative-serving
15+
data:
16+
# metrics-protocol field specifies the protocol used when exporting metrics
17+
# It supports either 'none' (the default), 'prometheus', 'http/protobuf' (OTLP HTTP), 'grpc' (OTLP gRPC)
18+
metrics-protocol: prometheus
19+
20+
# request-metrics-protocol
21+
request-metrics-protocol: http/protobuf
22+
request-metrics-endpoint: http://knative-kube-prometheus-st-prometheus.observability.svc:9090/api/v1/otlp/v1/metrics
23+
24+
tracing-protocol: http/protobuf
25+
tracing-endpoint: http://jaeger-collector.observability.svc:4318/v1/traces
26+
tracing-sampling-rate: "1"
27+
28+
```
29+
30+
1. Apply the ServiceMonitors/PodMonitors to collect metrics from Knative Serving Control Plane.
31+
32+
```bash
33+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/serving-monitors.yaml
34+
```
35+
36+
### Import Grafana dashboards
37+
38+
1. Grafana dashboards can be imported from the [`monitoring` repository](https://github.com/knative-extensions/monitoring).
39+
40+
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.
41+
42+
```bash
43+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-serving-dashboard.yaml
44+
```

docs/serving/observability/metrics/collector.yaml

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

0 commit comments

Comments
 (0)