This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/spring-webmvc-6.0.md.

Spring WebMVC

OpenTelemetry Java agent instrumentation

This instrumentation enriches HTTP server spans with route information for Spring WebMVC 6.0+. It also enables controller spans (controller spans are disabled by default) and view spans (view spans are disabled by default).

  • Name: spring-webmvc-6.0
  • Scope: io.opentelemetry.spring-webmvc-6.0
  • Target versions: org.springframework:spring-webmvc:[6.0.0,)
  • Library: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/mvc/package-summary.html

Telemetry

  • Span attributes: code.function, code.namespace, spring-webmvc.view.type

Configuration

OptionTypeDefaultDescription
otel.instrumentation.common.experimental.controller-telemetry.enabledbooleanfalseEnables the creation of experimental controller spans.
otel.instrumentation.common.experimental.view-telemetry.enabledbooleanfalseEnables the creation of experimental view spans.
otel.instrumentation.spring-webmvc.experimental-span-attributesbooleanfalseEnables the capture of experimental span attributes spring-webmvc.view.name and spring-webmvc.view.type.

Data

  • JSON: /data/javaagent/instrumentations/spring-webmvc-6.0/spring-webmvc-6.0-1bf00aabf937.json
  • Explore: /java-agent/instrumentation/spring-webmvc-6.0