You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sentry-opentelemetry/README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,11 +38,14 @@ you also need this module as a dependency.
38
38
Contains `SentrySpanProcessor` and `SentryPropagator` which are used by our Java Agent but can also
39
39
be used when manually instrumenting using OpenTelemetry. If you want to use OpenTelemetry without
40
40
the agent but still want some configuration convenience, you should rather use the
41
-
`sentry-opentelemetry-agentless` module.
41
+
`sentry-opentelemetry-agentless` module or the `sentry-opentelemetry-agentless-spring` module if you are using Spring Boot.
42
42
43
43
### `sentry-opentelemetry-agentless`
44
44
Combines all modules and dependencies needed to use Sentry with OpenTelemetry without the agent.
45
45
46
+
### `sentry-opentelemetry-agentless-spring`
47
+
Combines all modules and dependencies needed to use Sentry with OpenTelemetry in SpringBoot without an agent.
48
+
46
49
## Running without an Agent
47
50
If you want to use Sentry with OpenTelemetry without an agent, you can do so by adding the `sentry-opentelemetry-agentless` module as dependencies to your project.
As an alternative to the `SENTRY_PROPERTIES_FILE` environment variable you can provide individual
24
-
settings as environment variables (e.g. `SENTRY_DSN=...`) or you may initialize `Sentry` inside
25
-
your target application:
24
+
settings as environment variables (e.g. `SENTRY_DSN=...`).
25
+
26
+
## Controlling auto initialization of Sentry
27
+
28
+
By default, if you pass either `SENTRY_DSN` or `SENTRY_PROPERTIES_FILE` as environment variable,
29
+
Sentry will automatically be initialized by this agent. To disable this behaviour, you can set
30
+
`SENTRY_AUTO_INIT=false` as environment variable. You will then have to initialize Sentry inside
31
+
the target application:
26
32
27
33
```
28
34
Sentry.init(
@@ -33,13 +39,6 @@ Sentry.init(
33
39
)
34
40
```
35
41
36
-
## Controlling auto initialization of Sentry
37
-
38
-
By default if you pass either `SENTRY_DSN` or `SENTRY_PROPERTIES_FILE` as environment variable,
39
-
Sentry will automatically be initialized by this agent. To disable this behaviour, you can set
40
-
`SENTRY_AUTO_INIT=false` as environment variable. You will then have to initialize Sentry inside
41
-
the target application.
42
-
43
42
## Debugging
44
43
45
44
To enable debug logging for Sentry, please provide `SENTRY_DEBUG=true` as environment variable or
@@ -57,6 +56,7 @@ Example log message:
57
56
```
58
57
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
59
58
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
59
+
ERROR io.opentelemetry.exporter.internal.http.HttpExporter - Failed to export logs. The request could not be executed. Full error message: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4318
60
60
```
61
61
62
62
### Traces
@@ -68,3 +68,8 @@ see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/
68
68
69
69
To turn off exporting of metrics you can set `OTEL_METRICS_EXPORTER=none`
70
70
see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#otlp-exporter-span-metric-and-log-exporters)
71
+
72
+
### Logs
73
+
74
+
To turn off log exporting, set `OTEL_LOGS_EXPORTER=none`
75
+
see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#otlp-exporter-span-metric-and-log-exporters).
Copy file name to clipboardExpand all lines: sentry-opentelemetry/sentry-opentelemetry-agentless-spring/README.md
+11-43Lines changed: 11 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,53 +2,21 @@
2
2
3
3
*NOTE: Our OpenTelemetry modules are still experimental. Any feedback is welcome.*
4
4
5
+
This module allows the use of Sentry with OpenTelemetry in SpringBoot without an agent by using the OpenTelemetry Spring Boot Starter.
6
+
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/).
7
+
5
8
## How to use it
6
9
7
-
Add the latest `sentry-opentelemetry-agentless-spring` module as a dependency and add a `sentry.properties`
8
-
configuration file to your project that could look like this:
10
+
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`:
9
11
10
12
```properties
11
-
# NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry project/dashboard
In case you are using this module without needing to use any OpenTelemetry exporters you can add
37
-
the following environment variables to turn off exporters and stop seeing error messages about
38
-
servers not being reachable in the logs.
39
-
40
-
Example log message:
41
-
```
42
-
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
43
-
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
44
-
```
45
-
46
-
### Traces
47
-
48
-
To turn off exporting of traces you can set `OTEL_TRACES_EXPORTER=none`
49
-
see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#otlp-exporter-span-metric-and-log-exporters)
50
-
51
-
### Metrics
20
+
This module will automatically configure OpenTelemetry and Sentry for you.
52
21
53
-
To turn off exporting of metrics you can set `OTEL_METRICS_EXPORTER=none`
54
-
see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#otlp-exporter-span-metric-and-log-exporters)
22
+
With the dependency and configuration in place, just run your SpringBoot application as usual.
In case you are using this module without needing to use any OpenTelemetry exporters you can add
37
-
the following environment variables to turn off exporters and stop seeing error messages about
38
-
servers not being reachable in the logs.
39
-
40
-
Example log message:
41
-
```
42
-
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
43
-
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
27
+
You may also want to set the following environment variables to if you do not use OTEL exporters:
If you're not using `sentry.properties` or environment variables you can then initialize Sentry programmatically as usual:
47
49
48
-
To turn off exporting of traces you can set `OTEL_TRACES_EXPORTER=none`
49
-
see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#otlp-exporter-span-metric-and-log-exporters)
50
-
51
-
### Metrics
52
-
53
-
To turn off exporting of metrics you can set `OTEL_METRICS_EXPORTER=none`
54
-
see [OpenTelemetry GitHub](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure#otlp-exporter-span-metric-and-log-exporters)
Copy file name to clipboardExpand all lines: sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Sentry Sample Spring Boot 3.0+
2
2
3
-
Sample application showing how to use Sentry with [Spring boot](http://spring.io/projects/spring-boot) from version `3.0` onwards integrated with the [OpenTelemetry Spring Boot Starter](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/).
3
+
Sample application showing how to use Sentry with [Spring boot](http://spring.io/projects/spring-boot) from version `3.0` onwards integrated with the [OpenTelemetry Spring Boot Starter](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/) without an agent.
0 commit comments