getsentry / getsentry/sentry-dotnet
Consider alternative to ObsoleteAttribute on GetInternalSentryOptions
- Dominant language
- C#
- Stars
- 770
- Forks
- 248
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 49
Description
### Description
This is a bit of a misuse of the `ObsoleteAttribute`:
https://github.com/getsentry/sentry-dotnet/blob/216bbc597a167f9d26216f968b9fc21cbff99a54/src/Sentry/SentryClientExtensions.cs#L98-L110
We could potentially replace it with this:
```csharp
[InternalApi("For internal integrations like Hangfire only")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static SentryOptions? GetInternalSentryOptions(this ISentryClient clientOrHub) =>
clientOrHub.GetSentryOptions();
```
And then also ship a Roslyn Analyzer that warns if people use something decorated with `InternalApiAttribute`.
## See also
- https://github.com/getsentry/sentry-dotnet/pull/4619#discussion_r2432364301
Contributor guide
Assessment
This issue has not been assessed yet.