Skip to main content

Multiplayer OpenTelemetry Python API

Project description

multiplayer-opentelemetry

Introduction

The multiplayer-opentelemetry module integrates OpenTelemetry with the Multiplayer platform to enable seamless trace collection and analysis. This library helps developers monitor, debug, and document application performance with detailed trace data. It supports flexible trace ID generation, sampling strategies.

Installation

To install the multiplayer-opentelemetry module, use the following command:

pip install multiplayer-opentelemetry 

Multiplayer Http Trace Exporter

from multiplayer.opentelemetry.exporter.http.trace_exporter import MultiplayerOTLPSpanExporter
from opentelemetry.sdk.trace.export import BatchSpanProcessor

processor = BatchSpanProcessor(MultiplayerOTLPSpanExporter(
    url = '<opentelemetry-collector-url>', # url is optional and can be omitted - default is https://api.multiplayer.app/v1/traces
    apiKey = "<multiplayer-otel-key>"
))

Multiplayer Http Log Exporter

from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from multiplayer.opentelemetry.exporter.http.log_exporter import MultiplayerOTLPLogExporter

logProcessor = BatchLogRecordProcessor(MultiplayerOTLPLogExporter(
    url = "<opentelemetry-collector-url>", # url is optional and can be omitted - default is https://api.multiplayer.app/v1/logs
    apiKey = "<multiplayer-otel-key>"
))

Multiplayer Grpc Trace Exporter

from multiplayer.opentelemetry.exporter.grpc.trace_exporter import MultiplayerOTLPSpanExporter
from opentelemetry.sdk.trace.export import BatchSpanProcessor

processor = BatchSpanProcessor(MultiplayerOTLPSpanExporter(
    url = '<opentelemetry-collector-url>', # url is optional and can be omitted - default is https://api.multiplayer.app/v1/traces
    apiKey = "<multiplayer-otel-key>"
))

Multiplayer Grpc Log Exporter

from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from multiplayer.opentelemetry.exporter.grpc.log_exporter import MultiplayerOTLPLogExporter

logProcessor = BatchLogRecordProcessor(MultiplayerOTLPLogExporter(
    url = "<opentelemetry-collector-url>", # url is optional and can be omitted - default is https://api.multiplayer.app/v1/logs
    apiKey = "<multiplayer-otel-key>"
))

Multiplayer trace Id generator

from multiplayer.opentelemetry.trace.sampler import MultiplayerTraceIdRatioBasedSampler

sampler = MultiplayerTraceIdRatioBasedSampler(rate = 1/2)

Multiplayer trace id ratio based sampler

from multiplayer.opentelemetry.trace.id_generator import MultiplayerRandomIdGenerator

id_generator = MultiplayerRandomIdGenerator(autoDocTracesRatio = 1/1000)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multiplayer_opentelemetry-0.0.7.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multiplayer_opentelemetry-0.0.7-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file multiplayer_opentelemetry-0.0.7.tar.gz.

File metadata

File hashes

Hashes for multiplayer_opentelemetry-0.0.7.tar.gz
Algorithm Hash digest
SHA256 f98307a5100d565a374a53cc06e9664cb84d487e75058cd931bed1f8446dee11
MD5 9863fdb0bc14ffda40685996f2ab747f
BLAKE2b-256 33fd4c5447509374fa88e36b226d101bbbfa0c8558ff5ee1cb85d93cd2ff90e0

See more details on using hashes here.

File details

Details for the file multiplayer_opentelemetry-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for multiplayer_opentelemetry-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 82f9f257c7e71d3bd943eaa3160f18efabc1b4be5786ccf07d66c8a7e6c5afb2
MD5 f7a943266d1a8c72755912077bf0df90
BLAKE2b-256 6b3cd35c0635b07168c13213c38c2126aa09df849c9943c0078a953851ab9d8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page