Skip to content

Accessing request traces

Traces give us the big picture of what happens when a request is made to an application. Knative Serving 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.

Configure tracing

You can update the configuration for tracing in the config-observability ConfigMap.

Example:

The following example config-observability ConfigMap samples 10% of all requests over OTLP HTTP:

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-observability
  namespace: knative-serving
data:
  tracing-protocol: "http/protobuf"
  tracing-endpoint: "http://jaeger-collector.observability:4318/v1/traces"
  tracing-sampling-rate: "0.1"

(If you use tracing-protocol: "grpc", point tracing-endpoint at your collector's OTLP gRPC port, typically :4317.)

Configuration options

You can configure your config-observability with the following options:

  • tracing-protocol: Valid values are grpc or http/protobuf. The default is none.

  • tracing-endpoint: Specifies the URL to the backend where you want to send the traces. Must be set if tracing-protocol is set to grpc or http/protobuf.

  • tracing-sampling-rate: Specifies the sampling rate. Valid values are decimals from 0 to 1 (interpreted as a float64), which indicate the probability that any given request is sampled. An example value is 0.5, which gives each request a 50% sampling probability.

Viewing your config-observability ConfigMap

To view your current configuration:

kubectl -n knative-serving get configmap config-observability -o yaml

Editing and deploying your config-observability ConfigMap

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

kubectl -n knative-serving edit configmap config-observability

We use analytics and cookies to understand site traffic. Information about your use of our site is shared with Google for that purpose. Learn more.