From 844e7430ecaba95b8292197a400b8b521a092951 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 20 Nov 2024 12:23:35 +1300 Subject: [PATCH 1/2] Removed metrics documentation for dotnet --- .../platforms/dotnet/common/metrics/index.mdx | 100 ------------------ 1 file changed, 100 deletions(-) delete mode 100644 docs/platforms/dotnet/common/metrics/index.mdx diff --git a/docs/platforms/dotnet/common/metrics/index.mdx b/docs/platforms/dotnet/common/metrics/index.mdx deleted file mode 100644 index 610b23553f1fd..0000000000000 --- a/docs/platforms/dotnet/common/metrics/index.mdx +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Set Up Metrics -description: "Learn how to measure the data points you care about by configuring Metrics in your .NET app." -sidebar_order: 5500 -sidebar_hidden: true ---- - - - - - -Metrics for .NET are supported with Sentry .NET SDK version `4.0.0` and above. - - - -Sentry metrics help you pinpoint and solve issues that impact user experience and app performance by measuring the data points that are important to you. You can track things like processing time, event size, user signups, and conversion rates, then correlate them back to tracing data in order to get deeper insights and solve issues faster. - -## Initialization - -To enable metrics you have to opt-in the metrics feature. - -```csharp -SentrySdk.Init(options => -{ - options.dsn = "___DSN___"; - // Initialize some (non null) ExperimentalMetricsOptions to enable Sentry Metrics, - options.ExperimentalMetrics = new ExperimentalMetricsOptions { EnableCodeLocations = true }; -}); -``` - -## Emit a Counter - -Counters are one of the more basic types of metrics and can be used to count certain event occurrences. - -To emit a counter, do the following: - -```csharp -// Incrementing a counter by one for each button click. -SentrySdk.Metrics.Increment("ButtonClicked", - tags: new Dictionary {{ "region", "us-west-1" }} -); -``` - -## Emit a Distribution - -Distributions help you get the most insights from your data by allowing you to obtain aggregations such as `p90`, `min`, `max`, and `avg`. - -To emit a distribution, do the following: - -```csharp -// Adding '15' to a distribution used to track the loading time. -SentrySdk.Metrics.Distribution("LoadingTime", - 15, - unit: MeasurementUnit.Duration.Millisecond, - tags: new Dictionary {{ "region", "us-west-1" }} -); -``` - -## Emit a Set - -Sets are useful for looking at unique occurrences and counting the unique elements you added. - -To emit a set, do the following: - -```csharp -// Adding a set of unique occurrences. -SentrySdk.Metrics.Set("UserView", "Rufus", - unit: MeasurementUnit.Custom("username"), - tags: new Dictionary {{ "region", "us-west-1" }} -); -``` - -## Emit a Gauge - -Gauges let you obtain aggregates like `min`, `max`, `avg`, `sum`, and `count`. They can be represented in a more space-efficient way than distributions, but they can't be used to get percentiles. If percentiles aren't important to you, we recommend using gauges. - -To emit a gauge, do the following: - -```csharp -// Adding '15' to a gauge used to track the loading time. -SentrySdk.Metrics.Gauge("LoadingTime", - 15, - unit: MeasurementUnit.Duration.Millisecond, - tags: new Dictionary {{ "region", "us-west-1" }} -); -``` - -## Emit a Timer - -Timers can be used to measure the execution time of a specific block of code. They're implemented like distributions, but measured in seconds. - -To emit a timer, do the following: - -```csharp -// Measure the time of execution within the using block -using (SentrySdk.Metrics.StartTimer("bingo")) -{ - // Your code goes here -} -``` From 9171775a738bca6db4fe27d3e884d4d3cd9c0a35 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Mon, 25 Nov 2024 10:55:50 +1300 Subject: [PATCH 2/2] Update metrics-set-up.mdx --- docs/product/explore/metrics/metrics-set-up.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/product/explore/metrics/metrics-set-up.mdx b/docs/product/explore/metrics/metrics-set-up.mdx index d16f673de5d51..323ff328c806b 100644 --- a/docs/product/explore/metrics/metrics-set-up.mdx +++ b/docs/product/explore/metrics/metrics-set-up.mdx @@ -14,7 +14,6 @@ To set up and start sending metrics, click a link for one of the supported SDKs Metrics are currently available on the following platforms: -- [.NET](/platforms/dotnet/metrics/) - [Android](/platforms/android/metrics/) - [Apple](/platforms/apple/metrics/) - [Astro](/platforms/javascript/guides/astro/metrics/)