View logs associated with a trace

View and pivot to logs from Trace Explorer

With Correlation Tags, you can pivot between traces and logs, to for example:

  • View pod logs for the pod on which a span in a trace executed

  • View application logs that correspond to the same user request

Observe automatically adds several correlation tags to your span data, which means that for most common use cases, you’ll only need to add correlation tags to your log datasets.

Example: correlate between Kubernetes pod logs and traces

Add the following correlation tags to your pod logs dataset (see how to add correlation tags to a dataset):

  • k8s.pod.name (required)

  • k8s.cluster.uid (optional)

  • k8s.namespace.name (optional)

Now ensure the Kubernetes spans in your traces have Kubernetes resource attributes. If you’re using the Observe Agent, this happens automatically. If not, you may need to configure k8s metadata collection in your telemetry pipeline.

Example: correlate between application logs with a trace id, and traces

Ensure your logs include the trace id. If you’re using the recommended application instrumentation, this will happen automatically. If not, you’ll need to manually inject the OpenTelemetry trace id into your logs.

Add the trace_id correlation tag to your log dataset (see how to add correlation tags to a dataset).