Skip to content

Improve ping-engine Kafka throughput - #112

Open
R7rainz wants to merge 6 commits into
masterfrom
dev
Open

R7rainz wants to merge 6 commits into
masterfrom
dev

Conversation

@R7rainz

@R7rainz R7rainz commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Batch ping metrics before publishing them to Kafka.
  • Configure the Kafka writer for batches of up to 100 messages or 10 ms.
  • Keep synchronous writes and RequireOne acknowledgements for delivery durability.

Why this was required

The ping engine had 50 probe workers, but the publisher called WriteMessages once per result. Because each call was synchronous and contained one message, Kafka batching was not effective. The observed output rate was about one metric per second, leaving roughly 191,000 target messages queued and delaying new monitors for many hours.

Result

The publisher now groups results and performs one synchronous Kafka write per batch. This lets the existing worker pool feed Kafka efficiently without switching to lossy async writes.

Verification

  • go test ./... passes.
  • Rebuilt and restarted pulseops-ping-engine.
  • Monitor 1004 for http://app:8080/ready completed successfully with UP, HTTP 200, and 1 ms response time.
  • Target-topic consumer lag returned to 0 after removing the synthetic load-test backlog.
  • The existing uncommitted docker-compose.yml network change was intentionally excluded from this PR.

@gitguardian

gitguardian Bot commented Sep 9, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
34586996 Triggered Generic Password 9b9d839 docker-compose.yml View secret
34586996 Triggered Generic Password 9b9d839 docker-compose.yml View secret
34586996 Triggered Generic Password 9b9d839 docker-compose.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

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