https://github.com/s71m/opentelemetry-loguru-telegram
Custom otelcol-contrib with exporter to telegram. And handler for loguru
https://github.com/s71m/opentelemetry-loguru-telegram
loguru opentelemetry opentelemetry-python otelcol telegram
Last synced: 10 months ago
JSON representation
Custom otelcol-contrib with exporter to telegram. And handler for loguru
- Host: GitHub
- URL: https://github.com/s71m/opentelemetry-loguru-telegram
- Owner: s71m
- License: mit
- Created: 2024-11-27T16:47:09.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-08T02:59:07.000Z (10 months ago)
- Last Synced: 2025-04-08T03:33:10.879Z (10 months ago)
- Topics: loguru, opentelemetry, opentelemetry-python, otelcol, telegram
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
For enabling telegram exporter need to build custom otelcol-contrib, how described here:
[readme_otelcol_contrib.md](docs%2Freadme_otelcol_contrib.md)
After that add this section to etc/otelcol-contrib/config.yaml
```yaml
exporters:
telegram:
enabled: true
bot_token: "${TELEGRAM_BOT_TOKEN}"
chat_id: "${TELEGRAM_CHAT_ID}"
max_message_length: 4096
batch_enabled: true # Enable/disable batching functionality
batch_timeout: 5s # Time to wait before sending a batch
batch_size: 10 # Number of messages to accumulate before sending
# channels section to support message routing by severity or channel
channels:
- name: "ERROR"
message_thread_id: 4
severities: ["WARNING", "ERROR", "CRITICAL"]
- name: "INFO"
message_thread_id: -1
severities: ["DEBUG", "INFO", "SUCCESS"]
- name: "TRADE"
message_thread_id: 2
```
And example of tracing and logging in demo files:
[demo_tracer.py](demo_tracer.py) [demo_logger.py](demo_logger.py)