Skip to content

Commit 58eb3bb

Browse files
authored
Merge pull request #185466 from trask/micrometer
Add more details about micrometer metrics
2 parents 8d8744e + e5f976e commit 58eb3bb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

articles/azure-monitor/app/java-in-process-agent.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,18 +335,27 @@ Application Insights Java 3.x is already listening for telemetry that's sent to
335335
</dependency>
336336
```
337337

338-
1. Use the Micrometer [global registry](https://micrometer.io/docs/concepts#_global_registry) to create a meter:
338+
2. Use the Micrometer [global registry](https://micrometer.io/docs/concepts#_global_registry) to create a meter:
339339

340340
```java
341-
static final Counter counter = Metrics.counter("test_counter");
341+
static final Counter counter = Metrics.counter("test.counter");
342342
```
343343

344-
1. Use the counter to record metrics:
344+
3. Use the counter to record metrics:
345345

346346
```java
347347
counter.increment();
348348
```
349349

350+
4. The metrics will be ingested into the
351+
[customMetrics](/azure/azure-monitor/reference/tables/custommetrics) table, with tags captured in the
352+
`customDimensions` column. You can also view the metrics in the
353+
[Metrics explorer](../essentials/metrics-getting-started.md) under the "Log-based metrics" metric namespace.
354+
355+
> [!NOTE]
356+
> Application Insights Java replaces all non-alphanumeric characters (except dashes) in the Micrometer metric name
357+
> with underscores, so the `test.counter` metric above will show up as `test_counter`.
358+
350359
### Send custom traces and exceptions by using your favorite logging framework
351360

352361
Log4j, Logback, and java.util.logging are auto-instrumented. Logging performed via these logging frameworks is autocollected as trace and exception telemetry.

0 commit comments

Comments
 (0)