Skip to content

Commit

Permalink
Add documentation on the OTel Spring Boot starter (#3377)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrice Chalin <[email protected]>
Co-authored-by: svrnm <[email protected]>
  • Loading branch information
3 people authored Nov 14, 2023
1 parent 1b54090 commit 2b18b55
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
58 changes: 58 additions & 0 deletions content/en/docs/instrumentation/java/automatic/spring-boot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Spring Boot
linkTitle: Spring Boot
weight: 30
description: Spring instrumentation for OpenTelemetry Java
cSpell:ignore: autoconfigure springboot
---

You can use the [OpenTelemetry Java agent](..) with byte code instrumentation to
automatically instrument a [Spring Boot](https://spring.io/projects/spring-boot)
application; or you can also use the OpenTelemetry [Spring Boot starter] to
instrument your application.

[Spring Boot starter]:
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using.build-systems.starters

The OpenTelemetry starter is compatible with Spring Boot 2.0 and 3.0, and Spring
native.

## Configuration

Add the dependency given below to enable the OpenTelemetry starter.

The OpenTelemetry starter uses OpenTelemetry Spring Boot [auto-configuration].
For details concerning supported libraries and features of the OpenTelemetry
auto-configuration, see the configuration [README].

[auto-configuration]:
https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.auto-configuration
[README]:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/spring/spring-boot-autoconfigure/README.md#features

{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}}

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-spring-boot-starter</artifactId>
<version>{{% param vers.instrumentation %}}</version>
</dependency>
</dependencies>
```

{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}}

```groovy
dependencies {
implementation('io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter:{{% param vers.instrumentation %}}')
}
```

{{% /tab %}} {{< /tabpane>}}

## Additional instrumentations

You can configure additional instrumentations with
[OpenTelemetry instrumentations libraries](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md#libraries--frameworks).
12 changes: 12 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,14 @@
"StatusCode": 200,
"LastSeen": "2023-07-26T16:17:33.996008+02:00"
},
"https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.auto-configuration": {
"StatusCode": 206,
"LastSeen": "2023-11-14T09:30:48.194902-05:00"
},
"https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using.build-systems.starters": {
"StatusCode": 200,
"LastSeen": "2023-11-14T09:30:42.69906-05:00"
},
"https://docs.teletrace.io/": {
"StatusCode": 206,
"LastSeen": "2023-06-30T09:15:08.305928-04:00"
Expand Down Expand Up @@ -5391,6 +5399,10 @@
"StatusCode": 200,
"LastSeen": "2023-06-30T11:44:31.406627-04:00"
},
"https://spring.io/projects/spring-boot": {
"StatusCode": 200,
"LastSeen": "2023-11-14T09:30:36.981189-05:00"
},
"https://square.github.io/okhttp/": {
"StatusCode": 206,
"LastSeen": "2023-09-14T09:36:37.578867-05:00"
Expand Down

0 comments on commit 2b18b55

Please sign in to comment.