Bumps `errorProneVersion` from 2.17.0 to 2.18.0. Updates `error_prone_annotations` from 2.17.0 to 2.18.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/google/error-prone/releases">error_prone_annotations's releases</a>.</em></p> <blockquote> <h2>Error Prone 2.18.0</h2> <p>New Checkers:</p> <ul> <li><a href="https://errorprone.info/bugpattern/InjectOnBugCheckers"><code>InjectOnBugCheckers</code></a></li> <li><a href="https://errorprone.info/bugpattern/LabelledBreakTarget"><code>LabelledBreakTarget</code></a></li> <li><a href="https://errorprone.info/bugpattern/UnusedLabel"><code>UnusedLabel</code></a></li> <li><a href="https://errorprone.info/bugpattern/YodaCondition"><code>YodaCondition</code></a></li> </ul> <p>Fixes issues: <a href="https://github-redirect.dependabot.com/google/error-prone/issues/1650">#1650</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/2706">#2706</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3404">#3404</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3493">#3493</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3504">#3504</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3519">#3519</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3579">#3579</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3610">#3610</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3632">#3632</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3638">#3638</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3645">#3645</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3646">#3646</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3652">#3652</a>, <a href="https://github-redirect.dependabot.com/google/error-prone/issues/3690">#3690</a></p> <p><strong>Full Changelog</strong>: <a href="https://github.com/google/error-prone/compare/v2.17.0...v2.18.0">https://github.com/google/error-prone/compare/v2.17.0...v2.18.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
---|---|---|
.. | ||
src | ||
README.md | ||
build.gradle.kts |
README.md
Library Instrumentation for Spring Web MVC version 5.3 and higher
Provides OpenTelemetry instrumentation for Spring WebMVC controllers.
Quickstart
Add these dependencies to your project
Replace SPRING_VERSION
with the version of spring you're using.
Minimum version: 5.3
Replace OPENTELEMETRY_VERSION
with the latest
release.
For Maven add the following to your pom.xml
:
<dependencies>
<!-- OpenTelemetry instrumentation -->
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-spring-webmvc-5.3</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
<!-- OpenTelemetry exporter -->
<!-- replace this default exporter with your OpenTelemetry exporter (ex. otlp/zipkin/jaeger/..) -->
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-logging</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
<!-- required to instrument Spring WebMVC -->
<!-- this artifact should already be present in your application -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>SPRING_VERSION</version>
</dependency>
</dependencies>
For Gradle add the following to your dependencies:
// OpenTelemetry instrumentation
implementation("io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-5.3:OPENTELEMETRY_VERSION")
// OpenTelemetry exporter
// replace this default exporter with your OpenTelemetry exporter (ex. otlp/zipkin/jaeger/..)
implementation("io.opentelemetry:opentelemetry-exporter-logging:OPENTELEMETRY_VERSION")
// required to instrument Spring WebMVC
// this artifact should already be present in your application
implementation("org.springframework:spring-webmvc:SPRING_VERSION")
Features
SpringWebMvcTelemetry
SpringWebMvcTelemetry
enables creating OpenTelemetry server spans around HTTP requests processed
by the Spring servlet container.
Usage in Spring Boot
Spring Boot allows servlet Filter
s to be registered as beans:
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.spring.webmvc.v5_3.SpringWebMvcTelemetry;
import javax.servlet.Filter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SpringWebMvcTelemetryConfiguration {
@Bean
public Filter telemetryFilter(OpenTelemetry openTelemetry) {
return SpringWebMvcTelemetry.create(openTelemetry).createServletFilter();
}
}
Starter Guide
Check out OpenTelemetry Manual Instrumentation to learn more about using the OpenTelemetry API to instrument your code.