Questions tagged [prometheus-net]
17 questions
7
votes
3 answers
How to report Prometheus-net metrics in ASP.NET 4.7.1
How can I use prometheus-net in a regular ASP.NET 4.7.1 application ? In .Net Core is quite easy, but I cannot find a nice way of reporting the metrics to Grafana in 4.7.1
The ideal would be to have path /metrics where the metrics are reported.
I…

Vlad
- 802
- 1
- 10
- 23
5
votes
1 answer
Expose ASP.NET Core Prometheus metrics on another port
I'm setting up a Prometheus exporter for my ASP.NET Core 3.1 app.
I've imported
And this is what I have configured:
public void Configure(IApplicationBuilder app,…

Joel
- 8,502
- 11
- 66
- 115
4
votes
1 answer
Can two different time series be compared in prometheus?
I would like compare the following two time series which are different from each other. All I want to do is divide the result of the Second time series by the result of the First time series and generate an alert if the value is less than 1. The…

Suhas Chikkanna
- 1,292
- 5
- 20
- 34
3
votes
1 answer
Prometheus returned error "server returned HTTP status 401 Unauthorized" for .NET core api
I have a .NET core api hosted in IIS which uses windows authentication. I'm using Prometheus to scrape metrics from this API. But I'm getting the error "server returned HTTP status 401 Unauthorized" for the api target. Can some help me how to…

Renjith
- 45
- 2
- 5
3
votes
1 answer
Are Metrics instances from the Prometheus .NET client library thread-safe
For prometheus-net, none of the samples make it particularly clear whether instances of a given Metric are thread-safe:
i.e. in a random controller method, am I supposed to do:
static readonly Histogram xyzMetric = Metrics.CreateHistogram(...)
Or…

Ruben Bartelink
- 59,778
- 26
- 187
- 249
2
votes
1 answer
How setup .UseEndpoints for prometheus in .NET 7 with minimal API?
Before in .Net 6:
app.UseRouting();
app.AddMetrics(); ( inside => app.UseMiddleware();)
app.UseEndpoints(endpoint => endpoint.MapMetrics());
app.UseHttpMetrics();
In .NET 7 we have a problem with…

user9309109
- 21
- 2
2
votes
0 answers
Prometheus reports 200 but Response is actually 500
new to Prometheus here.
I added it to my Core2.1 project and Startup.cs I am doing:
public static IApplicationBuilder UseCustomMetricsMiddleware(this IApplicationBuilder app)
{
app.UseHttpMetrics();
var histogram =…

Nick
- 2,877
- 2
- 33
- 62
1
vote
1 answer
How to enable Gzip compression for getting Prometheus metrics?
I'm using Prometheus (Prometheus.KestrelMetricServer) to export our services metrics.
Everything is working but although the Accept-Encoding header is set to gzip, the response of GET localhost:port/metrics is still not compressed.
Does Prometheus…

ABS
- 2,626
- 3
- 28
- 44
1
vote
1 answer
How to use ActionFilter on Prometheus mapPath in standard .Net Web API?
I want to filter the range of client IPs who can route to Prometheus metrics.
So in startup I have
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
app.UsePrometheusServer(q =>
{
…

Sarah Allen
- 61
- 8
0
votes
0 answers
What is system_runtime_cpu_usage metric in Prometheus?
I am using .net core application with the Prometheus client.
In the metrics endpoint, I can see some metrics are exported but I want to know the implementation of those matrices. But in the client git repo, I could not find any implementation for…

Samrat Alamgir
- 355
- 2
- 13
0
votes
1 answer
PromQL query to show the number of incoming requests accurately
I'm having this problem with grafana to query the number of requests incoming to my service.
Using Prometheus-net on my dotnet core Service, I have the "http_requests_received_total" which is a counter metric.
I run a 100 requests to Postman,…

Hesham Amer
- 16
- 2
0
votes
0 answers
Prometheus and SNMP-Exporter - How to change units?
I am trying to use Prometheus and snmp-exporter to extract some information on voltage readings of some network equipment and I need to divide the output it provides by 10000 and have Prometheus output this value.
My config in snmp.yml is
- name: …

MoShivji
- 1
- 1
0
votes
2 answers
Prometheus Net AspNet Core not supporting http2 protocol
I am trying to configure prometheues into a .Net Core 3.1 Application. My application runs on http2 protocol and I have the below configuration in appsetting.json.
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
}
…

Swaroop
- 501
- 5
- 18
0
votes
0 answers
Query Prometheus data using Kusto Query Language
I'm struggling trying to set up some Grafana dashboards using Prometheus data stored in Azure Monitor.
So I have:
An ASP.NET Core application running on AKS that exports Prometheus data via a /metrics endpoint
I've configured Azure Monitor to…

Joel
- 8,502
- 11
- 66
- 115
0
votes
1 answer
Prometheus-net : callback to update a gauge when /metrics endpoint is called?
I'm not sure I got correctly how prometheus-net should be used but having a gauge that is time related I'd need to be able to update its value when data is being requested via the /metrics endpoint. I thought I might use a timer to updated the gauge…

whatever
- 2,492
- 6
- 30
- 42