Skip to content

Commit ff2d740

Browse files
add dotnet-counters example for custom meter (#30453)
1 parent a4db169 commit ff2d740

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

aspnetcore/log-mon/metrics/metrics.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,25 @@ Inject the metrics type and record values where needed. Because the metrics type
132132

133133
:::code language="csharp" source="~/log-mon/metrics/metrics/samples/custom-metrics/Program.cs" id="snippet_InjectAndUseMetrics":::
134134

135+
To monitor the "Contoso.Web" meter, use the following [dotnet-counters](/dotnet/core/diagnostics/dotnet-counters) command.
136+
137+
```dotnetcli
138+
dotnet-counters monitor -n WebMetric --counters Contoso.Web
139+
```
140+
141+
Output similar to the following is displayed:
142+
143+
144+
```dotnetcli
145+
Press p to pause, r to resume, q to quit.
146+
Status: Running
147+
148+
[Contoso.Web]
149+
contoso.product.sold (Count / 1 sec)
150+
contoso.product.name=Eggs 12
151+
contoso.product.name=Milk 0
152+
```
153+
135154
## View metrics in Grafana with OpenTelemetry and Prometheus
136155

137156
### Overview

0 commit comments

Comments
 (0)