influxdb-csharp icon indicating copy to clipboard operation
influxdb-csharp copied to clipboard

Filters

Open bnayae opened this issue 6 years ago • 1 comments

I'm considering to contribute filtering capability backed into the configuration flow. The idea behind it is to enable better control over the metrics you sending over the wire at runtime.

You may want limited amount of metrics that will give general health indication, but when you got indication that something may went wrong, you may want to illuminate specific spot by open other metrics.

In terms of Api I'm considering something similar to Serilog's filtering. My suggestion is:

Metrics.Collector = new CollectorConfiguration() .Filter.Tags.Match(tags => tags.ContainsKey("host") && tags["host"] == "BnayaMac") .Tags.Exists.All(() => new[] { "Dev", "Staging" }) .Tags.Exists.Any(() => new[] { "OperationA", "OperationB" }) .Fields.Match(fileds => fileds.ContainsKey("cpu") && fileds["cpu"] > 80)

What do you think about the Api?

bnayae avatar Mar 14 '18 14:03 bnayae

Thanks for the heads-up, Bnaya. This isn't a feature I've personally been looking for, but I can't speak for everyone else - will keep this here so we can collect feedback. Cheers!

nblumhardt avatar May 08 '18 00:05 nblumhardt