Skip to content

Commit a4d6545

Browse files
[release-1.19] fix: fix indentation of codeblock in collecting metrics docs (#6455)
* fix: fix indentation of codeblock in collecting metrics docs * fix: fix URL to dashboard json files --------- Co-authored-by: Vincent Link <[email protected]>
1 parent d8fe864 commit a4d6545

File tree

3 files changed

+46
-46
lines changed

3 files changed

+46
-46
lines changed

docs/snippets/collecting-metrics.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ You can also set up the OpenTelemetry Collector to receive metrics from Knative
2525

2626
1. Install the [Prometheus Stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) by using [Helm](https://helm.sh/docs/intro/using_helm/):
2727

28-
```bash
29-
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
30-
helm repo update
31-
helm install knative prometheus-community/kube-prometheus-stack \
32-
--create-namespace \
33-
--namespace observability \
34-
-f https://raw.githubusercontent.com/knative-extensions/monitoring/main/promstack-values.yaml
35-
28+
```bash
29+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
30+
helm repo update
31+
helm install knative prometheus-community/kube-prometheus-stack \
32+
--create-namespace \
33+
--namespace observability \
34+
-f https://raw.githubusercontent.com/knative-extensions/monitoring/main/promstack-values.yaml
35+
```
3636

3737
### Access the Prometheus instance locally
3838

@@ -63,7 +63,7 @@ To access the dashboards in your web browser:
6363
1. Access the dashboards in your browser via `http://localhost:3000`.
6464

6565
1. Use the default credentials to login:
66-
66+
6767
```text
6868
username: admin
6969
password: prom-operator

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ function: how-to
1111

1212
1. To enable prometheus metrics collection you will want to update `config-observability` ConfigMap and set the `metrics-protocol` to `prometheus`.
1313

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-
```
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+
```
2929
3030
### Apply the Eventing Service/Pod Monitors
3131
@@ -34,12 +34,13 @@ data:
3434
```bash
3535
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/eventing-monitors.yaml
3636
```
37+
3738
### Import Grafana dashboards
3839

3940
1. Grafana dashboards can be imported from the [`monitoring` repository](https://github.com/knative-extensions/monitoring).
4041

4142
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.
4243

4344
```bash
44-
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-eventing-dashboard.yaml
45+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-eventing-dashboard.json
4546
```

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

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,25 @@ function: how-to
1313
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.
1414

1515

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-
```
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+
```
3635
3736
1. Apply the ServiceMonitors/PodMonitors to collect metrics from Knative Serving Control Plane.
3837
@@ -47,5 +46,5 @@ data:
4746
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.
4847

4948
```bash
50-
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-serving-dashboard.yaml
49+
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/config/configmap-serving-dashboard.json
5150
```

0 commit comments

Comments
 (0)