File tree Expand file tree Collapse file tree 4 files changed +6
-2
lines changed
Filter options
Sample.Console.DotNetMeters Expand file tree Collapse file tree 4 files changed +6
-2
lines changed
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ int MeasureSandLevel()
75
75
highCardinalityCounter1 . Add ( Random . Shared . Next ( 10_000_000 ) , new KeyValuePair < string , object ? > ( "connection-id" , connection ) ) ;
76
76
77
77
// Maybe some connection went away, maybe some was added.
78
+ // Timeseries that stop receiving updates will disappear from prometheus-net output after a short delay (up to 10 minutes by default).
78
79
if ( Random . Shared . Next ( 100 ) == 0 )
79
80
{
80
81
activeConnections . RemoveAt ( Random . Shared . Next ( activeConnections . Count ) ) ;
Original file line number Diff line number Diff line change 9
9
Metrics . SuppressDefaultMetrics ( new SuppressDefaultMetricOptions
10
10
{
11
11
SuppressProcessMetrics = true ,
12
- SuppressEventCounters = true
12
+ SuppressEventCounters = true ,
13
+ SuppressDebugMetrics = true
13
14
} ) ;
14
15
15
16
// Example of static labels that conflict with .NET Meters API labels ("Bytes considered" histogram).
23
24
using var server = new KestrelMetricServer ( port : 1234 ) ;
24
25
server . Start ( ) ;
25
26
26
- // Start publishing sample data via .NET Meters API. Data from this API is published by default by prometheus-net .
27
+ // Start publishing sample data via .NET Meters API. All data from the .NET Meters API is published by default.
27
28
CustomDotNetMeters . PublishSampleData ( ) ;
28
29
29
30
// Metrics published in this sample:
Original file line number Diff line number Diff line change 27
27
// * built-in process metrics giving basic information about the .NET runtime (enabled by default)
28
28
// * metrics from .NET Event Counters (enabled by default, updated every 10 seconds)
29
29
// * metrics from .NET Meters (enabled by default)
30
+ // * prometheus-net self-inspection metrics that indicate number of registered metrics/timeseries (enabled by default)
30
31
// * the custom sample counter defined above
31
32
Console . WriteLine ( "Open http://localhost:1234/metrics in a web browser." ) ;
32
33
Console . WriteLine ( "Press enter to exit." ) ;
Original file line number Diff line number Diff line change 30
30
// * built-in process metrics giving basic information about the .NET runtime (enabled by default)
31
31
// * metrics from .NET Event Counters (enabled by default, updated every 10 seconds)
32
32
// * metrics from .NET Meters (enabled by default)
33
+ // * prometheus-net self-inspection metrics that indicate number of registered metrics/timeseries (enabled by default)
33
34
// * metrics about HTTP requests handled by the web app (configured above)
34
35
// * metrics about gRPC requests handled by the web app (configured above)
35
36
app . MapMetrics ( ) ;
You can’t perform that action at this time.
0 commit comments