Skip to content

Commit 6c1a7fc

Browse files
committed
Merge branch 'master' into byk/ci/mdx-cache
2 parents 07062bb + 029b520 commit 6c1a7fc

File tree

6 files changed

+133
-11
lines changed

6 files changed

+133
-11
lines changed

docs/platforms/python/configuration/draining.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,18 @@ description: "Learn more about the default behavior of our SDK if the applicatio
77
The default behavior of most SDKs is to send out events over the network
88
asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.
99

10-
<PlatformContent includePath="configuration/drain-example" />
10+
The Python SDK automatically drains on shutdown unless the `AtexitIntegration` is removed or the `shutdown_timeout`
11+
config key is set to 0. If you need to manually drain, the client provides a `close` method:
12+
13+
```python
14+
import sentry_sdk
15+
16+
client = sentry_sdk.get_client()
17+
client.close(timeout=2.0)
18+
```
19+
20+
After a call to `close`, the client is disabled. It's important to
21+
only call `close` immediately before shutting down the application.
22+
23+
Alternatively, the `flush` method drains the event queue while keeping the
24+
client enabled for continued use.

platform-includes/configuration/drain-example/python.mdx renamed to docs/platforms/python/configuration/draining__v1.x.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
The Python SDK automatically drains on shutdown unless the `AtExitIntegration` is removed or the `shutdown_timeout`
1+
---
2+
title: Shutdown and Draining
3+
sidebar_order: 80
4+
description: "Learn more about the default behavior of our SDK if the application shuts down unexpectedly."
5+
---
6+
7+
The default behavior of most SDKs is to send out events over the network
8+
asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.
9+
10+
The Python SDK automatically drains on shutdown unless the `AtexitIntegration` is removed or the `shutdown_timeout`
211
config key is set to 0. To manually drain the client provides a `close` method:
312

413
```python

docs/platforms/react-native/migration/sentry-expo.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,17 @@ Replace `sentry-expo` export `Native` with `@sentry/react-native`:
7474

7575
The `enableInExpoDevelopment` option is no longer supported. If you were using it, remove it and replace it with a `__DEV__` check, or leave the SDK enabled in development.
7676

77-
```javascript {tabTitle:JavaScript} diff
77+
```javascript {tabTitle:Disabled in development} diff
78+
Sentry.init({
79+
- enableInExpoDevelopment: false,
80+
+ enabled: !__DEV__,
81+
});
82+
```
83+
84+
```javascript {tabTitle:Enabled in development} diff
7885
Sentry.init({
7986
- enableInExpoDevelopment: true,
80-
+ enabled: __DEV__,
87+
+ enabled: true,
8188
});
8289
```
8390

platform-includes/configuration/integrations/javascript.nestjs.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Integrations
22

33
| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** |
4-
| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | --- |
4+
| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: |
55
| [`amqplibIntegration`](./amqplib) || || |
66
| [`consoleIntegration`](./console) || | ||
77
| [`contextLinesIntegration`](./contextlines) ||| | |
@@ -39,6 +39,6 @@
3939
| [`localVariablesIntegration`](./localvariables) | || | |
4040
| [`nodeProfilingIntegration`](./nodeprofiling) | | || |
4141
| [`rewriteFramesIntegration`](./rewriteframes) | || | |
42-
| [`supabaseIntegration`](./supabase) | ||| | |
42+
| [`supabaseIntegration`](./supabase) | ||| |
4343
| [`trpcMiddleware`](./trpc) | ||||
44-
| [`unleashIntegration`](./unleash) | | | | | |
44+
| [`unleashIntegration`](./unleash) | | | | |

platform-includes/logs/usage/android.mdx

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ Once the feature is enabled on the SDK and the SDK is initialized, you can send
22

33
The `Sentry.logger()` namespace exposes six methods that you can use to log messages at different log levels: `trace`, `debug`, `info`, `warn`, `error`, and `fatal`.
44

5-
For more advanced use cases, use the `Sentry.logger().log()` methods.
6-
75
These properties will be sent to Sentry, and can be searched from within the Logs UI, and even added to the Logs views as a dedicated column.
86

