Skip to content

Commit 7e3a6c3

Browse files
author
Mateusz Rzeszutek
authored
Changelog, metrics manual instrumentation docs, and 1.3.0 pre-release changes (#421)
* Changelog, metrics manual instrumentation docs, and 1.3.0 pre-release changes * code review comments
1 parent c67a29d commit 7e3a6c3

File tree

7 files changed

+109
-32
lines changed

7 files changed

+109
-32
lines changed

CHANGELOG.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,36 @@ and this repository adheres to [Semantic Versioning](https://semver.org/spec/v2.
88

99
## Unreleased
1010

11+
## v1.3.0 - 2021-08-23
12+
1113
### General
1214

1315
- OpenTelemetry Java SDK and OpenTelemetry Instrumentation for Java dependencies have been updated to version 1.5.0.
1416

17+
### Enhancements
18+
19+
- Middleware attributes (`middleware.name` and `middleware.version`) have been renamed
20+
to [webengine](docs/webengine-attributes.md) attributes (`webengine.name` and `webengine.version`) to follow
21+
the [OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/webengine.md)
22+
.
23+
- We have added instrumentations for [c3p0](https://www.mchange.com/projects/c3p0/)
24+
and [Vibur DBCP](https://github.com/vibur/vibur-dbcp) connection pools. The agent now collects and exports metrics for
25+
both JDBC connection pools.
26+
- We have also introduced instrumentations for [Tomcat connector](https://tomcat.apache.org/tomcat-8.5-doc/index.html)
27+
and [WebSphere Liberty web request](https://www.ibm.com/docs/en/was-liberty/base?topic=10-threadpool-monitoring)
28+
thread pools. The agent now collects and exports metrics for these application server thread pools.
29+
- This release introduces the Micrometer bridge instrumentation. You can now use the Micrometer API inside your
30+
application to manually define custom metrics and the javaagent will export them.
31+
See [the documentation](docs/metrics.md) for more details.
32+
- The `splunk.metrics.export.interval` configuration property will now allow specifying time units; and if no units are
33+
specified then the value is treated as number of milliseconds. For example `30s` means "30 seconds" and is equivalent
34+
to `30000`.
35+
- This release also introduces
36+
the [muzzle](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/muzzle.md)
37+
safety checks to all Splunk instrumentations. Our instrumentations now offer exactly the same level
38+
of [safety](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/safety-mechanisms.md)
39+
as the upstream OpenTelemetry instrumentations.
40+
1541
## v1.2.0 - 2021-07-26
1642

1743
### General
@@ -21,9 +47,12 @@ and this repository adheres to [Semantic Versioning](https://semver.org/spec/v2.
2147
### Enhancements
2248

2349
- We have added instrumentation for [HikariCP](https://github.com/brettwooldridge/HikariCP)
24-
and [Tomcat JDBC](https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html) connection pools. The agent now
25-
collects and exports metrics for both JDBC connection pools.
26-
- You can now set the service name using the `OTEL_SERVICE_NAME` environment variable and the `otel.service.name` system property. This removes the need of using `OTEL_RESOURCE_ATTRIBUTES` to set the service name.
50+
and [Tomcat JDBC](https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html) connection pools. The agent now collects
51+
and exports metrics for both JDBC connection pools.
52+
- You can now set the service name using the `OTEL_SERVICE_NAME` environment variable and the `otel.service.name` system
53+
property (see
54+
the [OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration)
55+
. This removes the need of using `OTEL_RESOURCE_ATTRIBUTES` to set the service name.
2756

2857
## v1.1.0 - 2021-06-18
2958

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@
1212

1313
<p align="center">
1414
<img alt="Stable" src="https://img.shields.io/badge/status-stable-informational?style=for-the-badge">
15-
<a href="https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.4.0">
16-
<img alt="OpenTelemetry Instrumentation for Java Version" src="https://img.shields.io/badge/otel-1.4.0-blueviolet?style=for-the-badge">
15+
<a href="https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.5.0">
16+
<img alt="OpenTelemetry Instrumentation for Java Version" src="https://img.shields.io/badge/otel-1.5.0-blueviolet?style=for-the-badge">
1717
</a>
1818
<a href="https://github.com/signalfx/gdi-specification/releases/tag/v1.0.0">
1919
<img alt="Splunk GDI specification" src="https://img.shields.io/badge/GDI-1.0.0-blueviolet?style=for-the-badge">
2020
</a>
2121
<a href="https://github.com/signalfx/splunk-otel-java/releases">
2222
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/signalfx/splunk-otel-java?include_prereleases&style=for-the-badge">
2323
</a>
24+
<a href="https://maven-badges.herokuapp.com/maven-central/com.splunk/splunk-otel-javaagent">
25+
<img alt="Maven Central" src="https://img.shields.io/maven-central/v/com.splunk/splunk-otel-javaagent?style=for-the-badge">
26+
</a>
2427
<a href="https://github.com/signalfx/splunk-otel-java/actions?query=workflow%3A%22CI+build%22">
2528
<img alt="Build Status" src="https://img.shields.io/github/workflow/status/signalfx/splunk-otel-java/CI%20build?style=for-the-badge">
2629
</a>
@@ -44,11 +47,6 @@
4447

4548
<!-- Comments, spacing, empty and new lines in the section below are intentional, please do not modify them! -->
4649
<!--DEV_DOCS_WARNING-->
47-
<!--DEV_DOCS_WARNING_START-->
48-
The documentation below refers to the in development version of this package. Docs for the latest version ([v1.2.0](https://github.com/signalfx/splunk-otel-java/releases/tag/v1.2.0)) can be found [here](https://github.com/signalfx/splunk-otel-java/blob/v1.2.0/README.md).
49-
50-
---
51-
<!--DEV_DOCS_WARNING_END-->
5250

5351
# Splunk Distribution of OpenTelemetry Java
5452

@@ -154,16 +152,19 @@ The Splunk Distribution of OpenTelemetry Java provides a way to correlate traces
154152

155153
Documentation on how to manually instrument a Java application is available in the
156154
[OpenTelemetry official documentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/manual-instrumentation.md).
155+
To learn how to add custom metrics to your application please consult [our docs](docs/metrics.md#manual-instrumentation)
156+
.
157157

158158
To extend the instrumentation with the OpenTelemetry Instrumentation for Java,
159159
you have to use a compatible API version.
160160

161161
<!-- IMPORTANT: do not change comments or break those lines below -->
162-
The Splunk Distribution of OpenTelemetry Java version <!--SPLUNK_VERSION-->1.2.0<!--SPLUNK_VERSION--> is compatible
162+
The Splunk Distribution of OpenTelemetry Java version <!--SPLUNK_VERSION-->1.3.0<!--SPLUNK_VERSION--> is compatible
163163
with:
164164

165-
* OpenTelemetry API version <!--OTEL_VERSION-->1.4.1<!--OTEL_VERSION-->
166-
* OpenTelemetry Instrumentation for Java version <!--OTEL_INSTRUMENTATION_VERSION-->1.4.0<!--OTEL_INSTRUMENTATION_VERSION-->
165+
* OpenTelemetry API version <!--OTEL_VERSION-->1.5.0<!--OTEL_VERSION-->
166+
* OpenTelemetry Instrumentation for Java version <!--OTEL_INSTRUMENTATION_VERSION-->1.5.0<!--OTEL_INSTRUMENTATION_VERSION-->
167+
* Micrometer version 1.7.3
167168

168169
## Snapshot builds
169170

buildSrc/src/main/kotlin/splunk.java-conventions.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ val otelVersion = "1.5.0"
1717
val otelAlphaVersion = "1.5.0-alpha"
1818
val otelInstrumentationVersion = "1.5.0"
1919
val otelInstrumentationAlphaVersion = "1.5.0-alpha"
20+
val micrometerVersion = "1.7.3";
2021

2122
// dependencyManagement can't into classifiers, we have to pass version the old way for deps with qualifiers
2223
extra["otelInstrumentationVersion"] = otelInstrumentationVersion
@@ -73,7 +74,7 @@ extensions.configure<DependencyManagementExtension>("dependencyManagement") {
7374

7475
imports {
7576
mavenBom("io.grpc:grpc-bom:1.38.0")
76-
mavenBom("io.micrometer:micrometer-bom:1.7.3")
77+
mavenBom("io.micrometer:micrometer-bom:${micrometerVersion}")
7778
mavenBom("io.opentelemetry:opentelemetry-bom-alpha:${otelAlphaVersion}")
7879
mavenBom("io.opentelemetry:opentelemetry-bom:${otelVersion}")
7980
mavenBom("org.junit:junit-bom:5.7.2")

deployments/cloudfoundry/buildpack/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If you want to use a specific version of the Java agent in your application, you
4040
environment variable before application deployment, either using `cf set-env` or the `manifest.yml` file:
4141

4242
```sh
43-
$ cf set-env SPLUNK_OTEL_JAVA_VERSION 1.2.0
43+
$ cf set-env SPLUNK_OTEL_JAVA_VERSION 1.3.0
4444
```
4545

4646
By default, the [latest](https://github.com/signalfx/splunk-otel-java/releases/latest) available agent version is used.

docs/faq.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22
33
# Frequently Asked Questions
44

5-
- **Can upstream opentelemetry-java or opentelemetry-java-instrumentation be
6-
used instead?** Definitely, however Splunk only provides best-effort support.
7-
- **What’s different between Splunk Distribution of OpenTelemetry Java and
8-
OpenTelemetry Instrumentation for Java?** Supported by Splunk, better defaults
9-
for Splunk products, access to other open-source projects including
10-
Micrometer. Note, we take an upstream-first approach, Splunk Distribution of
11-
OpenTelemetry Java allow us to move fast.
12-
- **Why don't you publish the javaagent jar to a Maven repository?** It would
13-
make it very easy to accidentally put the agent on the application runtime
14-
classpath, which may cause all sorts of problems and confusion - and the
15-
agent won't work anyway, because it has to be passed in the `-javaagent` JVM
16-
parameter.
17-
- **How often do you release?** We strive to release the Splunk distribution
18-
within 2 working days after the [upstream
19-
project](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases)
5+
- **Can upstream opentelemetry-java or opentelemetry-java-instrumentation be used instead?** Definitely, however Splunk
6+
only provides best-effort support.
7+
- **What’s different between Splunk Distribution of OpenTelemetry Java and OpenTelemetry Instrumentation for Java?**
8+
Supported by Splunk, better defaults for Splunk products, access to other open-source projects including Micrometer.
9+
Note, we take an upstream-first approach, Splunk Distribution of OpenTelemetry Java allow us to move fast.
10+
- **Should I add the agent as a Maven/Gradle dependency to my application?** No, you definitely shouldn't! The agent
11+
will not function at all if it's just added to the classpath; it should never be added to the runtime classpath
12+
directly. The only way to instrument the application automatically with the agent is to use the `-javaagent` command
13+
line parameter.
14+
- **How often do you release?** We strive to release the Splunk distribution within 2 working days after
15+
the [upstream project](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases)
2016
releases. OpenTelemetry Java generally releases a new version every 4 weeks.

docs/metrics.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,63 @@ The following dimensions are automatically added to all metrics exported by the
2222
| `process.pid` | The Java process identifier (PID).
2323
| `service` | The value of the `service.name` resource attribute.
2424

25+
## Manual instrumentation
26+
27+
The Splunk Distribution of OpenTelemetry Java agent detects if the instrumented application is using Micrometer and
28+
injects a special `MeterRegistry` implementation that allows the agent to pick up custom user-defined meters, as long as
29+
they're registered in the global `Metrics.globalRegistry` instance provided by the Micrometer library.
30+
31+
### Dependencies
32+
33+
You'll need to add a dependency on the `micrometer-core` library to be able to export custom metrics with the javaagent.
34+
35+
For Maven users:
36+
37+
```xml
38+
39+
<dependency>
40+
<groupId>io.micrometer</groupId>
41+
<artifactId>micrometer-core</artifactId>
42+
<version>1.7.3</version>
43+
</dependency>
44+
```
45+
46+
For Gradle users:
47+
48+
```kotlin
49+
implementation("io.micrometer:micrometer-core:1.7.3")
50+
```
51+
52+
### Adding custom metrics
53+
54+
You can use one of meter factory methods provided by the `Metrics` class, or use meter builders and refer to
55+
the `Metrics.globalRegistry` directly:
56+
57+
```java
58+
class MyClass {
59+
Counter myCounter = Metrics.counter("my_custom_counter");
60+
Timer myTimer = Timer.builder("my_custom_timer").register(Metrics.globalRegistry);
61+
62+
int foo() {
63+
myCounter.increment();
64+
return myTimer.record(this::fooImpl);
65+
}
66+
67+
private int fooImpl() {
68+
// ...
69+
}
70+
}
71+
```
72+
73+
For more details on using the Micrometer API please consult the [Micrometer docs](ohttps://micrometer.io/docs/concepts).
74+
2575
## Supported libraries
2676

2777
The following metrics are currently gathered by the agent:
2878

2979
| Library/Framework | Instrumentation name | Versions |
3080
| ---------------------------------------------------------------- | -------------------- | -------- |
31-
| [JVM metrics](#jvm) | `jvm-metrics` | [Java runtimes version 8 and higher](../README.md#supported-java-versions)
81+
| [JVM metrics](#jvm) | `jvm-metrics` | [Java runtimes version 8 and higher](../README.md#requirements)
3282
| [Apache DBCP2 connection pool metrics](#connection-pool-metrics) | `commons-dbcp2` | 2.0 and higher
3383
| [c3p0 connection pool metrics](#connection-pool-metrics) | `c3p0` | 0.9.5 and higher
3484
| [HikariCP connection pool metrics](#connection-pool-metrics) | `hikaricp` | 3.0 and higher

docs/supported-libraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ them [here](https://github.com/open-telemetry/opentelemetry-java-instrumentation
88
Aside from the instrumentations listed in the link above, the Splunk Distribution of OpenTelemetry Java provides a few
99
additional custom features:
1010

11-
* We instrument [several HTTP server frameworks](server-trace-info.md#supported-frameworks-and-libraries)
11+
* We instrument [several HTTP server frameworks](server-trace-info.md#frameworks-and-libraries)
1212
and return server trace information in the HTTP response;
1313
* We collect information about [application servers](webengine-attributes.md) that are being used and store it in
1414
server span attributes;

0 commit comments

Comments
 (0)