Sinks

Sink Package Exports: src/jazzmine/logging/sinks/__init__.py

This module is the public export gateway for all sink adapters in jazzmine.logging.sinks.

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

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.

High-Level API & Examples

Example 1: Import Sink Classes from a Single Module

from jazzmine.logging.sinks import KafkaLogger, RedisLogger, SentryLogger

print(KafkaLogger, RedisLogger, SentryLogger)

Example 2: Use via Top-Level Package Re-Export

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()

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

Error Handling

No runtime error handling exists in this file; operational errors occur in concrete sink modules.

Remarks

  • Keep all synchronized with actual sink implementations.
  • Adding a sink requires updates in this export module and in SINK_REGISTRY within config.py.

On this page