How to use the opentelemetry-sdk.src.opentelemetry.sdk.metrics.__init__.Meter function in opentelemetry-sdk

To help you get started, we’ve selected a few opentelemetry-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github open-telemetry / opentelemetry-python / opentelemetry-sdk / src / opentelemetry / sdk / metrics / __init__.py View on Github external
This implementation encodes the labels to use as a map key.

        Args:
            labels: The dictionary of label keys to label values.
        """
        if len(labels) == 0:
            return EMPTY_LABEL_SET
        # Use simple encoding for now until encoding API is implemented
        encoded = tuple(sorted(labels.items()))
        # If LabelSet exists for this meter in memory, use existing one
        if encoded not in self.labels:
            self.labels[encoded] = LabelSet(labels=labels)
        return self.labels[encoded]


meter = Meter()

opentelemetry-sdk

OpenTelemetry Python SDK

Apache-2.0
Latest version published 4 days ago

Package Health Score

97 / 100
Full package analysis