Skip to content

Commit

Permalink
Rename runtime-metrics to runtime-telemetry (#8715)
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
  • Loading branch information
trask and Mateusz Rzeszutek authored Jun 14, 2023
1 parent 80306b8 commit 39f4891
Show file tree
Hide file tree
Showing 70 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion docs/supported-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ These are the supported libraries and frameworks:
| [Java Executors](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executor.html) | Java 8+ | N/A | Context propagation |
| [Java Http Client](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/package-summary.html) | Java 11+ | [opentelemetry-java-http-client](../instrumentation/java-http-client/library) | [HTTP Client Spans], [HTTP Client Metrics] |
| [java.util.logging](https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html) | Java 8+ | N/A | none |
| [Java Platform](https://docs.oracle.com/javase/8/docs/api/java/lang/management/ManagementFactory.html) | Java 8+ | [opentelemetry-runtime-metrics-java8](../instrumentation/runtime-metrics/runtime-metrics-java8/library),[opentelemetry-runtime-metrics-java17](../instrumentation/runtime-metrics/runtime-metrics-java17/library),<br>[opentelemetry-resources](../instrumentation/resources/library) | [JVM Runtime Metrics] |
| [Java Platform](https://docs.oracle.com/javase/8/docs/api/java/lang/management/ManagementFactory.html) | Java 8+ | [opentelemetry-runtime-telemetry-java8](../instrumentation/runtime-telemetry/runtime-telemetry-java8/library),[opentelemetry-runtime-telemetry-java17](../instrumentation/runtime-telemetry/runtime-telemetry-java17/library),<br>[opentelemetry-resources](../instrumentation/resources/library) | [JVM Runtime Metrics] |
| [JAX-RS](https://javaee.github.io/javaee-spec/javadocs/javax/ws/rs/package-summary.html) | 0.5+ | N/A | Provides `http.route` [2], Controller Spans [3] |
| [JAX-RS Client](https://javaee.github.io/javaee-spec/javadocs/javax/ws/rs/client/package-summary.html) | 1.1+ | N/A | [HTTP Client Spans], [HTTP Client Metrics] |
| [JAX-WS](https://jakarta.ee/specifications/xml-web-services/2.3/apidocs/javax/xml/ws/package-summary.html) | 2.0+ (not including 3.x yet) | N/A | Provides `http.route` [2], Controller Spans [3] |
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/jmx-metrics/javaagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To control the time interval between MBean detection attempts, one can use the `

## Predefined metrics

JMX is a popular metrics technology used throughout the JVM (see [runtime metrics](../../runtime-metrics/runtime-metrics-java8/library/README.md)), application servers, third-party libraries, and applications.
JMX is a popular metrics technology used throughout the JVM (see [runtime metrics](../../runtime-telemetry/runtime-telemetry-java8/library/README.md)), application servers, third-party libraries, and applications.
JMX Metric Insight comes with a number of predefined configurations containing curated sets of JMX metrics for frequently used application servers or frameworks.
To enable collection of the predefined metrics, specify a list of targets as the value for the `otel.jmx.target.system` property. For example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ otelJava {
}

dependencies {
implementation(project(":instrumentation:runtime-metrics:runtime-metrics-java17:library"))
implementation(project(":instrumentation:runtime-telemetry:runtime-telemetry-java17:library"))
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
}

tasks {
test {
jvmArgs("-Dotel.instrumentation.runtime-metrics-java17.enabled=true")
jvmArgs("-Dotel.instrumentation.runtime-telemetry-java17.enabled=true")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ public void afterAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredSdk) {
RuntimeMetrics runtimeMetrics = null;
/*
By default don't use any JFR metrics. May change this once semantic conventions are updated.
If enabled, default to only the metrics not already covered by runtime-metrics-java8
If enabled, default to only the metrics not already covered by runtime-telemetry-java8
*/
boolean defaultEnabled = config.getBoolean("otel.instrumentation.common.default-enabled", true);
if (config.getBoolean("otel.instrumentation.runtime-metrics-java17.enable-all", false)) {
if (config.getBoolean("otel.instrumentation.runtime-telemetry-java17.enable-all", false)) {
runtimeMetrics = RuntimeMetrics.builder(openTelemetry).enableAllFeatures().build();
} else if (config.getBoolean("otel.instrumentation.runtime-metrics-java17.enabled", false)) {
} else if (config.getBoolean("otel.instrumentation.runtime-telemetry-java17.enabled", false)) {
runtimeMetrics = RuntimeMetrics.create(openTelemetry);
} else if (config.getBoolean("otel.instrumentation.runtime-metrics.enabled", defaultEnabled)) {
} else if (config.getBoolean(
"otel.instrumentation.runtime-telemetry.enabled", defaultEnabled)) {
// This only uses metrics gathered by JMX
runtimeMetrics = RuntimeMetrics.builder(openTelemetry).disableAllFeatures().build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ otelJava {
}

dependencies {
implementation(project(":instrumentation:runtime-metrics:runtime-metrics-java8:library"))
implementation(project(":instrumentation:runtime-telemetry:runtime-telemetry-java8:library"))
testImplementation("io.github.netmikey.logunit:logunit-jul:1.1.3")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import javax.annotation.Nullable;

final class HandlerRegistry {
private static final String SCOPE_NAME = "io.opentelemetry.runtime-metrics-java17";
private static final String SCOPE_NAME = "io.opentelemetry.runtime-telemetry-java17";

@Nullable
private static final String SCOPE_VERSION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* Enumeration of JFR features, which can be toggled on or off via {@link RuntimeMetricsBuilder}.
*
* <p>Features are disabled by default if they are already available through {@code
* io.opentelemetry.instrumentation:opentelemetry-runtime-metrics-java8} JMX based instrumentation.
* io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java8} JMX based
* instrumentation.
*/
public enum JfrFeature {
BUFFER_METRICS(/* defaultEnabled= */ false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void create_Default() {
.allSatisfy(
metric -> {
assertThat(metric.getInstrumentationScopeInfo().getName())
.contains("io.opentelemetry.runtime-metrics-java");
.contains("io.opentelemetry.runtime-telemetry-java");
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
implementation(project(":instrumentation:runtime-metrics:runtime-metrics-java8:library"))
implementation(project(":instrumentation:runtime-telemetry:runtime-telemetry-java8:library"))

compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void afterAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredSdk) {
ConfigProperties config = autoConfiguredSdk.getConfig();

boolean defaultEnabled = config.getBoolean("otel.instrumentation.common.default-enabled", true);
if (!config.getBoolean("otel.instrumentation.runtime-metrics.enabled", defaultEnabled)
if (!config.getBoolean("otel.instrumentation.runtime-telemetry.enabled", defaultEnabled)
|| Double.parseDouble(System.getProperty("java.specification.version")) >= 17) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ This module provides JVM runtime metrics as documented in the [semantic conventi
### Add these dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest
release](https://search.maven.org/search?q=g:io.opentelemetry.instrumentation%20AND%20a:opentelemetry-runtime-metrics-java8).
release](https://search.maven.org/search?q=g:io.opentelemetry.instrumentation%20AND%20a:opentelemetry-runtime-telemetry-java8).

For Maven, add to your `pom.xml` dependencies:

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-runtime-metrics-java8</artifactId>
<artifactId>opentelemetry-runtime-telemetry-java8</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
Expand All @@ -24,7 +24,7 @@ For Maven, add to your `pom.xml` dependencies:
For Gradle, add to your dependencies:

```groovy
runtimeOnly("io.opentelemetry.instrumentation:opentelemetry-runtime-metrics-java8:OPENTELEMETRY_VERSION")
runtimeOnly("io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java8:OPENTELEMETRY_VERSION")
```

### Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
public class JmxRuntimeMetricsUtil {

private static final String INSTRUMENTATION_NAME = "io.opentelemetry.runtime-metrics-java8";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.runtime-telemetry-java8";

@Nullable
private static final String INSTRUMENTATION_VERSION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void registerObservers() {
BufferPools.registerObservers(testing.getOpenTelemetry(), beans);

testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.buffer.usage",
metrics ->
metrics.anySatisfy(
Expand All @@ -75,7 +75,7 @@ void registerObservers() {
AttributeKey.stringKey("pool"),
"buffer_pool_1")))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.buffer.limit",
metrics ->
metrics.anySatisfy(
Expand All @@ -94,7 +94,7 @@ void registerObservers() {
AttributeKey.stringKey("pool"),
"buffer_pool_1")))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.buffer.count",
metrics ->
metrics.anySatisfy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void registerObservers() {
Classes.INSTANCE.registerObservers(testing.getOpenTelemetry(), classBean);

testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.classes.loaded",
metrics ->
metrics.anySatisfy(
Expand All @@ -52,7 +52,7 @@ void registerObservers() {
point ->
point.hasValue(3).hasAttributes(Attributes.empty())))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.classes.unloaded",
metrics ->
metrics.anySatisfy(
Expand All @@ -68,7 +68,7 @@ void registerObservers() {
point ->
point.hasValue(2).hasAttributes(Attributes.empty())))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.classes.current_loaded",
metrics ->
metrics.anySatisfy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void registerObservers() {
testing.getOpenTelemetry(), osBean, systemCpuUsage, processCpuUsage);

testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.system.cpu.load_1m",
metrics ->
metrics.anySatisfy(
Expand All @@ -49,7 +49,7 @@ void registerObservers() {
.hasDoubleGaugeSatisfying(
gauge -> gauge.hasPointsSatisfying(point -> point.hasValue(2.2)))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.system.cpu.utilization",
metrics ->
metrics.anySatisfy(
Expand All @@ -61,7 +61,7 @@ void registerObservers() {
.hasDoubleGaugeSatisfying(
gauge -> gauge.hasPointsSatisfying(point -> point.hasValue(0.11)))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.cpu.utilization",
metrics ->
metrics.anySatisfy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void registerObservers() {
createTestNotification("G1 Old Generation", "end of major GC", 11), null);

testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.gc.duration",
metrics ->
metrics.anySatisfy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void registerObservers() {
MemoryPools.registerObservers(testing.getOpenTelemetry(), beans);

testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.memory.init",
metrics ->
metrics.anySatisfy(
Expand All @@ -109,7 +109,7 @@ void registerObservers() {
.hasAttribute(
AttributeKey.stringKey("type"), "non_heap")))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.memory.usage",
metrics ->
metrics.anySatisfy(
Expand All @@ -135,7 +135,7 @@ void registerObservers() {
.hasAttribute(
AttributeKey.stringKey("type"), "non_heap")))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.memory.committed",
metrics ->
metrics.anySatisfy(
Expand All @@ -161,7 +161,7 @@ void registerObservers() {
.hasAttribute(
AttributeKey.stringKey("type"), "non_heap")))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.memory.limit",
metrics ->
metrics.anySatisfy(
Expand All @@ -187,7 +187,7 @@ void registerObservers() {
.hasAttribute(
AttributeKey.stringKey("type"), "non_heap")))));
testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.memory.usage_after_last_gc",
metrics ->
metrics.anySatisfy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import javax.annotation.Nullable;

class ScopeUtil {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.runtime-metrics-java8";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.runtime-telemetry-java8";

@Nullable
private static final String INSTRUMENTATION_VERSION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void registerObservers() {
Threads.INSTANCE.registerObservers(testing.getOpenTelemetry(), threadBean);

testing.waitAndAssertMetrics(
"io.opentelemetry.runtime-metrics-java8",
"io.opentelemetry.runtime-telemetry-java8",
"process.runtime.jvm.threads.count",
metrics ->
metrics.anySatisfy(
Expand Down
8 changes: 4 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ hideFromDependabot(":instrumentation:rocketmq:rocketmq-client:rocketmq-client-4.
hideFromDependabot(":instrumentation:rocketmq:rocketmq-client:rocketmq-client-4.8:testing")
hideFromDependabot(":instrumentation:rocketmq:rocketmq-client:rocketmq-client-5.0:javaagent")
hideFromDependabot(":instrumentation:rocketmq:rocketmq-client:rocketmq-client-5.0:testing")
hideFromDependabot(":instrumentation:runtime-metrics:runtime-metrics-java8:javaagent")
hideFromDependabot(":instrumentation:runtime-metrics:runtime-metrics-java8:library")
hideFromDependabot(":instrumentation:runtime-metrics:runtime-metrics-java17:javaagent")
hideFromDependabot(":instrumentation:runtime-metrics:runtime-metrics-java17:library")
hideFromDependabot(":instrumentation:runtime-telemetry:runtime-telemetry-java8:javaagent")
hideFromDependabot(":instrumentation:runtime-telemetry:runtime-telemetry-java8:library")
hideFromDependabot(":instrumentation:runtime-telemetry:runtime-telemetry-java17:javaagent")
hideFromDependabot(":instrumentation:runtime-telemetry:runtime-telemetry-java17:library")
hideFromDependabot(":instrumentation:rxjava:rxjava-1.0:library")
hideFromDependabot(":instrumentation:rxjava:rxjava-2.0:library")
hideFromDependabot(":instrumentation:rxjava:rxjava-2.0:testing")
Expand Down

0 comments on commit 39f4891

Please sign in to comment.