Skip to content

Commit 7ad2830

Browse files
authored
Update tracing docs with OTel changes (#6337)
* Update tracing documentary for OTel * mark blog post deprecated * fix heading types * use jaeger collector as the address * suggest some backends first
1 parent 32fbe42 commit 7ad2830

File tree

5 files changed

+108
-105
lines changed

5 files changed

+108
-105
lines changed

blog/docs/articles/distributed-tracing.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Distributed tracing with Knative, OpenTelemetry and Jaeger
22

3+
!!! note
4+
Knative Release 1.19 and higher supports emitting OpenTelemetry traces. So the contents of this post are out of date.
5+
36
**Author: [Ben Moss](https://twitter.com/mossity), Software Engineer @ [VMware](http://vmware.com)**
47

58
When trying to understand and diagnose our systems, one of the most basic tools

config/nav.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ nav:
157157
# Serving - admin docs
158158
- Administrator Topics:
159159
- Kubernetes services: serving/knative-kubernetes-services.md
160-
- Accessing request traces: serving/accessing-traces.md
161160
- Enabling requests to Knative services when additional authorization policies are enabled: serving/istio-authorization.md
162161
- Exclude namespaces from the Knative webhook: serving/webhook-customizations.md
163162
- Configuring high-availability components: serving/config-ha.md
@@ -184,6 +183,7 @@ nav:
184183
- Security-Guard example alerts: serving/app-security/security-guard-example-alerts.md
185184
# Serving - observability
186185
- Observability:
186+
- Request traces: serving/observability/accessing-traces.md
187187
- Collecting logs: serving/observability/logging/collecting-logs.md
188188
- Configuring logging: serving/observability/logging/config-logging.md
189189
- Configuring Request logging: serving/observability/logging/request-logging.md
@@ -303,7 +303,7 @@ nav:
303303
- Configure KEDA Autoscaling of Knative Kafka Resources: eventing/configuration/keda-configuration.md
304304
# Eventing - observability
305305
- Observability:
306-
- Accessing CloudEvent traces: eventing/accessing-traces.md
306+
- Accessing CloudEvent traces: eventing/observability/accessing-traces.md
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

docs/eventing/accessing-traces.md renamed to docs/eventing/observability/accessing-traces.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,25 @@ function: how-to
88

99
# Accessing CloudEvent traces
1010

11-
Depending on the request tracing tool that you have installed on your Knative
12-
Eventing cluster, see the corresponding section for details about how to
13-
visualize and trace your requests.
11+
Traces give us the big picture of how events traverse through the system and applications.
12+
Knative Eventing is instrumented with [OpenTelemetry](https://opentelemetry.io/docs/what-is-opentelemetry/) which can emit traces to a multitude of different backends.
1413

15-
## Before you begin
14+
## Backends
1615

17-
You must have a Knative cluster running with the Eventing component installed. [Learn more](../install/README.md).
16+
### Jaeger V2
1817

19-
## Configuring tracing
18+
Following [these instructions](https://github.com/jaegertracing/jaeger-operator?tab=readme-ov-file#jaeger-v2-operator) to setup Jaeger V2 on Kubernetes and access your traces.
19+
20+
## Configuring Eventing Tracing
21+
22+
You can update the configuration for tracing in using the [`config-observability` ConfigMap](https://github.com/knative/eventing/blob/main/config/core/configmaps/observability.yaml).
2023

2124
With the exception of importers, the Knative Eventing tracing is configured through the
22-
`config-tracing` ConfigMap in the `knative-eventing` namespace.
25+
`config-observability` ConfigMap in the `knative-eventing` namespace.
2326

2427
Most importers do _not_ use the ConfigMap and instead, use a static 1% sampling rate.
2528

26-
You can use the `config-tracing` ConfigMap to configure the following Eventing components:
29+
You can use the `config-observability` ConfigMap to configure the following Eventing components:
2730

2831
- Brokers
2932
- Triggers
@@ -36,59 +39,61 @@ You can use the `config-tracing` ConfigMap to configure the following Eventing c
3639

3740
**Example:**
3841

39-
The following example `config-tracing` ConfigMap samples 10% of all CloudEvents:
42+
The following example `config-observability` ConfigMap samples 10% of all CloudEvents:
4043

4144
```yaml
4245
apiVersion: v1
4346
kind: ConfigMap
4447
metadata:
45-
name: config-tracing
48+
name: config-observability
4649
namespace: knative-eventing
4750
data:
48-
backend: "zipkin"
49-
zipkin-endpoint: "http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans"
50-
sample-rate: "0.1"
51+
tracing-protocol: "grpc"
52+
tracing-endpoint: "http://jaeger-collector.observability:4318/v1/traces"
53+
tracing-sampling: "0.1"
5154
```
5255
5356
### Configuration options
5457
55-
You can configure your `config-tracing` with following options:
58+
You can configure your `config-observability` with following options:
5659

57-
* `backend`: Valid values are `zipkin` or `none`. The default is `none`.
60+
* `tracing-protocol`: Valid values are `grpc` or `http/protobuf`. The default is `none`.
5861

59-
* `zipkin-endpoint`: Specifies the URL to the zipkin collector where you want to send the traces.
60-
Must be set if backend is set to `zipkin`.
62+
* `tracing-endpoint`: Specifies the URL to the backend where you want to send the traces.
63+
Must be set if backend is set to `grpc` or `http/protobuf`.
6164

62-
* `sample-rate`: Specifies the sampling rate. Valid values are decimals from `0` to `1`
65+
* `tracing-sampling`: Specifies the sampling rate. Valid values are decimals from `0` to `1`
6366
(interpreted as a float64), which indicate the probability that any given request is sampled.
6467
An example value is `0.5`, which gives each request a 50% sampling probablity.
6568

66-
* `debug`: Enables debugging. Valid values are `true` or `false`. Defaults to `false` when not specified.
67-
Set to `true` to enable debug mode, which forces the `sample-rate` to `1.0` and sends all spans to
68-
the server.
69-
70-
### Viewing your `config-tracing` ConfigMap
69+
### Viewing your `config-observability` ConfigMap
7170

7271
To view your current configuration:
7372

7473
```bash
75-
kubectl -n knative-eventing get configmap config-tracing -oyaml
74+
kubectl -n knative-eventing get configmap config-observability -oyaml
7675
```
7776

78-
### Editing and deploying your `config-tracing` ConfigMap
77+
### Editing and deploying your `config-observability` ConfigMap
7978

8079
To edit and then immediately deploy changes to your ConfigMap, run the following command:
8180

8281
```bash
83-
kubectl -n knative-eventing edit configmap config-tracing
82+
kubectl -n knative-eventing edit configmap config-observability
8483
```
8584

86-
## Accessing traces in Eventing
8785

88-
To access the traces, you use either the Zipkin or Jaeger tool. Details about using these tools to access traces are provided in the Knative Serving observability section:
86+
<!--
87+
TODO - Renable and redo the images when the following test is enabled again
88+
https://github.com/knative/eventing/blob/main/test/conformance/broker_tracing_test.go#L31
89+
90+
t.Skip("needs to be reworked for OTel (eventing#8637)")
8991

90-
- [Zipkin](../serving/accessing-traces.md#zipkin)
91-
- [Jaeger](../serving/accessing-traces.md#jaeger)
92+
## Accessing traces
93+
94+
To access the traces, you use either the Zipkin or Jaeger tool.
95+
96+
- [Zipkin](../serving/observability/accessing-traces.md)
9297

9398
### Example
9499

@@ -132,3 +137,5 @@ This is the same screenshot without the annotations.
132137
![Raw Trace](images/RawTrace.png)
133138

134139
If you are interested, here is the [raw JSON](data/2e571e6948ff981283825bb2bf51c87d.json) of the trace.
140+
141+
-->

docs/serving/accessing-traces.md

Lines changed: 0 additions & 73 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
audience: administrator
3+
components:
4+
- serving
5+
function: how-to
6+
---
7+
8+
# Accessing request traces
9+
10+
Traces give us the big picture of what happens when a request is made to an application.
11+
Knative Serving is instrumented with [OpenTelemetry](https://opentelemetry.io/docs/what-is-opentelemetry/) which can emit traces to a multitude of different backends.
12+
13+
## Backends
14+
15+
### Jaeger V2
16+
17+
Following [these instructions](https://github.com/jaegertracing/jaeger-operator?tab=readme-ov-file#jaeger-v2-operator) to setup Jaeger V2 on Kubernetes and access your traces.
18+
19+
## Configuring Serving Tracing
20+
21+
You can update the configuration for tracing in using the [`config-observability` ConfigMap](https://github.com/knative/serving/blob/main/config/core/configmaps/observability.yaml).
22+
23+
**Example:**
24+
25+
The following example `config-observability` ConfigMap samples 10% of all requests:
26+
27+
```yaml
28+
apiVersion: v1
29+
kind: ConfigMap
30+
metadata:
31+
name: config-observability
32+
namespace: knative-serving
33+
data:
34+
tracing-protocol: "grpc"
35+
tracing-endpoint: "http://jaeger-collector.observability:4318/v1/traces"
36+
tracing-sampling: "0.1"
37+
```
38+
39+
### Configuration options
40+
41+
You can configure your `config-observability` with following options:
42+
43+
* `tracing-protocol`: Valid values are `grpc` or `http/protobuf`. The default is `none`.
44+
45+
* `tracing-endpoint`: Specifies the URL to the backend where you want to send the traces.
46+
Must be set if backend is set to `grpc` or `http/protobuf`.
47+
48+
* `tracing-sampling`: Specifies the sampling rate. Valid values are decimals from `0` to `1`
49+
(interpreted as a float64), which indicate the probability that any given request is sampled.
50+
An example value is `0.5`, which gives each request a 50% sampling probablity.
51+
52+
### Viewing your `config-observability` ConfigMap
53+
54+
To view your current configuration:
55+
56+
```bash
57+
kubectl -n knative-eventing get configmap config-observability -oyaml
58+
```
59+
60+
### Editing and deploying your `config-observability` ConfigMap
61+
62+
To edit and then immediately deploy changes to your ConfigMap, run the following command:
63+
64+
```bash
65+
kubectl -n knative-eventing edit configmap config-observability
66+
```

0 commit comments

Comments
 (0)