getsentry / getsentry/sentry-javascript

Allow to send session sessions when using a client manually

Ouverte
#14,804 16 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Browser Feature
Langage dominant
TypeScript
Étoiles
8.7k
Forks
1.8k
Merge moyen
1 j 17 h
PR mergées (30 j)
515

Description

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.