adityamparikh opened a new pull request, #260: URL: https://github.com/apache/solr-mcp/pull/260
## What Adds one switch, `OTEL_EXPORT_ENABLED` (default `true`), that turns off OTLP export of traces, metrics and logs in HTTP mode. Every documented HTTP-mode `docker run`, plus the Compose and Kubernetes examples, now sets it to `false`. ## Why The OTLP endpoints default to `http://localhost:4318/v1/{traces,metrics,logs}`. Run with `java -jar` or `bootRun`, that is the local LGTM container, so nothing needs configuring. In a container, `localhost` is the container itself, so export can never succeed, even with LGTM running on the host. With the documented `docker run` commands, the server logs an `ERROR … Failed to export logs` stack trace about every 10 seconds, plus span and metric failures. That's about 600 log lines in the first 2.5 minutes, which looks like a broken server to anyone trying it out. ## How - `application-http.properties` maps the switch onto Spring Boot's own `management.tracing.export.otlp.enabled`, `management.otlp.metrics.export.enabled` and `management.logging.export.otlp.enabled`. - On the JVM those are bean conditions, so that's enough. **The native image ignores them for traces and logs**, because Spring AOT evaluated the conditions at build time, when the switch was unset. `OtlpExportSwitch`, a `BeanPostProcessor`, re-reads the same two properties at runtime and swaps the OTLP span and log exporters for no-ops. Micrometer already re-checks the metrics property itself when the registry starts. - `opentelemetry-exporter-otlp` is now declared `implementation` (versionless, from Boot's BOM) for the exporter types. It already shipped through the starter, so the runtime classpath, SBOM and LICENSE are unchanged. ## Verified All runs had the OTLP URLs pointed at a port with no collector, with three `check-health` calls each, for 70 seconds: | Build | `OTEL_EXPORT_ENABLED` | span errors | log errors | metric errors | |---|---|---|---|---| | JVM jar | unset | 1 | 7 | 2 | | JVM jar | `false` | 0 | 0 | 0 | | native http, properties only | `false` | 1 | 7 | 0 | | native http, with `OtlpExportSwitch` | unset | 1 | 7 | 1 | | native http, with `OtlpExportSwitch` | `false` | 0 | 0 | 0 | `OtlpExportSwitchTest` covers the post-processor directly, since on the JVM the bean conditions remove the exporters before it ever sees them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
