ruby-kafka icon indicating copy to clipboard operation
ruby-kafka copied to clipboard

Push compression metrics to StatsD/Datadog/Prometheus

Open ellimist opened this issue 4 years ago • 3 comments

The Compressor class is pushing ActiveSupport notifications with metrics regarding the messages getting compressed.

However these don't get pushed to StatsD/Datadog, since there's no subscriber for them.

This PR adds the missing subscribers.

ellimist avatar Oct 28 '20 17:10 ellimist

@dasch I think I found a bug in the compression. I fixed it in the second to last commit: https://github.com/zendesk/ruby-kafka/pull/868/commits/3ad0c0447e96f13e8ca55fc407bc34ce0596ed84

Looks like the compression was removed in this commit 4 years ago? 😕

The functional tests started to fail though. I'm wondering if this is a red herring, or if the compression really wasn't being applied until now.

ellimist avatar Oct 15 '21 12:10 ellimist

@dasch I think I found a bug in the compression. I fixed it in the second to last commit: 3ad0c04

Oh, should've read this before reviewing 😆

Looks like the compression was removed in this commit 4 years ago? 😕

The functional tests started to fail though. I'm wondering if this is a red herring, or if the compression really wasn't being applied until now.

No, I think compression was not being applied, but the way we do it now is not valid. The problem probably is that we can't just return the compressed data – we need to wrap it in some kind of record. See how it's being done in the legacy "message set" method... I'm actually not sure if the same method is used in the more recent protocol versions. Kafka has an... interesting protocol.

dasch avatar Oct 18 '21 08:10 dasch

You might need to read up on how records are encoded: https://kafka.apache.org/documentation/#recordbatch

dasch avatar Oct 18 '21 08:10 dasch

Pull request has been marked as stale due to a lack of activity.

github-actions[bot] avatar Jun 17 '23 00:06 github-actions[bot]