-
-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update readmes for noagent samples, add otel properties to application.properties in noagent samples * update readme for console - noagent * update opentelemetry and optentelemetry agent readme * add java options and new agentless module to readme * update readmes * Update sentry-opentelemetry/README.md Co-authored-by: Alexander Dinauer <[email protected]> * Update sentry-opentelemetry/README.md Co-authored-by: Alexander Dinauer <[email protected]> * Update sentry-opentelemetry/sentry-opentelemetry-agent/README.md Co-authored-by: Alexander Dinauer <[email protected]> * Update sentry-opentelemetry/sentry-opentelemetry-agentless/README.md Co-authored-by: Alexander Dinauer <[email protected]> * Update sentry-opentelemetry/README.md Co-authored-by: Alexander Dinauer <[email protected]> * remove experimental note in opentelemetry readmes --------- Co-authored-by: Alexander Dinauer <[email protected]>
- Loading branch information
Showing
9 changed files
with
117 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 10 additions & 44 deletions
54
sentry-opentelemetry/sentry-opentelemetry-agentless-spring/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,20 @@ | ||
# sentry-opentelemetry-agentless-spring | ||
|
||
*NOTE: Our OpenTelemetry modules are still experimental. Any feedback is welcome.* | ||
This module allows the use of Sentry with OpenTelemetry in SpringBoot without an agent by using the OpenTelemetry Spring Boot Starter. | ||
For guidance on when to use this module instead of the agent, please have a look at the [OpenTelemetry Spring Boot Starter documentation](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/). | ||
|
||
## 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: | ||
Add the latest `sentry-opentelemetry-agentless-spring` module as a dependency to your Sentry enabled [SpringBoot](https://docs.sentry.io/platforms/java/guides/spring-boot/) application and add the following to your `application.properties`: | ||
|
||
```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 | ||
# OTEL configuration | ||
otel.propagators=tracecontext,baggage,sentry | ||
otel.logs.exporter=none | ||
otel.metrics.exporter=none | ||
otel.traces.exporter=none | ||
``` | ||
|
||
For more details on configuring Sentry via `sentry.properties` please see the | ||
[docs page](https://docs.sentry.io/platforms/java/configuration/). | ||
This module will automatically configure OpenTelemetry and Sentry for you. | ||
|
||
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) | ||
With the dependency and configuration in place, just run your SpringBoot application as usual. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sentry-samples/sentry-samples-console-opentelemetry-noagent/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters