Skip to content

Migrate from Application Insights to OpenTelemetry#31

Open
liliankasem wants to merge 3 commits intoAzure-Samples:mainfrom
liliankasem:liliankasem/refactor/migrate-to-otel
Open

Migrate from Application Insights to OpenTelemetry#31
liliankasem wants to merge 3 commits intoAzure-Samples:mainfrom
liliankasem:liliankasem/refactor/migrate-to-otel

Conversation

@liliankasem
Copy link
Copy Markdown
Member

Purpose

  • Migrate the sample from the Application Insights worker SDK to the OpenTelemetry approach for telemetry. Telemetry still flows to Application Insights via the Azure Monitor OpenTelemetry exporter.
  • Mirrors the template change in Azure/azure-functions-templates@1cc8df7.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

What to Check

  • csproj: removed Microsoft.ApplicationInsights.WorkerService and Microsoft.Azure.Functions.Worker.ApplicationInsights; added Microsoft.Azure.Functions.Worker.OpenTelemetry, OpenTelemetry.Extensions.Hosting, and Azure.Monitor.OpenTelemetry.Exporter.
  • Program.cs: replaced AddApplicationInsightsTelemetryWorkerService / ConfigureFunctionsApplicationInsights with AddOpenTelemetry().UseFunctionsWorkerDefaults().UseAzureMonitorExporter().
  • host.json: added "telemetryMode": "OpenTelemetry".
  • After deploying, telemetry continues to appear in the linked Application Insights resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants