1. Behavior and Context
The file imports each sink class and declares them in __all__. This gives consumers one stable import path for all supported backends.
Exported groups include:
- base contract: BaseSink
- HTTP API sinks: Datadog, Loki, New Relic, Logstash
- error tracking: Sentry
- message brokers: Kafka, Redis
- cloud providers: CloudWatch, Pub/Sub
- agent collectors: Vector, Fluent Bit, Promtail
- GELF: Graylog
- telemetry: Honeycomb
2. Purpose
- Discoverability: One place to see all bundled sinks.
- API Stability: Avoid deep import-path coupling in application code.
- Integration Simplicity: Uniform import experience for docs/examples.
3. High-Level API & Examples
Example 1: Import Sink Classes from a Single Module
python
from jazzmine.logging.sinks import KafkaLogger, RedisLogger, SentryLogger
print(KafkaLogger, RedisLogger, SentryLogger)Example 2: Use via Top-Level Package Re-Export
python
from jazzmine.logging import LokiLogger
sink = LokiLogger(
sink_config={"type": "loki", "url": "http://localhost:3100/loki/api/v1/push"},
logger_name="billing",
level="INFO",
use_json=True,
)
sink.initialize()
sink.info("pipeline online")
sink.shutdown()4. Detailed Module Functionality
Import Surface
The module performs straightforward import forwarding from concrete sink modules.
__all__
Defines the intended public sink API:
- BaseSink
- DatadogLogger, LokiLogger, NewRelicLogger, LogstashLogger
- SentryLogger
- KafkaLogger, RedisLogger
- CloudWatchLogger, PubSubLogger
- VectorLogger, FluentBitLogger, PromtailLogger
- GraylogLogger
- HoneycombLogger
5. Error Handling
No runtime error handling exists in this file; operational errors occur in concrete sink modules.
6. Remarks
- Keep __all__ synchronized with actual sink implementations.
- Adding a sink requires updates in this export module and in SINK_REGISTRY within config.py.