pinterest / elixometer

A light Elixir wrapper around exometer.

Home Page:https://hexdocs.pm/elixometer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there anyway to support multiple reporters?

tony612 opened this issue · comments

If my understanding is right, only one reporter is supported in Elixometer at the moment, right? If so, is there anyway to support multiple ones?

Right now, no, elixometer only allows you to subscribe to the reporter defined in Application.get_env(:elixometer, :reporter).

If you want to submit a PR for adding this, it should be rather easy.

@scohen Got it, I'll try to solve this. I think this should be a useful feature 😁

@tony612 Yes, I agree.

I think it's as simple as allowing a list to be passed to :reporter and checking for that an iterating over it in https://github.com/pinterest/elixometer/blob/master/lib/elixometer.ex#L349

@scohen There's one problem: How about deprecating :reporter to support :reporters?

I don't know how I feel about that; soft deprecation is OK, but should emit a warning. Hard deprecation will break things for people (including us).

What are your thoughts? :reporters can take a single names or a list of names?

@scohen Yeah, I'm OK with soft deprecation and we can remove :reporter in a future version. I refer :reporters only accept a list of names, which is more clear.