-
-
Couldn't load subscription status.
- Fork 460
POTEL 70 - Add sentry-opentelemetry-agentless-spring module
#4000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
08507df
b36339c
d48d398
66b4206
a0a4baa
e46efe8
5231140
917b2e3
b11af4d
77d60e4
6b69f56
cb8746c
400b60e
d444ef7
3f891c4
dacc35b
dd37382
a17517b
f3056ff
9f71bec
63080b1
68019c1
cb4ede3
46930d1
b2e8e80
8833fc9
11bff06
7a1d3b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # sentry-opentelemetry-agentless-spring | ||
|
|
||
| *NOTE: Our OpenTelemetry modules are still experimental. Any feedback is welcome.* | ||
|
|
||
| ## How to use it | ||
|
|
||
| Add the latest `sentry-opentelemetry-agentless-spring` module as a dependency and add a `sentry.properties` | ||
| configuration file to your project that could look like this: | ||
|
|
||
| ```properties | ||
| # NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry project/dashboard | ||
| dsn=https://[email protected]/5428563 | ||
| traces-sample-rate=1.0 | ||
| ``` | ||
|
|
||
| For more details on configuring Sentry via `sentry.properties` please see the | ||
| [docs page](https://docs.sentry.io/platforms/java/configuration/). | ||
|
|
||
| As an alternative to the `SENTRY_PROPERTIES_FILE` environment variable you can provide individual | ||
| settings as environment variables (e.g. `SENTRY_DSN=...`) or you may initialize `Sentry` inside | ||
| your target application. If you do so, please make sure to apply OpenTelemetry specific options, e.g. | ||
| like this: | ||
|
|
||
| ``` | ||
| Sentry.init( | ||
| options -> { | ||
| options.setDsn("..."); | ||
| ... | ||
| OpenTelemetryUtil.applyOpenTelemetryOptions(options, false); | ||
| } | ||
| ) | ||
| ``` | ||
|
|
||
| ## Getting rid of exporter error messages | ||
|
|
||
| In case you are using this module without needing to use any OpenTelemetry exporters you can add | ||
| the following environment variables to turn off exporters and stop seeing error messages about | ||
| servers not being reachable in the logs. | ||
|
|
||
| Example log message: | ||
| ``` | ||
| ERROR io.opentelemetry.exporter.internal.grpc.OkHttpGrpcExporter - Failed to export spans. The request could not be executed. Full error message: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4317 | ||
| ERROR io.opentelemetry.exporter.internal.grpc.OkHttpGrpcExporter - Failed to export metrics. The request could not be executed. Full error message: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4317 | ||
| ``` | ||
|
|
||
| ### Traces | ||
|
|
||
| To turn off exporting of traces you can set `OTEL_TRACES_EXPORTER=none` | ||
| see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#otlp-exporter-span-metric-and-log-exporters) | ||
|
|
||
| ### Metrics | ||
|
|
||
| To turn off exporting of metrics you can set `OTEL_METRICS_EXPORTER=none` | ||
| see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#otlp-exporter-span-metric-and-log-exporters) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| plugins { | ||
| `java-library` | ||
| } | ||
|
|
||
| configure<JavaPluginExtension> { | ||
| sourceCompatibility = JavaVersion.VERSION_1_8 | ||
| targetCompatibility = JavaVersion.VERSION_1_8 | ||
| } | ||
|
|
||
| dependencies { | ||
| api(projects.sentry) | ||
| api(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap) | ||
| implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentcustomization) | ||
| api(Config.Libs.OpenTelemetry.otelSdk) | ||
| api(Config.Libs.OpenTelemetry.otelSemconv) | ||
| api(Config.Libs.OpenTelemetry.otelSemconvIncubating) | ||
| api(Config.Libs.OpenTelemetry.otelExtensionAutoconfigure) | ||
|
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we not depending on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I thought, it might cause more issues than save work to reuse the other |
||
| api(Config.Libs.springBoot3StarterOpenTelemetry) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| package io.sentry.opentelemetry.agent; | ||
|
|
||
| public final class AgentlessSpringMarker {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed, as it is now obsolete. I suggest we do that in the #3978 PR