Tempo

  • By Canonical Observability
Channel Revision Published Runs on
latest/stable 51 28 Jun 2024
Ubuntu 22.04 Ubuntu 20.04
latest/stable 9 16 Feb 2024
Ubuntu 22.04 Ubuntu 20.04
latest/candidate 68 28 Jun 2024
Ubuntu 22.04 Ubuntu 20.04
latest/candidate 9 12 Dec 2023
Ubuntu 22.04 Ubuntu 20.04
latest/beta 71 28 Jun 2024
Ubuntu 22.04 Ubuntu 20.04
latest/beta 9 12 Dec 2023
Ubuntu 22.04 Ubuntu 20.04
latest/edge 71 27 Jun 2024
Ubuntu 22.04 Ubuntu 20.04
latest/edge 9 31 Jul 2023
Ubuntu 22.04 Ubuntu 20.04
juju deploy tempo-k8s --channel edge
Show information

Platform:

Setting up tracing integration

if you are charming an application that is already instrumented for tracing or you plan to configure the workload or the charm itself to push traces, you can integrate with tempo-k8s to send traces to a Tempo endpoint.

Instrumenting your workload is not covered under tempo-k8s. Some workloads, like Grafana are already instrumented for tracing by design. Otherwise, you can use auto-instrumentation libraries to instrument your workload and integrate with tempo-k8s as a tracing backend.

For an example of charms that already integrate with tempo-k8s to collect traces, see loki and prometheus.

Add an integration endpoint to charmcraft.yaml

host and injesters data is communicated over relation data, where the charmed application is the requirer and Tempo charm is the provider. For consistency across the ecosystem, it is encouraged to name the relation tracing.

Edit your charm’s charmcraft.yaml to add, under requires, the following:

requires:
    # any other requirers your charm supports
    tracing:
        interface: tracing
        limit: 1

Fetch the tracing charm library

charmcraft fetch-lib charms.tempo_k8s.v2.tracing

The TracingEndpointRequirer object enables your charm to easily access Tempo endpoint information exchanged over a tracing relation interface.

Use TracingEndpointRequirer

If you are intending to send traces with otlp_http and otlp_grpc tracing protocols:

from charms.tempo_k8s.v2.tracing import TracingEndpointRequirer

class FooCharm:
    def __init__(self, *args):
        super().__init__(*args, **kwargs)
        ...
        self.tracing = TracingEndpointRequirer(self, protocols=["otlp_http", "otlp_grpc"])
        ...

This will ensure that each unit of Foo will have access to a Tempo endpoint to push charm traces to once a relation is established.

For the list of supported protocols, see Tracing Protocols.

Access Tempo endpoints

After instantiating TracingEndpointRequirer with a list of protocols, tempo-k8s charm will provide, as part of its databag, a set of Tempo endpoints for the requested protocols that your workload & charm can use to push traces to.

from charms.tempo_k8s.v2.tracing import TracingEndpointRequirer

class FooCharm:
   def __init__(self, *args):
       super().__init__(*args, **kwargs)
       ...
       self.tracing = TracingEndpointRequirer(self, protocols=["otlp_http", "otlp_grpc"])
       ...
       # get tempo endpoints
       if self.tracing.is_ready():
           grpc_endpoint = self.tracing.otlp_grpc_endpoint()
           http_endpoint = self.tracing.otlp_http_endpoint()
       

Help improve this document in the forum (guidelines). Last updated 2 months ago.