You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/java-in-process-agent.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -335,18 +335,27 @@ Application Insights Java 3.x is already listening for telemetry that's sent to
335
335
</dependency>
336
336
```
337
337
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:
339
339
340
340
```java
341
-
static final Counter counter = Metrics.counter("test_counter");
341
+
static final Counter counter = Metrics.counter("test.counter");
342
342
```
343
343
344
-
1. Use the counter to record metrics:
344
+
3. Use the counter to record metrics:
345
345
346
346
```java
347
347
counter.increment();
348
348
```
349
349
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
+
350
359
### Send custom traces and exceptions by using your favorite logging framework
351
360
352
361
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