Comments (2)
By default, recent prometheus-net versions will export metrics published via the .NET Meters API. .NET 8 added many new built-in metrics and I expect future versions of .NET will also add more that will become visible via this adapter. If you do not want these metrics to be exported, you can indeed use Metrics.SuppressDefaultMetrics()
. This also has an overload that takes a SuppressDefaultMetricOptions
for more fine-grained control.
Alternatively, if you wish to keep the .NET Meters API metrics, you can fine-tune their export (and filter out instruments you do not want) by calling Metrics.ConfigureMeterAdapter()
.
Is this enabled by default? Surely if metrics are removed between scrapes there's a chance that some incremented values will be lost? If this is on by default, can it be turned off.
Yes, metrics exposed via the .NET Meters API by default expire after 5 minutes since there is no functionality in the .NET Meters API to say that a timeseries has gone away, which risks garbage building up in memory (as many client apps create unique metrics per request/session or similar business objects, which would stick around forever without this expiration). This only affects the .NET Meters API adapter.
Indeed, there is a risk here that rarely updated metrics will be lost - the assumption is that an active app will be publishing values at a regular rate. If you have an app that publishes metrics rarely via the .NET Meters API, increasing the timeout may be appropriate.
You can configure this timeout via Metrics.ConfigureMeterAdapter()
. See MeterAdapterOptions for a list of all the possible configuration options.
from prometheus-net.
@sandersaares thanks so much for the detailed response, that really helps point me in the right direction, I'm sure I'll be able to configure the metrics I'm needing based on what you've outlined.
Thanks again.
from prometheus-net.
Related Issues (20)
- SignalR active connections meters metric not working.
- After upgrade to .Net 8 Debug window shows a lot of errors HOT 2
- Basic Auth of a Metric Server
- Prometheus.ITimer vs System.Threading.ITimer in .NET8 HOT 2
- Capturing response metrics in HttpResponse.OnStarting
- AddBeforeCollectCallback with ScrapeFailedException not working in .Net8 HOT 1
- Metrics reporting failing after update to v8.x HOT 7
- a2c1c8f99fd61969e09c32a13a23f969b14216c2
- Exemplars and trace sampling HOT 3
- "Collection was modified" in CollectAndSerializeAsync() HOT 4
- Am I using the correct library? HOT 4
- Grpc Error metrics
- Allow for changing the default NewExemplarMinInterval
- Adding Application Name label to All Metrics
- .net 6.0 support for 8.2.1
- Access code pre version 2.0.0
- Where to get the updated Grafana dashboard?
- Remove polyfill package
- Prometheus.DiagnosticSourceAdapter missing in .NET Framework build HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prometheus-net.