OpenTelemetry Semantic Conventions

0.61b0 · active · verified Sat Mar 28

OpenTelemetry Semantic Conventions library for OpenTelemetry projects, providing standard definitions and formats for telemetry data. Currently at version 0.61b0, it follows a semi-regular release cadence with breaking changes announced in advance.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to utilize SemanticAttributes for telemetry data.

import os

# Example usage of SemanticAttributes
attribute_key = 'http.method'
attribute_value = 'GET'

if os.environ.get('OTEL_KEY', ''):
    print(f'Setting attribute: {attribute_key} = {attribute_value}')
else:
    print('OTEL_KEY not found!')

view raw JSON →