telemetry_metrics_statsd icon indicating copy to clipboard operation
telemetry_metrics_statsd copied to clipboard

Statix feature-parity

Open arkgil opened this issue 5 years ago • 5 comments

This is a tracking issue for items that need to be completed In order to make TelemetryMetricsStatsd a complete alternative to Statix.

The following features need to be added to achieve a feature parity:

  • [x] measurement sampling (can be configured per-metric with addition of reporter options to Telemetry.Metrics beam-telemetry/telemetry_metrics#52)
  • [ ] a non-standard (as in not included in Telemetry.Metrics) "set" metric, although I'd personally prefer to somehow gague interest in this one before adding it

Apart from that, we're gonna need:

  • [ ] documentation describing the transition (especially because Statix provides functions for relatively changing counters, i.e. decrement/.., increment/.. )
  • [ ] possibly a benchmark comparing the performance of two libraries

arkgil avatar Dec 25 '19 22:12 arkgil

Note on performance: as I read it, this library serializes fetching the UDP socket through a single genserver https://github.com/beam-telemetry/telemetry_metrics_statsd/blob/master/lib/telemetry_metrics_statsd/event_handler.ex#L113

Statix's tactic is to Process.register(conn.sock, __MODULE__) so that the socket can be retrieved by the client processes without serializing. That's probably going to be a tactic this library wants to copy.

benwilson512 avatar Jan 16 '20 16:01 benwilson512

@benwilson512 you're right, that's what we're currently doing. Thanks for the suggestion! I'll look into it 👍

arkgil avatar Jan 19 '20 17:01 arkgil

I wonder if it would be more beneficial to adjust Statix if needed to work nicer with telemetry instead of reimplementing? :bowtie:

lexmag avatar Mar 09 '20 13:03 lexmag

@lexmag Initially I went for a new library due to different models that Telemetry.Metrics and Statix assume. With Telemetry.Metrics you declare all of your metrics in one place, feed them to the reporter and that's it - they are updated whenever a corresponding telemetry event is fired. With Statix, you imperatively update a metric all around your codebase.

Since this project was the first Telemetry.Metrics reporter, it was simply easier and faster to implement it from scratch than try to find a way to integrate Statix with Telemetry.Metrics.

That said, there are parts of Statix that I'd love to see in this library as well. My only concern is if it's possible to merge the two without introducing confusion.

arkgil avatar May 13 '20 21:05 arkgil

Can the library just translate calls from Metrics? Listening to metrics' events and firing Statix calls.

thousandsofthem avatar Jun 05 '20 06:06 thousandsofthem