From cd17c225e8d701ffcbdd776af09d13bde21192b7 Mon Sep 17 00:00:00 2001 From: Allan Ritchie Date: Tue, 18 Feb 2025 10:37:31 -0500 Subject: [PATCH 1/4] Update azure functions with new easier overload --- .../guides/azure-functions-worker/index.mdx | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx index 8a0a44c1fa1ba..4e9c805c3ae47 100644 --- a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx +++ b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx @@ -33,6 +33,24 @@ This package extends [Sentry.Extensions.Logging](/platforms/dotnet/guides/extens Sentry integration with Azure Functions is done by calling `.UseSentry()` and specifying the options, for example: +```csharp {"onboardingOptions": {"performance": "11-13"}} +using Microsoft.Azure.Functions.Worker.Builder; +using Microsoft.Extensions.Hosting; + +var builder = FunctionsApplication.CreateBuilder(args); + +builder.UseSentry(host, options => +{ + options.Dsn = "___PUBLIC_DSN___"; + // When configuring for the first time, to see what the SDK is doing: + options.Debug = true; + // Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring. + // We recommend adjusting this value in production. + options.TracesSampleRate = 1.0; +}); + +builder.Build().Run(); +``` @@ -40,7 +58,7 @@ If using the ASP.NET Core integration add `UseSentry` to the `ConfigureFunctions -```csharp {"onboardingOptions": {"performance": "11-13"}} +```csharp using Sentry.Azure.Functions.Worker; var host = new HostBuilder() From 27569f4ae0154b0e63247af821796b537bd5ce0c Mon Sep 17 00:00:00 2001 From: Allan Ritchie Date: Tue, 18 Feb 2025 10:42:04 -0500 Subject: [PATCH 2/4] Update index.mdx --- docs/platforms/dotnet/guides/azure-functions-worker/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx index 4e9c805c3ae47..8c8186ebbf078 100644 --- a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx +++ b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx @@ -39,7 +39,7 @@ using Microsoft.Extensions.Hosting; var builder = FunctionsApplication.CreateBuilder(args); -builder.UseSentry(host, options => +builder.UseSentry(options => { options.Dsn = "___PUBLIC_DSN___"; // When configuring for the first time, to see what the SDK is doing: From f6a17f81fb6812594d6e25fceddde7609bee11ed Mon Sep 17 00:00:00 2001 From: Allan Ritchie Date: Tue, 18 Feb 2025 10:43:13 -0500 Subject: [PATCH 3/4] Update index.mdx --- docs/platforms/dotnet/guides/azure-functions-worker/index.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx index 8c8186ebbf078..9bc3cfc2126b1 100644 --- a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx +++ b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx @@ -34,6 +34,7 @@ This package extends [Sentry.Extensions.Logging](/platforms/dotnet/guides/extens Sentry integration with Azure Functions is done by calling `.UseSentry()` and specifying the options, for example: ```csharp {"onboardingOptions": {"performance": "11-13"}} +using Sentry.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Builder; using Microsoft.Extensions.Hosting; From ceab290153b30b380ef6e82a5313aa1c0e2b11db Mon Sep 17 00:00:00 2001 From: Allan Ritchie Date: Tue, 18 Feb 2025 10:44:50 -0500 Subject: [PATCH 4/4] Remove other namespaces --- docs/platforms/dotnet/guides/azure-functions-worker/index.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx index 9bc3cfc2126b1..68063ab43a853 100644 --- a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx +++ b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx @@ -35,8 +35,6 @@ Sentry integration with Azure Functions is done by calling `.UseSentry()` and sp ```csharp {"onboardingOptions": {"performance": "11-13"}} using Sentry.Azure.Functions.Worker; -using Microsoft.Azure.Functions.Worker.Builder; -using Microsoft.Extensions.Hosting; var builder = FunctionsApplication.CreateBuilder(args);