-
-
Notifications
You must be signed in to change notification settings - Fork 472
-
Hey,
I have a few questions, hope this is the right place to ask them.
We're using spring-boot, sentry, as well as the agentless opentelemetry approach.
Reading through the docs (sentry and otel) it seems that HTTP Instrumentation should basically just work automatically out-of-the-box.
For example, JDBC auto-instrumentation or Spring MVC server traces work without problems.
However this is not the case for HTTP client calls - we have to manually load in the opentelemetry modules...
<dependency> <groupId>io.opentelemetry.instrumentation</groupId> <artifactId>opentelemetry-java-http-client</artifactId> <version>2.18.0-alpha</version> </dependency>
... and then wrap the HttpClient with the Telemetry:
@Bean public HttpClient httpClient() { return JavaHttpClientTelemetry.builder(openTelemetry).build().newHttpClient(httpClientBuilder().build()); }
HTTP Client Traces are then being send to Sentry - however the "Outbound API Requests" view in the Sentry Backend Dashboard still doesn't show any Requests.
- Is automatic HTTP client instrumentation even possible - or is it always manual?
- Does the "real" agent support more features / auto-instrumentation than agentless?
Thanks <3
Versions
Spring-Boot: 3.5.7
JDK/JRE: 21 Temurin
Sentry: 8.26.0
Sentry Maven Plugin: 0.9.0
Code Snippets
pom.xml:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.5.7</version> </parent> <dependencyManagement> <dependencies> <dependency> <groupId>io.sentry</groupId> <artifactId>sentry-bom</artifactId> <version>8.26.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependecies> <dependency> <groupId>io.sentry</groupId> <artifactId>sentry-opentelemetry-agentless-spring</artifactId> </dependency> </dependencies> <plugin> <groupId>io.sentry</groupId> <artifactId>sentry-maven-plugin</artifactId> <version>0.9.0</version> <extensions>true</extensions> <configuration> <org>asdf</org> <project>myappr</project> <url>https://sentry.asdf.eu/</url> <!--suppress UnresolvedMavenProperty --> <authToken>${env.SENTRY_AUTH_TOKEN}</authToken> <debugSentryCli>true</debugSentryCli> <skip>false</skip> <skipSourceBundle>false</skipSourceBundle> <skipAutoInstall>false</skipAutoInstall> </configuration> <executions> <execution> <goals> <goal>uploadSourceBundle</goal> <goal>validateSdkDependencyVersions</goal> </goals> </execution> </executions> </plugin>
properties:
sentry.enabled=true sentry.release=@project.version@ sentry.dsn=https://02b12341c124sfkl92njf121308562acfde@sentry.asdf.eu/37 sentry.send-default-pii=true sentry.environment=staging sentry.traces-sample-rate=1.0 sentry.ignored-transactions=.*actuator\/health.* sentry.debug=false sentry.logs.enabled=true sentry.exception-resolver-order=-2147483647 otel.propagators=sentry otel.traces.exporter=none otel.metrics.exporter=none
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Hey @NINNiT , it seems, there's no auto config for HttpClient in https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/spring/starters/spring-boot-starter or https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/spring/spring-boot-autoconfigure.
Does the "real" agent support more features / auto-instrumentation than agentless?
Yes, our sentry-opentelemetry-agent does support Java HttpClient without requiring config changes. I just tried this on one of our Samples and was able to see a connected trace for an outgoing request. I was also able to see the request on the "Outbound API Requests" page.
the "Outbound API Requests" view in the Sentry Backend Dashboard still doesn't show any Requests.
Make sure to use the correct instance of HttpClient (the one defined as bean) when making the request.
You are also using version 2.18.0-alpha instead of 2.17.0-alpha which causes a NoSuchMethodError 'boolean io.opentelemetry.instrumentation.api.internal.SemconvStability.isEmitOldCodeSemconv()'. Once downgraded, the exception goes away. Both showed up on the "Outbound API Requests" page for me.
Please make sure to use the correct OTel version as otherwise it causes a mix of OpenTelemetry versions, leading to unexpected behaviour, potentially including crashes.
Beta Was this translation helpful? Give feedback.