prometheus-net | .NET library to instrument your code with Prometheus metrics | Analytics library
kandi X-RAY | prometheus-net Summary
kandi X-RAY | prometheus-net Summary
This is a .NET library for instrumenting your applications and exporting metrics to Prometheus.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of prometheus-net
prometheus-net Key Features
prometheus-net Examples and Code Snippets
Community Discussions
Trending Discussions on prometheus-net
QUESTION
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:
...ANSWER
Answered 2021-Feb-19 at 11:51I ended up doing like this:
QUESTION
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 but the ideal thing would be to have a callback exposed by prometheus-net to update what need updating just before data is returned.
...ANSWER
Answered 2020-Feb-18 at 08:55If anyone needs it, prometheus-net provides the AddBeforeCollectCallback
callback for collecting or updating your metrics, gauges, etc. just before Prometheus collects data from you.
From prometheus-net documentation
In some scenarios you may want to only collect data when it is requested by Prometheus. To easily implement this scenario prometheus-net enables you to register a callback before every collection occurs. Register your callback using Metrics.DefaultRegistry.AddBeforeCollectCallback().
QUESTION
I have a .NET app running on K8s. It sends a lot of HTTP requests to external services and I'd like to have more visibilty. Traefik runs as a proxy but I'm considering replacing it with Ambassador
For monitoring I use Prometheus. It works very well with Traefik but gives me only metrics about incoming HTTP requests Prometheus library for .NET looks good https://github.com/prometheus-net/prometheus-net but also unclear if it gives outgoing HTTP calls metrics or not
Any help or suggestions are appreciated
...ANSWER
Answered 2020-Feb-04 at 06:05Answer 1: I ended up adding log line for every outgoing request, transport to ElasticSearch and counting number of requests in Kibana
Answer 2: you can deploy service mesh to your K8s cluster (Linkerd, Istio, Maesh or whatever) and make it transport tracing metrics to Prometheus
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install prometheus-net
After installing the library, you should:. The chapters below describe the various ways you can initialize or update metrics and the ways in which they can be published. The following is a minimal implementation that simply increments a counter once a second, publishing the metrics on http://localhost:1234/metrics. NB! The quick start example only exposes metrics on the http://localhost URL. To access the metrics endpoint from other systems you need to remove the hostname argument and, on Windows, configure HTTP listener permissions. For more information, see Publishing via standalone HTTP handler for configuration instructions or consider using ASP.NET Core exporter middleware which requires no extra configuration.
Initialize some metrics and start updating their values.
Publish the collected metrics over HTTP.
Configure the Prometheus server to poll your app for metrics on regular intervals.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page