-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jvm-observ-lib: Add java_micrometer_with_suffixes option #1351
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,8 @@ Supports the following sources: | |
- `prometheus` (https://prometheus.github.io/client_java/instrumentation/jvm/#jvm-memory-metrics). This also works for jmx_exporter (javaagent mode) starting from 1.0.1 release. | ||
- `otel` (https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/jmx-metrics/docs/target-systems/jvm.md) | ||
- `otel_with_suffixes` same as otel with add_metric_suffixes=true in otelcollector | ||
- `java_micrometer` (springboot) (https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/JvmMemoryMetrics.java) | ||
- `java_micrometer` (springboot) (https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/JvmMemoryMetrics.java). Can be seen when Micrometer to OTEL bridge is used. | ||
- `java_micrometer_with_suffixes` (springboot) same, but with prometheus suffixes | ||
- `prometheus_old` client_java instrumentation prior to 1.0.0 release: (https://github.com/prometheus/client_java/releases/tag/v1.0.0-alpha-4). This also works for jmx_exporter (javaagent mode) prior to 1.0.1 release. | ||
- `jmx_exporter`. Works with jmx_exporter (both http and javaagent modes) and the folllowing snippet: | ||
|
||
|
@@ -45,7 +46,7 @@ local jvm = | |
uid: 'jvm-sample', | ||
dashboardNamePrefix: 'JVM', | ||
dashboardTags: ['java', 'jvm'], | ||
metricsSource: 'java_micrometer', // or java_otel, prometheus, | ||
metricsSource: 'java_micrometer_with_suffixes', // or java_otel, prometheus, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above comment, where at first read it can be confusing what exactly the source is here. Additionally would be good to mention the otel bridge option |
||
} | ||
); | ||
jvm.asMonitoringMixin() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ local processlib = import 'process-observ-lib/main.libsonnet'; | |
filteringSelector: this.config.filteringSelector, | ||
groupLabels: this.config.groupLabels, | ||
instanceLabels: this.config.instanceLabels, | ||
uid: this.config.uid, | ||
uid: this.config.uid - '-jvm', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't this be a breaking change for any customer bookmarks etc? |
||
dashboardNamePrefix: this.config.dashboardNamePrefix, | ||
dashboardTags: this.config.dashboardTags, | ||
metricsSource: | ||
|
@@ -25,6 +25,7 @@ local processlib = import 'process-observ-lib/main.libsonnet'; | |
+ (if std.member(this.config.metricsSource, 'prometheus') then ['prometheus'] else []) | ||
+ (if std.member(this.config.metricsSource, 'jmx_exporter') then ['jmx_exporter'] else []) | ||
+ (if std.member(this.config.metricsSource, 'prometheus_old') then ['prometheus'] else []) | ||
+ (if std.member(this.config.metricsSource, 'java_micrometer_with_suffixes') then ['java_micrometer_with_suffixes'] else []) | ||
+ (if std.member(this.config.metricsSource, 'java_micrometer') then ['java_micrometer'] else []), | ||
} | ||
), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a readability perspective, could you rename this to
java_micrometer_bridge_prom
andjava_micrometer_bridge_otel
or similar? I think it'd be a fair bit cleaner