getsentry / getsentry/sentry-javascript

Allow to send session sessions when using a client manually

Đang mở
#14,804 16 bình luận 0 reaction 0 người được giao Xem trên GitHub
Browser Feature
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

### 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.