pyroscope-coordinator-k8s

Pyroscope Coordinator K8S

Channel Revision Published Runs on
2/edge 57 16 Sep 2025
Ubuntu 24.04
juju deploy pyroscope-coordinator-k8s --channel 2/edge
Show information

Platform:

charms.pyroscope_coordinator_k8s.v0.profiling

Profiling integration endpoint wrappers.

Install with:

$ charmcraft fetch-lib charms.pyroscope_coordinator_k8s.v0.profiling

Requirer usage

Update charmcraft.yaml to add a profiling requirer endpoint

requires:
  profiling:
    interface: profiling
    optional: true
    description: Send profiles to a profiling backend (Pyroscope).

Then update your charm code:

from charms.pyroscope_coordinator_k8s.v0.profiling import ProfilingEndpointRequirer, Endpoint
...
class MyCharm(ops.CharmBase):
        def __init__(self, ...):
            ...
            self._profiling = ProfilingEndpointRequirer(self.model.relations['profiling'])  # has to match the endpoint name declared in charmcraft.yaml

        @property
        def profiling_endpoints(self) -> List[Endpoint]:
            "The profiling backend endpoints we receive over the 'profiling' interface."
            return self._profiling.get_endpoints()

        def configure_profiling(self):
            "Configure your application to send profiles to the provided endpoint."
            for endpoint in self.profiling_endpoints:
                self.add_profiling_endpoint(url=endpoint.otlp_grpc, insecure=endpoint.insecure)
Provider usage

Update charmcraft.yaml to add a profiling provider endpoint

provides:
  profiling:
    interface: profiling
    optional: true
    description: Receive otel profiles.

Then update your charm code:

from charms.pyroscope_coordinator_k8s.v0.profiling import ProfilingEndpointProvider
...
class MyCharm(ops.CharmBase):
        def __init__(self, ...):
            ...
            self._profiling = ProfilingEndpointProvider(self.model.relations['profiling'], self.application)

        def publish_profiling_endpoint(self):
            "Update all our `profiling` relations, advertising this unit's ingestion endpoint url."
            self._profiling.publish_endpoint(f"{socket.getfqdn()}:1239", insecure=True)

class Endpoint

Description

Profiling endpoint. None

class ProfilingAppDatabagModel

Description

Application databag model for the profiling interface. None

class ProfilingEndpointProvider

Description

Wraps a profiling provider endpoint. None

Methods

ProfilingEndpointProvider. __init__( self , relations , app )

ProfilingEndpointProvider. publish_endpoint( self , otlp_grpc_endpoint: str , insecure: bool )

Description

Publish profiling ingestion endpoints to all relations. None

class ProfilingEndpointRequirer

Description

Wraps a profiling requirer endpoint. None

Methods

ProfilingEndpointRequirer. __init__( self , relations )

ProfilingEndpointRequirer. get_endpoints( self )

Description

Obtain the profiling endpoints from all relations. None