question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Aggregation of t-digest types broken by default

See original GitHub issue

In practice, summary data in prometheus can be hard to aggregate, because they lose a bit of data. I’ve been using a custom IPC setup to push summary data generated on workers to a master’s summary metric to avoid integration. However, this is cumbersome and I’d like to use the default metrics aggregator provided by prom-client. Can you speak to how this works in practice? It’s a bit difficult for me to figure out.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vincentwoocommented, Oct 15, 2018

Ah, I think you are correct. Here’s a test script:

const cluster = require('cluster')
const Prometheus = require('prom-client')

if (cluster.isMaster) {
  for (let i = 0; i < 3; i++) {
    cluster.fork()
  }
  const metricsServer = require('express')()
  const aggregatorRegistry = new Prometheus.AggregatorRegistry()
  metricsServer.get('/metrics', function(req, res) {
    aggregatorRegistry.clusterMetrics((err, metrics) => {
      res.set('Content-Type', aggregatorRegistry.contentType)
      res.end(metrics)
    })
  })
  metricsServer.listen(8000)
} else {
  const summary = new Prometheus.Summary({
    name: 'test',
    help: 'test'
  })
  summary.observe(1)
}

And the output:

$ curl http://localhost:8000/metrics
# HELP test test
# TYPE test summary
test{quantile="0.01"} 3
test{quantile="0.05"} 3
test{quantile="0.5"} 3
test{quantile="0.9"} 3
test{quantile="0.95"} 3
test{quantile="0.99"} 3
test{quantile="0.999"} 3
test_sum 3
test_count 3

I think this is probably not the behavior people would expect with default aggregation. I believe that summaries and histograms used the t-digest primitive, which appears to be built to be combined. If so, it seems like we could send the t-digest data over when summaries need to be aggregated.

Alternatively, might it be better for the library to do something under-the-covers where the master worker holds the “real” in-memory instrument, and the worker nodes, when observing measurements, merely pass those measurements over IPC to the master?

0reactions
vincentwoocommented, Sep 27, 2020

I renamed the title to be a bit more on the mark and am bumping the thread! Any news?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Need a more flexable histogram / tdigest · Issue #6440
It appears there are two modes for the aggregator. In the "local" mode a set of quantiles are requested and in the "central"...
Read more >
tdigest() (aggregation function) - Azure Data Explorer
Expression used as the weight of the values for the aggregation calculation. Returns. The Intermediate results of weighted percentiles of *Expr* ...
Read more >
Cisco ASR 9000 Series Aggregation Services Router ...
The default limits can be overridden through configuration of the maximum-prefix limit command for the peer for the appropriate address family. The following ......
Read more >
pt-query-digest — Percona Toolkit Documentation
When parsing general logs ( --type genlog ), the default --order-by becomes Query_time:cnt . General logs do not report query times so only...
Read more >
RFC 4271: A Border Gateway Protocol 4 (BGP-4)
BGP-4 also introduces mechanisms that allow aggregation of routes, ... Parameter Type is a one octet field that unambiguously identifies individual ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found