Questions tagged [prom-client]

20 questions
3
votes
2 answers

How to add Prometheus to next.js?

I should use prom-client in my nextjs app. but I have no idea for it. I cant find any example for it I want to add Prometheus with prom-client to my nextjs app. I should use histogram in getServerSideProps function. this is my current code: //…
Kamran Davar
  • 427
  • 2
  • 12
3
votes
0 answers

What is Gauge.startTimer for and how to properly use it?

As I understand, the Gauge counter is a value that changes over time without saving somewhere when every change of the counter (dec(x) or inc(y)) was and the labels of every call to dec or inc. Please correct me if I'm wrong. Questions What exactly…
Stav Alfi
  • 13,139
  • 23
  • 99
  • 171
2
votes
1 answer

How do I track sporadic data with prometheus in nodejs?

I am using prom-client in nodejs to publish a /metrics endpoint. I want to monitor sales of varying amounts which occur sporadically over time. What is the best way to track a sporadic or discontinuous metric in prometheus? None of the existing…
Raine Revere
  • 30,985
  • 5
  • 40
  • 52
2
votes
2 answers

prom-client returning empty object for default metrics in NodeJS application

I have a NodeJS application, and I want to expose the default metrics. I have the following implementation. I am using the prom-client package. let express = require('express'); let app = express(); const client = require('prom-client'); // Create…
Keet Sugathadasa
  • 11,595
  • 6
  • 65
  • 80
2
votes
0 answers

Sequelize pool monitoring with Prometheus

I have a nodejs application which is using sequelize and sequelize-pool for connecting with database. I am working on enabling monitoring for this application. I am using prom-client and collecting default set of metrics, which includes heap usage,…
1
vote
0 answers

prom-client format vs Grafana Cloud push interface

I am new to Prometheus/Grafana world and wanna get metrics from my node.js app for which I use prom-client to get the metrics as given below. That works :-) Now I wanna push them to Grafana Cloud and it seems I have the following …
TomFree
  • 1,091
  • 3
  • 17
  • 31
1
vote
0 answers

NodeJS prometheus metrics and grafana false metrics peaks

i am experiencing really strange behavior with prometheus and grafana. It seems like when prometheus gets under load from grafana e.g. when changing date range to larger or refreshing the graphs after longer time, it generates false metrics, it…
1
vote
1 answer

Prometheus metrics dont work on self defined node.js application

im follwing some tuorials, they are all doing it the same way with including the 'prom-client' and creating a new /metrics url. then i access my http://localhost:4000/metrics im getting follwing error instad my metrics: TypeError…
duritella
  • 63
  • 1
  • 5
1
vote
0 answers

prom-client metrics returning negative value on prometheus

I am running the prom-client query "http_request_duration_ms_sum" on prometheus, everytime I run this query it return's a negative value. eg:- http_request_duration_ms_sum{code="200", instance="x.x.x.x", job="node_exporter", method="get",…
SVD
  • 385
  • 4
  • 24
1
vote
1 answer

what happens to application metrics e.g. CPU used by process that are not scraped in scrape interval prometheus

How does prometheus collect CPU information during intervals it dont scrape ? For e.g. i have my scrape_interval: 15s and a CPU spikes up to 90% during the 15 seconds that prometheus did not scrape ... Will i loose this important information…
1
vote
1 answer

How to extract prometheus metrics for urls with path params

I have a Node JS app that has a URL like this: /app/:vehicleNumber/details It takes vehicle numbers dynamically in URL. The prom-client based metrics API for HTTP calls is returning all the URLs as separate URLs instead of clubbing them as a single…
1
vote
0 answers

Is there any way to add new labels to an already initialized metric?

I'm using prom-client npm package to monitor my app. I've read here that "All metrics can take a labelNames property in the configuration object. All label names that the metric support needs to be declared here. (in the object given to the…
0
votes
0 answers

Custom prom-client metrics always shows 0 value

I am creating custom metrics and when I trigger /metric endpoint it always shows 0 as output even its enters inside if condition. //This is my metrics.ts file import express from 'express'; import client from 'prom-client'; const register = new…
Akshay Barodia
  • 486
  • 4
  • 11
0
votes
0 answers

Nuxt 3 and prom-client

Anyone knows how to use prom-client in Nuxt3 app? Which place I should insert collectDefaultMetrics function? Within nuxt.config it not working, or throw an error: a metric with the name process_cpu_user_seconds_total has already been registered
Twist
  • 235
  • 4
  • 10
0
votes
0 answers

How to forcefully set the previously saved state of metrics in the prom-client registry?

My node.js application uses prom-client. Once a minute, I save the current metrics to the database as a string. How to install them in the registry back from the string? async function saveMetricsToDatabase(dbSuite, register) { try { const…
1
2