telemetry_metrics icon indicating copy to clipboard operation
telemetry_metrics copied to clipboard

Filtering on measurements

Open bryannaegele opened this issue 3 years ago • 5 comments

I'm currently logging a debug "skipping event due to missing measurement" which is helpful for identifying an issue but is sometimes an unavoidable thing, such as :idle being nil in an Ecto query.

I could add a "report once" check but that would require another ets lookup on something that could be very frequent. Not a huge deal. Or we could enable filtering on measurements here, which we discussed during the addition of filtering on metadata.

Thoughts?

bryannaegele avatar Jul 24 '20 16:07 bryannaegele

How about adding an option to disable logging for specific events? Although that is mostly equivalent to filtering, but tailored to only that specific use-case.

If we add filtering, I think it needs to be implemented via keep, drop, to avoid adding new options.

arkgil avatar Jul 28 '20 15:07 arkgil

If we added it here then it would just be adding a second arg to keep/drop with the measurement values.

The other alternative is I just silently drop events with nil measurement values but warn on missing measurement keys. 🤷🏻

bryannaegele avatar Jul 28 '20 17:07 bryannaegele

I want to ship v1.0 and this is an open issue which may require breaking changes. How do we feel about this 3 years later? Wouldn't you be able to discard idle=nil events using keep/drop?

josevalim avatar Jan 11 '24 09:01 josevalim

We don't currently accept measurements as an arg to the predicates. If we wanted to add it later, it wouldn't be a breaking change, so not a blocker for 1.0

bryannaegele avatar Jan 11 '24 18:01 bryannaegele

Ah, we could easily make it a two arity function with measurement, metadata, so it sounds good to me. I can work on a PR for this. :)

josevalim avatar Jan 11 '24 20:01 josevalim