Skip to content

Commit 15d1cb3

Browse files
Flash0verjamescrosswell
authored andcommitted
docs(dotnet): stable Metrics APIs (#16932)
## DESCRIBE YOUR PR With the next release of the Sentry .NET SDK - expected to be `v6.3.0` - the Metrics APIs are no longer `Experimental`. This changeset updates the respective C# code snippets. Related PRs: - getsentry/sentry-dotnet#5023 - getsentry/sentry#110636 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [x] Other deadline: Release of the Sentry .NET SDK v6.3.0 - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [x] Checked Vercel preview for correctness, including links - [x] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [x] @jamescrosswell - [x] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
1 parent e15a22f commit 15d1cb3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

platform-includes/metrics/options/dotnet.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#### EnableMetrics
22

3-
Set to `false` in order to disable the `SentrySdk.Experimental.Metrics` APIs.
3+
Set to `false` in order to disable the `SentrySdk.Metrics` APIs.
44

55
#### SetBeforeSendMetric
66

@@ -10,7 +10,7 @@ To filter metrics, or update them before they are sent to Sentry, you can use th
1010
SentrySdk.Init(options =>
1111
{
1212
options.Dsn = "___PUBLIC_DSN___";
13-
options.Experimental.SetBeforeSendMetric(static metric =>
13+
options.SetBeforeSendMetric(static metric =>
1414
{
1515
if (metric.Name == "removed-metric")
1616
{

platform-includes/metrics/usage/dotnet.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Metrics are enabled by default. Once you initialize the SDK, you can send metrics using the `SentrySdk.Experimental.Metrics` APIs.
1+
Metrics are enabled by default. Once you initialize the SDK, you can send metrics using the `SentrySdk.Metrics` APIs.
22

33
The `SentryMetricEmitter` type exposes three method groups that you can use to capture different types of metric information: `Counter`, `Gauge`, and `Distribution`.
44

@@ -13,7 +13,7 @@ To emit a counter, do the following:
1313

1414
```csharp
1515
// Record five total button clicks
16-
SentrySdk.Experimental.Metrics.EmitCounter("button_click", 5,
16+
SentrySdk.Metrics.EmitCounter("button_click", 5,
1717
[new KeyValuePair<string, object>("browser", "Firefox"), new KeyValuePair<string, object>("app_version", "1.0.0")]);
1818
```
1919

@@ -25,7 +25,7 @@ To emit a distribution, do the following:
2525

2626
```csharp
2727
// Add '15.0' to a distribution used for tracking the loading times per page.
28-
SentrySdk.Experimental.Metrics.EmitDistribution("page_load", 15.0, MeasurementUnit.Duration.Millisecond,
28+
SentrySdk.Metrics.EmitDistribution("page_load", 15.0, MeasurementUnit.Duration.Millisecond,
2929
[new KeyValuePair<string, object>("page", "/home")]);
3030
```
3131

@@ -37,6 +37,6 @@ To emit a gauge, do the following:
3737

3838
```csharp
3939
// Add '15.0' to a gauge used for tracking the loading times for a page.
40-
SentrySdk.Experimental.Metrics.EmitGauge("page_load", 15.0, MeasurementUnit.Duration.Millisecond,
40+
SentrySdk.Metrics.EmitGauge("page_load", 15.0, MeasurementUnit.Duration.Millisecond,
4141
[new KeyValuePair<string, object>("page", "/home")]);
4242
```

0 commit comments

Comments
 (0)