getsentry / getsentry/sentry-javascript

Allow to send session sessions when using a client manually

未关闭
#14,804 16 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Browser Feature
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
515

描述

### Is there an existing issue for this?

- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [x] I have reviewed the documentation https://docs.sentry.io/
- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

### How do you use Sentry?

Sentry Saas (sentry.io)

### Which SDK are you using?

@sentry/browser

### SDK Version

"@sentry/browser": "^8.47.0"

### Framework Version

_No response_

### Link to Sentry event

_No response_

### Reproduction Example/SDK Setup

```
import {
BrowserClient,
defaultStackParser,
getDefaultIntegrations,
browserSessionIntegration,
makeFetchTransport,
Scope,
} from "@sentry/browser";

// filter integrations that use the global variable
const integrations = getDefaultIntegrations({}).filter(
(defaultIntegration) => {
return !["BrowserApiErrors", "Breadcrumbs", "GlobalHandlers"].includes(
defaultIntegration.name,
);
},
);

const client = new BrowserClient({
dsn: "...",
transport: makeFetchTransport,
stackParser: defaultStackParser,
integrations: [ ...integrations, browserSessionIntegration()],
release:"directClient@1.0.0",
autoSessionTracking:true,
initialScope: {
user: { id: 42, email: "john.doe@example.com" },
},
});

const scope = new Scope();
scope.setClient(client);

client.init(); // initializing has to be done after setting the client on the scope
// rest of the logic
```

### Steps to Reproduce

1. Run a simple app with the configuration above

### Expected Result

The SDK sends release health sessions to Sentry to track release health and adoption on the Releases page.

### Actual Result

No release session event is sent to Sentry.

Explicitly setting the `browserSessionIntegration` integration and/or `autoSessionTracking` have no effect on the result, this should also be automatic when a release version is set in the init as per:
- https://docs.sentry.io/platforms/javascript/configuration/releases/#release-health

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。