Repository navigation
Commit b8e03d4
docs(dotnet): Use the OTLP exporter in the Azure Functions guide (#19959)
<!-- Keep the urgency section so automation can prioritize this PR. You
may delete other sections you don't need. -->
## DESCRIBE YOUR PR
The Azure Functions (isolated worker) guide sets up tracing with
`TracerProviderBuilder.AddSentry()` and
`SentryOptions.UseOpenTelemetry()` from `Sentry.OpenTelemetry`. Both
have been obsolete since sentry-dotnet 6.12.0, so anyone following the
guide gets obsolete warnings. The guide now uses the OTLP exporter, as
the `Sentry.Samples.OpenTelemetry.AzureFunctions` sample does:
- Install `Sentry.OpenTelemetry.Exporter` instead of
`Sentry.OpenTelemetry`. `OpenTelemetry` is no longer listed because it
comes in transitively. The Package Manager tab now lists the two
OpenTelemetry packages it was missing.
- `AddSentryOtlpExporter(dsn)` and `UseOtlp()` replace `AddSentry()` and
`UseOpenTelemetry()`. The tracing sentence now links to the
OpenTelemetry (OTLP) page.
- The "enabling tracing" link under Features pointed at the generic
tracing concepts page. It now goes to the .NET OpenTelemetry (OTLP) page
too.
Closes getsentry/sentry-dotnet#5715
### Notes for review
- The snippet drops `TracesSampleRate` and
`DisableSentryHttpMessageHandler`, which the sample still sets. Under
`UseOtlp()` Sentry creates no transactions of its own, so
`TracesSampleRate` has no effect, and the OTLP page already says not to
set it. `SentryHttpMessageHandler` already skips span creation under
`UseOtlp()`. Against 6.12.1, an `IHttpClientFactory` request sent with
the handler on still carries a single `sentry-trace` value, and it
matches `traceparent`.
- The snippet's error-monitoring-only variant didn't compile. `using
OpenTelemetry;` and `using Sentry.OpenTelemetry;` sat outside the
performance block, but only the performance option installs those
packages. Neither is needed now: `AddSentryOtlpExporter` lives in
`OpenTelemetry.Trace`, and `UseOtlp` lives in `Sentry`, which the SDK
adds as an implicit using. The snippet now includes `using
Microsoft.Extensions.DependencyInjection;`, which `AddOpenTelemetry()`
needs.
- Both variants of the snippet compile without warnings against Sentry
6.12.1, using the Functions template's `ImplicitUsings`.
- #19925 (merges at 7.0.0 GA) makes the same OTLP
changes on this page, and also moves the options into `SentrySdk.Init`.
When it merges `master` it will conflict in the `logging.AddSentry`
block and on the tracing sentence. That sentence is reworded here into
active voice.
## IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs
to go live.
Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the
due date. You can update this information later by editing the PR
description.
- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 136020d commit b8e03d4
1 file changed
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 79 | + | |
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
89 | 86 | | |
90 | 87 | | |
91 | 88 | | |
| |||
0 commit comments