Skip to content

feat(sinks): add network_mock sink#72

Draft
mdeltito wants to merge 2 commits intomasterfrom
feature/LOG-23599
Draft

feat(sinks): add network_mock sink#72
mdeltito wants to merge 2 commits intomasterfrom
feature/LOG-23599

Conversation

@mdeltito
Copy link
Copy Markdown
Member

@mdeltito mdeltito commented Apr 9, 2026

This sink functions like a blackhole sink, but exercises the full lifecycle of other sinks that make network requests using a Tower service (batching, encoding, request building, concurrency control, retries, acknowledgements). Supports configurable latency (mean + jitter), error rate simulation, and standard batch/request settings.

Ref: LOG-23599

Example

[api]
enabled = true

[sources.demo]
type = "demo_logs"
format = "json"
interval = 0.01

[sinks.mock]
type = "network_mock"
inputs = ["demo"]
error_rate = 0.5

  [sinks.mock.latency]
  mean_ms = 50
  jitter_ms = 10

  [sinks.mock.buffer]
  max_events = ${MEZMO_MEM_BUFFER_MAX_EVENTS:-10000}
  when_full = "block"

  [sinks.mock.batch]
  max_bytes = 2_097_151

  [sinks.mock.request]
  retry_attempts = 10
  retry_initial_backoff_secs = 1
  retry_max_duration_secs = 10
  timeout_secs = 30
  rate_limit_duration_secs = 1

  [sinks.mock.acknowledegments]
  enabled = true

mdeltito added 2 commits April 9, 2026 10:19
This sink functions like a `blackhole` sink, but exercises the
full lifecycle of other sinks that make network requests
using a Tower service (batching, encoding, request building,
concurrency control, retries, acknowledgements). Supports
configurable latency (mean + jitter), error rate simulation, and
standard batch/request settings.

Ref: LOG-23599
Adds a no-op flusher when MEZMO_METRICS_DB_URL is set to "log://null",
mirroring the existing "log://stderr" test hook. Useful for pods where
metrics output is unwanted (e.g. static-config blackhole STS) without
requiring a real database connection or flooding stderr.

Co-authored-by: Darin Spivey <darin.spivey@mezmo.com>

Ref: LOG-223600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant