Accessing CloudEvent traces¶
Traces give us the big picture of how events traverse through the system and applications. Knative Eventing is instrumented with OpenTelemetry which can emit traces to a multitude of different backends.
Backends¶
Jaeger V2¶
Following these instructions to setup Jaeger V2 on Kubernetes and access your traces.
Configuring Eventing Tracing¶
You can update the configuration for tracing in using the config-observability ConfigMap.
With the exception of importers, the Knative Eventing tracing is configured through the
config-observability ConfigMap in the knative-eventing namespace.
Most importers do not use the ConfigMap and instead, use a static 1% sampling rate.
You can use the config-observability ConfigMap to configure the following Eventing components:
- Brokers
- Triggers
- InMemoryChannel
- ApiServerSource
- PingSource
- GitlabSource
- KafkaSource
- PrometheusSource
Example:
The following example config-observability ConfigMap samples 10% of all CloudEvents:
apiVersion: v1
kind: ConfigMap
metadata:
name: config-observability
namespace: knative-eventing
data:
tracing-protocol: "grpc"
tracing-endpoint: "http://jaeger-collector.observability:4318/v1/traces"
tracing-sampling-rate: "0.1"
Configuration options¶
You can configure your config-observability with following options:
-
tracing-protocol: Valid values aregrpcorhttp/protobuf. The default isnone. -
tracing-endpoint: Specifies the URL to the backend where you want to send the traces. Must be set if backend is set togrpcorhttp/protobuf. -
tracing-sampling-rate: Specifies the sampling rate. Valid values are decimals from0to1(interpreted as a float64), which indicate the probability that any given request is sampled. An example value is0.5, which gives each request a 50% sampling probablity.
Viewing your config-observability ConfigMap¶
To view your current configuration:
kubectl -n knative-eventing get configmap config-observability -oyaml
Editing and deploying your config-observability ConfigMap¶
To edit and then immediately deploy changes to your ConfigMap, run the following command:
kubectl -n knative-eventing edit configmap config-observability