Monday, 27 May 2019

What does Prometheus summary.observe method do?

I'm trying to play with summary metrics and not quiet understand where do I put summary.observe call? Here is prom-client example (you can find on npm):

const client = require('prom-client');
const summary = new client.Summary({
  name: 'metric_name',
  help: 'metric_help'
});
summary.observe(10);

but there is no enough info how to use it.

  1. what does observe(10) mean?
  2. where do I put that summary.observe(10) call? Just right after summary metric declaration or at the end of function/endoint call like:

const client = require('prom-client');

const summary = new client.Summary({
  name: 'metric_name',
  help: 'metric_help'
});
summary.observe(10); // do I put it here?

async myFunc(){
    await this.serviceCall();
    summary.observe(10); // or here?
} 

Does anybody have a good example/explanation of summary observe?



from What does Prometheus summary.observe method do?

No comments:

Post a Comment