Skip to content

[bug] OtlpExporterOptions configuration is inconsistent when deployed on IIS #6989

@novelhawk

Description

@novelhawk

Package

OpenTelemetry.Exporter.OpenTelemetryProtocol

Package Version

Package Name Version
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.15.0
OpenTelemetry.Extensions.Hosting 1.15.0

Runtime Version

net10.0

Description

Configuring the OtlpExporter through builder.Services.Configure<OtlpExporterOptions>(...) works when running locally through Kestrel but when running on IIS InProcess (with the default web.config of dotnet publish) the configuration does not get applied.
I've reproduced this error in two different PCs, both with no environment variables that could affect this.

Steps to Reproduce

  • Use builder.Services.Configure<OtlpExporterOptions>(builder.Configuration.GetSection("OpenTelemetry")) to configure OtlpExporterOptions.
  • Build the application with dotnet publish -c Release -o build
  • Deploy the application on IIS:
    • Create AppPool with No Managed Code
    • Add a new Application with the path to the build directory
    • Configure permissions for the build directory (for example by adding Everyone and granting full control)
  • Execute the root / endpoint

OtelExporterMinimalExample.zip

Expected Result

The endpoint should return the same value, read from the appsettings.json, for both Kestrel and IIS deployed applications, in this case http://172.16.0.10:4317

Actual Result

The IIS deployed application replies with http://localhost:4317 (and the Otlp exporter does not contact the http://172.16.0.10:4317 endpoint)

Additional Context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageNew issues which have not been classified or triaged by a community memberpkg:OpenTelemetry.Exporter.OpenTelemetryProtocolIssues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions