avito-tech / bioyino

High performance and high-precision multithreaded StatsD server
The Unlicense
228 stars 22 forks source link

New prefix for metrics per type #49

Closed colixxx closed 3 years ago

colixxx commented 4 years ago

Hi, can I add prefix for metrics per type? For example: If metric type timer - add prefix stats.timers If metric type count - add prefix stats If gauges - add statsd.gauges

Thanks!

Albibek commented 4 years ago

In current version this is not possible. Why would you need that? Since you cannot aggregate metrics with same name and different types, you already have unique names right away, on input. I'd recommend adding them on the sending side to make sure dirrefent types have different names, so aggregation is not failed.

colixxx commented 4 years ago

It best way for migration from old statsd to your realization.

Because old statsd is add it prefix per metric src_link:

Albibek commented 4 years ago

Sicne we already have prefixes, I can propose the following. Make a placeholder inside the global prefix options to look like this:

stats-prefix = "some.prefix._METRIC_TYPE_.some-other-thing"
prefix-replacements = { "max" = "some.prefix.for-max._METRIC_TYPE_"  }

Where '_METRICTYPE' will be replaced with corresponsing type name specified as a separate option.

To me it seems to be enough for solving your problem. What do you say?

colixxx commented 4 years ago

Thnx, i will try it later. My work around is delete this prefix in Grafana =)

Can you tell me about percentile? how I can calculate percentile for upper, mean, sum, count when I send timer metric type?

Albibek commented 4 years ago

It is not done yet. I'm asking if it is OK for you or not. If OK, I'll do this.

Percentiles and other aggregates are only counted for ms typed metrics.

colixxx commented 4 years ago

Apparently I did not understand you correctly. Yes it suits me.

To the question of percetals. I meant that I want to count percentiles for ms type. when I send ms type, I have upper, mean, sum, lower, median. For this I want count percentile.

Albibek commented 4 years ago

The percentile support is built in for ms. Along with .mean, .sum etc you should have .percentile-75, .percentile-99, etc.

If not, try specifiying the aggregates you need explicitly https://github.com/avito-tech/bioyino/blob/master/config.toml#L171

colixxx commented 4 years ago

Maybe I don't understand you... I want calculate percentile for mean, upper and etc. I want have upper-90, mean-95.

Albibek commented 4 years ago

You cannot have percentile on percentile, because there is only one value and no dataset after everything is aggregated. What tou are asking is aggregation that can only be made out of aggregation period, with mulple values, received during multiple periods. Usually other solutions are used here. Graphite, InfluxDB , etc

Albibek commented 3 years ago

The naming scheme has been updated for your request and is introduced in 0.7.0.

See the docs for the details.