97
```java {tabTitle: Java}
@@ -19,3 +17,51 @@ import io.sentry.Sentry
1917
Sentry.logger().info("A simple log message")
2018
Sentry.logger().error("A %s log message", "formatted")
2119
```
20+
21+
For more advanced use cases, like attaching custom attributes, use the `Sentry.logger().log()` methods:
22+
23+
```java {tabTitle: Java}
24+
import io.sentry.Sentry;
25+
import io.sentry.SentryAttribute;
26+
import io.sentry.SentryAttributes;
27+
import io.sentry.SentryLogLevel;
28+
import io.sentry.logger.SentryLogParameters;
29+
30+
Sentry.logger().log(
31+
SentryLogLevel.FATAL,
32+
SentryLogParameters.create(
33+
SentryAttributes.of(
34+
SentryAttribute.stringAttribute("my.string-attribute", "some-value"),
35+
SentryAttribute.booleanAttribute("my.bool-attribute", true),
36+
SentryAttribute.integerAttribute("my.int-attribute", 42),
37+
SentryAttribute.doubleAttribute("my.double-attribute", 3.12),
38+
SentryAttribute.named("my.attribute", new Point(1, 2))
39+
)
40+
),
41+
"log message %s",
42+
"param1"
43+
);
44+
```
45+
46+
```kotlin {tabTitle: Kotlin}
47+
import io.sentry.Sentry
48+
import io.sentry.SentryAttribute
49+
import io.sentry.SentryAttributes
50+
import io.sentry.SentryLogLevel
51+
import io.sentry.logger.SentryLogParameters
52+
53+
Sentry.logger().log(
54+
SentryLogLevel.FATAL,
55+
SentryLogParameters.create(
56+
SentryAttributes.of(
57+
SentryAttribute.stringAttribute("my.string-attribute", "some-value"),
58+
SentryAttribute.booleanAttribute("my.bool-attribute", true),
59+
SentryAttribute.integerAttribute("my.int-attribute", 42),
60+
SentryAttribute.doubleAttribute("my.double-attribute", 3.12),
61+
SentryAttribute.named("my.attribute", Point(1, 2))
62+
)
63+
),
64+
"log message %s",
65+
"param1"
66+
)
67+
```

platform-includes/logs/usage/java.mdx

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ Once the feature is enabled on the SDK and the SDK is initialized, you can send
22

33
The `Sentry.logger()` namespace exposes six methods that you can use to log messages at different log levels: `trace`, `debug`, `info`, `warn`, `error`, and `fatal`.
44

5-
For more advanced use cases, use the `Sentry.logger().log()` methods.
6-
75
These properties will be sent to Sentry, and can be searched from within the Logs UI, and even added to the Logs views as a dedicated column.
86

97
```java {tabTitle: Java}
@@ -19,3 +17,51 @@ import io.sentry.Sentry
1917
Sentry.logger().info("A simple log message")
2018
Sentry.logger().error("A %s log message", "formatted")
2119
```
20+
21+
For more advanced use cases, like attaching custom attributes, use the `Sentry.logger().log()` methods:
22+
23+
```java {tabTitle: Java}
24+
import io.sentry.Sentry;
25+
import io.sentry.SentryAttribute;
26+
import io.sentry.SentryAttributes;
27+
import io.sentry.SentryLogLevel;
28+
import io.sentry.logger.SentryLogParameters;
29+
30+
Sentry.logger().log(
31+
SentryLogLevel.FATAL,
32+
SentryLogParameters.create(
33+
SentryAttributes.of(
34+
SentryAttribute.stringAttribute("my.string-attribute", "some-value"),
35+
SentryAttribute.booleanAttribute("my.bool-attribute", true),
36+
SentryAttribute.integerAttribute("my.int-attribute", 42),
37+
SentryAttribute.doubleAttribute("my.double-attribute", 3.12),
38+
SentryAttribute.named("my.attribute", new Point(1, 2))
39+
)
40+
),
41+
"log message %s",
42+
"param1"
43+
);
44+
```
45+
46+
```kotlin {tabTitle: Kotlin}
47+
import io.sentry.Sentry
48+
import io.sentry.SentryAttribute
49+
import io.sentry.SentryAttributes
50+
import io.sentry.SentryLogLevel
51+
import io.sentry.logger.SentryLogParameters
52+
53+
Sentry.logger().log(
54+
SentryLogLevel.FATAL,
55+
SentryLogParameters.create(
56+
SentryAttributes.of(
57+
SentryAttribute.stringAttribute("my.string-attribute", "some-value"),
58+
SentryAttribute.booleanAttribute("my.bool-attribute", true),
59+
SentryAttribute.integerAttribute("my.int-attribute", 42),
60+
SentryAttribute.doubleAttribute("my.double-attribute", 3.12),
61+
SentryAttribute.named("my.attribute", Point(1, 2))
62+
)
63+
),
64+
"log message %s",
65+
"param1"
66+
)
67+
```

0 commit comments

Comments
 (0)