Document the level of support for the OpenTelemetry APIs
Opened this issue · 0 comments
The Spring Boot OpenTelemetry Starter has mixed support for the OpenTelemetry APIs.
It would be useful to document this in the OpenTelemetry Support section of the docs.
| Aspect | OpenTelemetry API | OpenTelemetry Exporter API | OTLP | OpenTelemetry Environment Variables Spec |
|---|---|---|---|---|
| Logging | ✅ | ✅* | ✅* | |
| Metrics | ❌ | ❌ | ✅ | |
| Tracing | ✅ | ✅ | ✅ |
* No log is actually collected nor exported, since there is no support in Spring Boot for bridging logs from SLF4J/Logback/Log4J.
The key part is that metrics are only supported when registered via the Micrometer API. The OpenTelemetry Metrics API can be used to register metrics (since it's in the classpath), but all the metrics registered in that way will be ignored (as decided in #36546). So it's a potential source of confusion and something I'd recommend documenting. One of the consequence of this situation, is that the Resource API-related config used for logs and traces is not shared with the metrics support (related issue: #46229).
On the other hand, there is support for registering traces both via OpenTelemetry Tracing API and Micrometer Tracing API. That adds on the confusion since support for the two observability signals is not consistent.
Another difference is in how the observability signals can be exported. For logs and traces, there is suppport for the OpenTelemetry Exporter API (only the OTLP implementation is supported by Spring Boot, but a developer could plug in a different implementation on their own). For metrics, there is not. Furthermore, logs are not collected from SLF4J/Logback/Log4J, so no log is actually exported (though, the plumbing is there for developers to add this feature on their own using the OpenTelemetry Java Instrumentation).
Finally, support for the OpenTelemetry Environment Variables specification is partially supported for the Resource API and a few more cases, but most environment variables are not supported. It would be nice to document which ones are supported (related issue: #47646).