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.8.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.8-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for multiplayer_opentelemetry-0.0.8.tar.gz
Algorithm Hash digest
SHA256 a47de932f7252acdeb8b26b19748de0fb0324631910a8e2f742b2cc3bc9364f2
MD5 ce31f017d1d7341fc53553a7f51180ce
BLAKE2b-256 71f6fa485901f884d4d8087253cbda97e78b1c60d4520422465eead0676b3d70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multiplayer_opentelemetry-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9b11917b04851402ed970b8fc65a6a36dcd7dfd862f57d54124cf795cd7dde61
MD5 e152cb98e098eac221665839854185a0
BLAKE2b-256 1090c097aadbc6bbcd22587f223dffe7831aacc38b94bbb7e1115d29ffdd11d3

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