There are three ways to add OpenTelemetry to a Spring Boot application, and most confusion comes from mixing them. The OpenTelemetry project ships a Java agent and a Spring Boot starter. Spring Boot ships its own tracing, built on Micrometer. All three send OTLP, so any backend or Collector accepts the result.
Key takeaways
- The Java agent needs no code changes and covers the most libraries. Use a starter for GraalVM native images or when you cannot add a JVM flag.
- Spring Boot's own tracing samples 10% of requests by default. The agent and the OpenTelemetry starter sample 100%.
- Spring Boot 4.1 and later read the standard
OTEL_*environment variables. Spring Boot 3 and 4.0 needmanagement.*properties. - Pick one. The agent next to Micrometer Tracing records every request twice.
Quick start
The shortest route to a trace needs no code change: download the Java agent, set three variables, add one JVM flag.
curl -L -o opentelemetry-javaagent.jar \
https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
export OTEL_SERVICE_NAME="orders"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
export OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=production"
java -javaagent:./opentelemetry-javaagent.jar -jar target/orders.jar
Send a request and the app exports traces, metrics and logs as http/protobuf to port 4318. With no Collector yet, set OTEL_TRACES_EXPORTER=console to print spans to stdout.
Three ways to instrument Spring Boot
This section helps you pick one of the three before you install anything.
Two questions settle most cases. The table below has the details behind each branch.
| Java agent | OpenTelemetry starter | Spring Boot + Micrometer | |
|---|---|---|---|
| How you add it | -javaagent JVM flag | opentelemetry-spring-boot-starter | spring-boot-starter-opentelemetry (Boot 4) |
| Maintained by | OpenTelemetry | OpenTelemetry | Spring |
| Code changes | None | A dependency | A dependency |
| Library coverage | Widest: well over a hundred libraries and frameworks | Spring MVC, WebFlux, HTTP clients, JDBC, R2DBC, Kafka, MongoDB, Logback | What Spring instruments with the Observation API. JDBC needs an extra library. |
| Configuration | OTEL_* variables or -Dotel.* | otel.* in application.yml, or OTEL_* | management.* in application.yml; OTEL_* from Boot 4.1 |
| Default sampling | 100% | 100% | 10% |
| Logs over OTLP | Automatic | Automatic | Exporter included, you add the Logback appender |
| GraalVM native image | No | Yes | Yes |
The agent also reaches libraries the other two do not, such as the JDK HTTP client, gRPC, Redis clients and schedulers. The OpenTelemetry starter is the pick when another agent already occupies the JVM or startup time matters.
Option 1: the OpenTelemetry Java agent
The agent is a single jar that rewrites bytecode as classes load, on Java 8 and later. In a container, set JAVA_TOOL_OPTIONS="-javaagent:/opt/opentelemetry-javaagent.jar" so the entrypoint stays unchanged.
With the console exporter, one request to the test app printed this (attributes trimmed, database name shortened):
[otel.javaagent] LoggingSpanExporter - 'SELECT shop.orders' : 4bf92f3577b34da6a3ce929d0e0e4736 888a2f7b10efa275 CLIENT [tracer: io.opentelemetry.jdbc:2.34.0-alpha] {db.system=h2, db.name=shop, db.operation=SELECT, db.sql.table=orders, db.statement=select count(*) from orders where id = ?}
[otel.javaagent] LoggingSpanExporter - 'GET' : 4bf92f3577b34da6a3ce929d0e0e4736 f2e8d0a023849575 CLIENT [tracer: io.opentelemetry.java-http-client:2.34.0-alpha] {http.request.method=GET, url.full=http://localhost:8080/inventory/42, http.response.status_code=200}
[otel.javaagent] LoggingSpanExporter - 'calculate-price' : 4bf92f3577b34da6a3ce929d0e0e4736 0e27ef4e6bfff042 INTERNAL [tracer: io.opentelemetry.opentelemetry-instrumentation-annotations-1.16:2.34.0-alpha] {order.id=42, code.function=price}
[otel.javaagent] LoggingSpanExporter - 'GET /orders/{id}' : 4bf92f3577b34da6a3ce929d0e0e4736 e4ec20f1cb9ecc2b SERVER [tracer: io.opentelemetry.tomcat-10.0:2.34.0-alpha] {http.route=/orders/{id}, http.request.method=GET, url.path=/orders/42, http.response.status_code=200}
Each line is one span: name, trace ID, span ID, kind and the instrumentation behind it. The server span is named after the route template, and SQL literals are replaced with ?.
One request, five spans, one trace ID. Span names and instrumentation names are from the agent run; bar lengths are approximate.
Option 2: the OpenTelemetry Spring Boot starter
The starter configures the same OpenTelemetry SDK from inside the application context. Import the instrumentation BOM first, before any other BOM, so every OpenTelemetry artifact resolves to one version.
pom.xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-instrumentation-bom</artifactId>
<version>2.34.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-spring-boot-starter</artifactId>
</dependency>
<!-- Needed for @WithSpan. Named spring-boot-starter-aop on Spring Boot 3. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aspectj</artifactId>
</dependency>
</dependencies>
In Gradle: implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:2.34.0")) and implementation("io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter").
With no configuration it exports all three signals to http://localhost:4318 and takes service.name from spring.application.name. It reads OTEL_* variables and the same settings as otel.* properties:
application.yml
spring:
application:
name: orders # becomes service.name
otel:
exporter:
otlp:
endpoint: http://localhost:4318
protocol: http/protobuf
headers:
Authorization: Bearer YOUR_KEY
resource:
attributes:
deployment.environment.name: production
traces:
sampler: parentbased_traceidratio
sampler.arg: "0.1"
On Spring Boot 4.2 this produced Spring MVC server spans, RestClient client spans, JDBC spans with sanitized SQL and log records, with no extra code.
Option 3: Spring Boot's own tracing with Micrometer and OTLP
Spring instruments its own libraries with the Micrometer Observation API: one observation becomes a timer metric and a span. The OpenTelemetry bridge creates the span in the OpenTelemetry SDK and an OTLP exporter ships it. On Spring Boot 4 this is one starter:
pom.xml
<!-- Spring Boot 4: one starter for traces, metrics and the OTLP exporters -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-opentelemetry</artifactId>
</dependency> Traces are not exported until you set an endpoint. On Spring Boot 4.2 one base URL covers traces, metrics and logs:
application.yml
spring:
application:
name: orders
task:
execution:
propagate-context: true # trace context in @Async, Boot 4.1+
management:
opentelemetry:
otlp:
endpoint: http://localhost:4318 # base URL for all signals, Boot 4.2+
headers:
Authorization: Bearer YOUR_KEY
resource-attributes:
deployment.environment.name: production
tracing:
sampling:
probability: 1.0 # the default is 0.1
observations:
conventions: open-telemetry # OTel span names and attributes, Boot 4.2+
annotations:
enabled: true # turns on @Observed The properties moved between releases, so older tutorials no longer match. As of November 2026:
| Spring Boot | What changed |
|---|---|
| 3.x | No starter. Trace endpoint is management.otlp.tracing.endpoint, a full URL ending in /v1/traces. |
| 4.0 | spring-boot-starter-opentelemetry arrives. Endpoint moves to management.opentelemetry.tracing.export.otlp.endpoint; the old name still works but is deprecated. |
| 4.1 | OTEL_* environment variables are mapped to Spring properties. Adds management.opentelemetry.tracing.sampler and spring.task.execution.propagate-context. |
| 4.2 | Adds the shared management.opentelemetry.otlp.endpoint base URL and management.observations.conventions. |
Each version links to its release notes. Every property is in the application properties appendix; the variable mapping is in the observability reference.
On Spring Boot 3 you assemble the same thing from three dependencies and the older property:
pom.xml
<!-- Spring Boot 3: no starter, add the pieces yourself -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-otel</artifactId>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
</dependency> application.yml
# Spring Boot 3.x, and still accepted (deprecated) on 4.x
management:
otlp:
tracing:
endpoint: http://localhost:4318/v1/traces # full URL, path included
headers:
Authorization: Bearer YOUR_KEY
tracing:
sampling:
probability: 1.0 Spring Boot manages these versions, so leave the version tags out.
application.yml vs OTEL_* environment variables
Use the standard variables for anything that differs per environment. They work with the agent, the OpenTelemetry starter and Spring Boot 4.1 or later, and they configure every other OpenTelemetry SDK you run.
export OTEL_SERVICE_NAME="orders"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://otel-collector:4318"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer YOUR_KEY"
export OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=production,service.version=1.4.2"
export OTEL_TRACES_SAMPLER="parentbased_traceidratio"
export OTEL_TRACES_SAMPLER_ARG="0.1" OTEL_EXPORTER_OTLP_ENDPOINTis a base URL. The exporter appends/v1/traces,/v1/metricsand/v1/logs. Spring's per-signal properties, such asmanagement.otlp.tracing.endpoint, are full URLs and need the path.- The agent reads one key from
application.yml. It starts before Spring and ignoresotel.*andmanagement.*properties. The exception isspring.application.name: a resource detector looks for it on the command line, in the environment and in theapplicationandbootstrapfiles, and uses it asservice.namewhen you set none. Everything else goes in environment variables,-Dotel.*system properties or the file named byOTEL_JAVAAGENT_CONFIGURATION_FILE. - Environment variables win. With one endpoint in
application.ymland another inOTEL_EXPORTER_OTLP_ENDPOINT, the Spring Boot 4.2 test app exported to the variable's. The OpenTelemetry starter does the same.management.opentelemetry.map-environment-variables=falseswitches Spring's mapping off.
What gets traced: routes, JDBC, RestClient and WebClient
This section compares the spans each option records for the same controller: a route with a path variable, a query and an outgoing call.
OrderController.java
@RestController
class OrderController {
private final JdbcClient jdbc;
private final RestClient rest;
// Inject the builder. RestClient.create() skips the instrumentation
// in the starter and in Spring Boot's own tracing.
OrderController(JdbcClient jdbc, RestClient.Builder builder) {
this.jdbc = jdbc;
this.rest = builder.baseUrl("http://inventory:8080").build();
}
@GetMapping("/orders/{id}")
Map<String, Object> order(@PathVariable long id) {
Integer found = jdbc.sql("select count(*) from orders where id = ?")
.param(id).query(Integer.class).single();
String stock = rest.get().uri("/inventory/{id}", id).retrieve().body(String.class);
return Map.of("id", id, "found", found, "stock", stock);
}
} | Java agent | OpenTelemetry starter | Spring Boot + Micrometer | |
|---|---|---|---|
| Server span name | GET /orders/{id} | GET /orders/{id} | http get /orders/{id}, or GET /orders/{id} with OpenTelemetry conventions |
| Route attribute | http.route | http.route | uri, or http.route with OpenTelemetry conventions |
| RestClient span | Yes, any instance | Yes, when built from the injected builder | Yes, when built from the injected builder |
| JDBC span | SELECT shop.orders | SELECT shop.orders | None by default |
| SQL text | Literals replaced with ? | Literals replaced with ? | n/a |
- Route naming. All three name the server span after the mapping pattern, so
/orders/42and/orders/43group together. A request that matches no controller is namedGET /**, which is where scanner traffic and 404s end up. - Conventions. Spring Boot's default names follow Micrometer. On 4.2,
management.observations.conventions=open-telemetrygives server spanshttp.request.method,http.response.status_codeandhttp.route. - HTTP clients. The starter and Spring Boot instrument
RestClient,RestTemplateandWebClientthrough the builder beans. A client fromRestClient.create()orWebClient.create()gets no span and sends notraceparentheader, which breaks context propagation. Inject the builder. The agent instruments the HTTP library underneath, so any client works. - JDBC. Spring Boot creates no spans for SQL.
net.ttddyy.observation:datasource-micrometer-spring-bootwraps theDataSource; version 2.3.1 on Spring Boot 4.2 producedconnection,queryandresult-setspans per statement, with the SQL injdbc.query[0]. That is three spans where the agent and the OpenTelemetry starter emit one.
Custom spans with @WithSpan and @Observed
Add your own spans with one annotation. With the agent or the OpenTelemetry starter that is @WithSpan from opentelemetry-instrumentation-annotations; @SpanAttribute records a parameter and Span.current() returns the active span.
PricingService.java
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.instrumentation.annotations.SpanAttribute;
import io.opentelemetry.instrumentation.annotations.WithSpan;
@Service
class PricingService {
@WithSpan("calculate-price")
long price(@SpanAttribute("order.id") long orderId) {
Span.current().setAttribute("pricing.currency", "EUR");
return orderId * 100;
}
} The agent weaves this into any method. The starter uses Spring AOP: the class must be a bean, the call must come from another bean, the method cannot be private, and the AspectJ starter must be on the classpath (see @WithSpan does nothing).
With Spring Boot's own tracing the equivalent is @Observed, which needs the same AspectJ starter and management.observations.annotations.enabled=true:
PricingService.java
import io.micrometer.observation.annotation.Observed;
@Service
class PricingService {
// One annotation, a span and a timer metric
@Observed(name = "pricing.calculate", contextualName = "calculate-price")
long price(long orderId) {
return orderId * 100;
}
} contextualName becomes the span name and name the metric name. Keep unbounded values such as user IDs off metrics; the cardinality guide explains why.
Logs with trace_id
Getting the trace ID into logs has two parts: printing it in console or file logs, and exporting log records over OTLP.
The agent and the OpenTelemetry starter add the lower path on their own. With Spring Boot's own tracing you add the appender yourself.
Printing it. All three options put the IDs in the SLF4J MDC, under different keys:
| MDC keys | Printed by default | |
|---|---|---|
| Spring Boot + Micrometer | traceId, spanId | Yes, since Spring Boot 3.2 |
| Java agent, OpenTelemetry starter | trace_id, span_id, trace_flags | No, set the pattern below |
application.yml
logging:
pattern:
correlation: "[%X{trace_id:-},%X{span_id:-}] " INFO 80045 --- [orders] [io-8080-exec-2] [4bf92f3577b34da6a3ce929d0e0e4736,e4ec20f1cb9ecc2b] c.e.demo.OrderController : loading order 42
INFO 80045 --- [orders] [io-8080-exec-3] [4bf92f3577b34da6a3ce929d0e0e4736,2d0feb503a535ef5] c.e.demo.OrderController : checking inventory 42
INFO 80045 --- [orders] [ task-1] [4bf92f3577b34da6a3ce929d0e0e4736,e4ec20f1cb9ecc2b] c.e.demo.Mailer : sending receipt for 42
Two requests in one trace, plus an @Async task that kept the caller's IDs. In JSON logs the same MDC keys become fields with no pattern.
Exporting it. The agent and the OpenTelemetry starter attach a Logback appender themselves. Spring Boot includes the OTLP log exporter but leaves Logback alone: add io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0 (2.34.0-alpha), declare the appender and hand it the SDK.
<!-- src/main/resources/logback-spring.xml -->
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<appender name="OTEL"
class="io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="OTEL"/>
</root>
</configuration> OtelLogbackInstaller.java
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender;
// Hands Spring Boot's OpenTelemetry instance to the Logback appender.
@Component
class OtelLogbackInstaller implements InitializingBean {
private final OpenTelemetry openTelemetry;
OtelLogbackInstaller(OpenTelemetry openTelemetry) {
this.openTelemetry = openTelemetry;
}
@Override
public void afterPropertiesSet() {
OpenTelemetryAppender.install(openTelemetry);
}
}
The appender buffers lines written before the context is ready and sends them once install runs. If a Collector already tails your log files, skip OTLP log export or you pay for every line twice.
Metrics
All three options export metrics over OTLP every 60 seconds once an endpoint is set. The metric names differ:
- Java agent. OpenTelemetry-named metrics:
http.server.request.duration,http.client.request.duration,jvm.gc.durationand the otherjvm.*metrics, and connection pool metrics such asdb.client.connections.usage. - OpenTelemetry starter.
http.server.request.durationand thejvm.*runtime metrics (jvm.memory.used,jvm.thread.count,jvm.cpu.time). - Spring Boot. Everything Micrometer records, sent by its OTLP registry under Micrometer's names:
jvm.memory.used,hikaricp.connections.usage,tomcat.sessions.active.current,http.client.requests, plus a timer for each@Observedmethod.
With the agent and the OpenTelemetry starter, OTEL_METRIC_EXPORT_INTERVAL (milliseconds) sets the interval and OTEL_METRICS_EXPORTER=none turns metrics off. Spring Boot 4.2 sends metrics to the shared management.opentelemetry.otlp.endpoint. On earlier versions the metrics URL is a property of its own:
application.yml
# Spring Boot 3.x and 4.x: a full URL, path included
management:
otlp:
metrics:
export:
url: http://localhost:4318/v1/metrics
step: 30s # the default is 1m
A dashboard built on the agent's http.server.request.duration shows nothing for a Micrometer service, which reports http.server.requests. Decide per fleet, not per service.
Production settings
Six settings to check before the first deploy.
- Resource attributes. Set
service.name,service.versionanddeployment.environment.nameon every service. Onlyservice.namefalls back tospring.application.name(with neither set, it isunknown_service:java); setservice.versionanddeployment.environment.nameexplicitly. - Sampling. Use a parent-based sampler so a service honours the decision made upstream:
OTEL_TRACES_SAMPLER=parentbased_traceidratiowithOTEL_TRACES_SAMPLER_ARG=0.1, ormanagement.tracing.sampling.probability=0.1. A ratio drops errors as readily as successes; to keep every error, sample in a Collector. The sampling guide covers both. - Batching. Spans are exported in batches of up to 512 every 5 seconds, from a queue of 2,048. A full queue drops spans silently. Raise
OTEL_BSP_MAX_QUEUE_SIZE(management.opentelemetry.tracing.export.max-queue-sizein Spring Boot 4) first. - Shutdown. The last batch is flushed on
SIGTERM: Spring closes the SDK with the application context and the agent uses a JVM shutdown hook. ASIGKILLloses up to 5 seconds of spans. - Health checks. Probes to
/actuator/healthproduce a trace every few seconds per instance. With Spring Boot's own tracing, theObservationPredicatebean below stops them in the app. The agent has no property for excluding a path, so drop probes in the Collector with a filter onurl.path. A rule-based sampler in a declarative config file (OTEL_CONFIG_FILE) also works, but its format is changing as of 2.34. - Agent overhead. The agent adds to startup time and memory. Turn off instrumentations you do not want with
OTEL_INSTRUMENTATION_[NAME]_ENABLED=false.
TracingFilters.java
import io.micrometer.observation.ObservationPredicate;
import org.springframework.http.server.observation.ServerRequestObservationContext;
@Configuration
class TracingFilters {
// Returning false skips the observation: no span and no timer for it.
@Bean
ObservationPredicate skipActuator() {
return (name, context) -> !(context instanceof ServerRequestObservationContext server
&& server.getCarrier().getRequestURI().startsWith("/actuator"));
}
} With this bean, /actuator/health still answered 200 in the test app and produced no span.
GraalVM native image
The Java agent does not work in a native image: it rewrites bytecode as classes load, and a native executable loads no classes at run time. Both starters work because their instrumentation is ordinary Spring configuration compiled into the image.
Test the image itself. Anything that relies on reflection or a proxy, including @WithSpan and @Observed, depends on hints generated at build time.
Common problems and fixes
The five problems below account for most "no traces" and "wrong traces" reports, each with the fix that worked in the test app.
Duplicate spans for every request
You are running two instrumentations, usually the Java agent on an app that also has Micrometer Tracing. With the agent and spring-boot-starter-opentelemetry together, each request produced one server span from the agent's Tomcat instrumentation and a second from Spring's observation, exported by two separate SDKs.
Remove one. If the agent stays, drop spring-boot-starter-opentelemetry or micrometer-tracing-bridge-otel, or set management.tracing.export.enabled=false. The agent with the OpenTelemetry starter did not duplicate in the same test, because the agent's SDK took over, but the starter is dead weight there.
Only some requests are traced, or none
- About one request in ten shows up. That is Spring Boot's default
management.tracing.sampling.probability=0.1. Set it to1.0while you test. - Nothing arrives and nothing is logged. With Spring Boot's own tracing and no endpoint, no exporter is created and no error is logged.
- Nothing arrives and the app logs export errors. See 4317 vs 4318.
- Tests export nothing. Spring Boot turns trace export off in
@SpringBootTest. On 4.2 setspring.test.tracing.export=true; on 3.x add@AutoConfigureObservability. - Outgoing calls start new traces. The client was not built from the injected builder, so no
traceparentheader was sent.
No trace ID or spans in @Async methods
Trace context lives in a thread-local, and @Async runs on a pool thread. The agent carries the context across executors by itself. With the starters, the async log line had empty IDs until the executor was told to copy the context.
On Spring Boot 4.1 or later with Micrometer Tracing, one property does it:
application.yml
spring:
task:
execution:
propagate-context: true
On earlier versions, register a ContextPropagatingTaskDecorator bean instead. With the OpenTelemetry starter, wrap tasks in the OpenTelemetry context:
AsyncConfig.java
import io.opentelemetry.context.Context;
import org.springframework.core.task.TaskDecorator;
@Configuration
class AsyncConfig {
// Captures the caller's context and restores it on the pool thread.
// Spring Boot applies a TaskDecorator bean to its default executor.
@Bean
TaskDecorator otelTaskDecorator() {
return runnable -> Context.current().wrap(runnable);
}
}
For your own ExecutorService or CompletableFuture.supplyAsync, wrap the executor with Context.taskWrapping(executor).
@WithSpan or @Observed does nothing
With the OpenTelemetry starter and no AOP on the classpath, @WithSpan is ignored without a warning. The attribute set through Span.current() then lands on the server span. Adding spring-boot-starter-aspectj (spring-boot-starter-aop on Spring Boot 3) fixed it. @Observed needs the same starter plus management.observations.annotations.enabled=true.
If it still does nothing, the call bypasses the proxy: a call on this, a private method, or an object created with new.
4317 vs 4318 and export errors
Port 4317 is OTLP over gRPC and 4318 is OTLP over HTTP. All three options default to HTTP, so use 4318 unless you set the protocol to grpc. A mismatch never says "wrong port". Here is gRPC sent to an HTTP port, then a port where nothing listens:
ERROR io.opentelemetry.exporter.otlp.internal.GrpcExporter - Failed to export 2 spans. The request could not be executed.
java.io.IOException: FRAME_SIZE_ERROR: 3940676
ERROR io.opentelemetry.exporter.otlp.internal.HttpExporter - Failed to export 2 spans. The request could not be executed.
java.net.ConnectException: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4318 - Check that
OTEL_EXPORTER_OTLP_PROTOCOLand the port agree. - In Docker or Kubernetes,
localhostis the app's own container. Use the Collector's service name. - A
404usually means/v1/tracesis missing from a per-signal URL or doubled on a base URL.
The OTLP guide lists each export error with its cause.
Send it to Maple
Maple accepts OTLP directly, so no Collector is required. These variables work as written with the agent, the OpenTelemetry starter and Spring Boot 4.1 or later; on older Spring Boot versions, put the same endpoint and header in the management.otlp.* properties.
export OTEL_SERVICE_NAME="orders"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.maple.dev"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer YOUR_INGEST_KEY"
The Java instrumentation doc covers the rest of the setup.