Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asynq-io/opentelemetry-instrumentation-eventiq
Opentelemetry instrumentation for eventiq
https://github.com/asynq-io/opentelemetry-instrumentation-eventiq
eventiq instrumentation observability opentelemetry python
Last synced: 3 months ago
JSON representation
Opentelemetry instrumentation for eventiq
- Host: GitHub
- URL: https://github.com/asynq-io/opentelemetry-instrumentation-eventiq
- Owner: asynq-io
- License: apache-2.0
- Created: 2024-07-16T11:25:18.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-10-02T06:43:55.000Z (4 months ago)
- Last Synced: 2024-10-02T07:58:16.469Z (4 months ago)
- Topics: eventiq, instrumentation, observability, opentelemetry, python
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Tests](https://github.com/asynq-io/opentelemetry-instrumentation-eventiq/workflows/Tests/badge.svg)
![Build](https://github.com/asynq-io/opentelemetry-instrumentation-eventiq/workflows/Publish/badge.svg)
![License](https://img.shields.io/github/license/asynq-io/opentelemetry-instrumentation-eventiq)
![Mypy](https://img.shields.io/badge/mypy-checked-blue)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
![Python](https://img.shields.io/pypi/pyversions/opentelemetry-instrumentation-eventiq)
![Format](https://img.shields.io/pypi/format/opentelemetry-instrumentation-eventiq)
![PyPi](https://img.shields.io/pypi/v/opentelemetry-instrumentation-eventiq)# opentelemetry-instrumentation-eventiq
Opentelemetry instrumentation for eventiq
## Installation
```shell
pip install opentelemetry-instrumentation-eventiq
```## Usage
```python
from eventiq import Service
from opentelemetry.instrumentation.eventiq import EventiqInstrumentor, TraceContextCloudEvent, OpenTelemetryTracingMiddlewareEventiqInstrumentor().instrument()
# or directly instrument a service instance
service = Service(...)
EventiqInstrumentor().instrument_service(service)
# or by manually adding middleware
service.add_middleware(OpenTelemetryTracingMiddleware)@service.subscribe(topic="example.topic")
async def handler(message: TraceContextCloudEvent):
print(message.data, message.tracecontext)
```## Classes
- `EventiqInstrumentor` - Opentelemetry instrumentor for eventiq
- `OpenTelemetryTracingMiddleware` - Middleware for tracing messages with OpenTelemetry
- `OpenTelemetryMetricsMiddleware` - Middleware for exporting metrics with OpenTelemetry
- `TraceContextCloudEvent` - CloudEvent extension for OpenTelemetry trace context