Skip to content

feat(dotnet): skip injection .NET OTel packages installed#324

Merged
mmanciop merged 1 commit intoopen-telemetry:mainfrom
matt-hensley:dotnet-checks
Apr 27, 2026
Merged

feat(dotnet): skip injection .NET OTel packages installed#324
mmanciop merged 1 commit intoopen-telemetry:mainfrom
matt-hensley:dotnet-checks

Conversation

@matt-hensley
Copy link
Copy Markdown
Contributor

@matt-hensley matt-hensley commented Apr 20, 2026

Fixes #267

Makes .NET injection more conservative by skipping auto-instrumentation when the target app already references OpenTelemetry packages.

The injector inspects the *.deps.json file of the target application when it is available. If the dependency graph already includes OpenTelemetry*, the injector skips adding .NET auto-instrumentation environment.

@matt-hensley matt-hensley changed the title feat(dotnet): skip injection for incompatible TFMs & OTel packages installed feat(dotnet): skip injection .NET OTel packages installed Apr 22, 2026
@matt-hensley matt-hensley marked this pull request as ready for review April 22, 2026 14:42
@matt-hensley matt-hensley requested a review from a team as a code owner April 22, 2026 14:42
Copy link
Copy Markdown
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Copy Markdown
Contributor

@mmanciop mmanciop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not prevent injection is the app has an OpenTelemetry API package only.

Copy link
Copy Markdown
Contributor

@mmanciop mmanciop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.nuget.org/packages/OpenTelemetry.Api should not prevent injection.

Copy link
Copy Markdown
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work @matt-hensley!

I just have one question related to the comment @mmanciop made, based on the latest fix to address the inclusion of the OpenTelemetry.Api package as allowed one, does that mean that if I have "OpenTelemetry.Extensions.Hosting/1.11.0" I also must have "OpenTelemetry/1.11.0" in the dependencies?

@martincostello
Copy link
Copy Markdown
Member

@grcevski Yep, it's a dependency of OpenTelemetry.Extensions.Hosting.

Copy link
Copy Markdown
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@matt-hensley
Copy link
Copy Markdown
Contributor Author

These are the *.deps.json files used. Looking at adding integration tests in a follow-up PR.

Bare
{
  "runtimeTarget": {
    "name": ".NETCoreApp,Version=v9.0",
    "signature": ""
  },
  "compilationOptions": {},
  "targets": {
    ".NETCoreApp,Version=v9.0": {
      "injector-deps/1.0.0": {
        "runtime": {
          "injector-deps.dll": {}
        }
      }
    }
  },
  "libraries": {
    "injector-deps/1.0.0": {
      "type": "project",
      "serviceable": false,
      "sha512": ""
    }
  }
}
With OpenTelemetry.Extensions.Api
{
  "runtimeTarget": {
    "name": ".NETCoreApp,Version=v9.0",
    "signature": ""
  },
  "compilationOptions": {},
  "targets": {
    ".NETCoreApp,Version=v9.0": {
      "injector-deps/1.0.0": {
        "dependencies": {
          "OpenTelemetry.Api": "1.15.3"
        },
        "runtime": {
          "injector-deps.dll": {}
        }
      },
      "OpenTelemetry.Api/1.15.3": {
        "dependencies": {
          "System.Diagnostics.DiagnosticSource": "10.0.0"
        },
        "runtime": {
          "lib/net9.0/OpenTelemetry.Api.dll": {
            "assemblyVersion": "1.0.0.0",
            "fileVersion": "1.15.3.2017"
          }
        }
      },
      "System.Diagnostics.DiagnosticSource/10.0.0": {
        "runtime": {
          "lib/net9.0/System.Diagnostics.DiagnosticSource.dll": {
            "assemblyVersion": "10.0.0.0",
            "fileVersion": "10.0.25.52411"
          }
        }
      }
    }
  },
  "libraries": {
    "injector-deps/1.0.0": {
      "type": "project",
      "serviceable": false,
      "sha512": ""
    },
    "OpenTelemetry.Api/1.15.3": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-fX+fkCysfPut+qCcT3bKqyX4QN9Saf4CgX8HLOHywEVD+Xr7sULtfuypITpoDysjx8R59dn/3mWhgimMH8cm/g==",
      "path": "opentelemetry.api/1.15.3",
      "hashPath": "opentelemetry.api.1.15.3.nupkg.sha512"
    },
    "System.Diagnostics.DiagnosticSource/10.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-0KdBK+h7G13PuOSC2R/DalAoFMvdYMznvGRuICtkdcUMXgl/gYXsG6z4yUvTxHSMACorWgHCU1Faq0KUHU6yAQ==",
      "path": "system.diagnostics.diagnosticsource/10.0.0",
      "hashPath": "system.diagnostics.diagnosticsource.10.0.0.nupkg.sha512"
    }
  }
}
With OpenTelemetry.Extensions.Hosting
{
  "runtimeTarget": {
    "name": ".NETCoreApp,Version=v9.0",
    "signature": ""
  },
  "compilationOptions": {},
  "targets": {
    ".NETCoreApp,Version=v9.0": {
      "injector-deps/1.0.0": {
        "dependencies": {
          "OpenTelemetry.Extensions.Hosting": "1.15.3"
        },
        "runtime": {
          "injector-deps.dll": {}
        }
      },
      "Microsoft.Extensions.Configuration/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.Configuration.Abstractions": "9.0.0",
          "Microsoft.Extensions.Primitives": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Configuration.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Configuration.Abstractions/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.Primitives": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Configuration.Binder/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.Configuration.Abstractions": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Configuration.Binder.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.DependencyInjection/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.DependencyInjection.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.DependencyInjection.Abstractions/9.0.0": {
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Diagnostics.Abstractions/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0",
          "Microsoft.Extensions.Options": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Diagnostics.Abstractions.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.FileProviders.Abstractions/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.Primitives": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Hosting.Abstractions/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.Configuration.Abstractions": "9.0.0",
          "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0",
          "Microsoft.Extensions.Diagnostics.Abstractions": "9.0.0",
          "Microsoft.Extensions.FileProviders.Abstractions": "9.0.0",
          "Microsoft.Extensions.Logging.Abstractions": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Hosting.Abstractions.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Logging/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.DependencyInjection": "9.0.0",
          "Microsoft.Extensions.Logging.Abstractions": "9.0.0",
          "Microsoft.Extensions.Options": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Logging.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Logging.Abstractions/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Logging.Abstractions.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Logging.Configuration/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.Configuration": "9.0.0",
          "Microsoft.Extensions.Configuration.Abstractions": "9.0.0",
          "Microsoft.Extensions.Configuration.Binder": "9.0.0",
          "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0",
          "Microsoft.Extensions.Logging": "9.0.0",
          "Microsoft.Extensions.Logging.Abstractions": "9.0.0",
          "Microsoft.Extensions.Options": "9.0.0",
          "Microsoft.Extensions.Options.ConfigurationExtensions": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Logging.Configuration.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Options/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0",
          "Microsoft.Extensions.Primitives": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Options.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Options.ConfigurationExtensions/9.0.0": {
        "dependencies": {
          "Microsoft.Extensions.Configuration.Abstractions": "9.0.0",
          "Microsoft.Extensions.Configuration.Binder": "9.0.0",
          "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0",
          "Microsoft.Extensions.Options": "9.0.0",
          "Microsoft.Extensions.Primitives": "9.0.0"
        },
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Options.ConfigurationExtensions.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "Microsoft.Extensions.Primitives/9.0.0": {
        "runtime": {
          "lib/net9.0/Microsoft.Extensions.Primitives.dll": {
            "assemblyVersion": "9.0.0.0",
            "fileVersion": "9.0.24.52809"
          }
        }
      },
      "OpenTelemetry/1.15.3": {
        "dependencies": {
          "Microsoft.Extensions.Diagnostics.Abstractions": "9.0.0",
          "Microsoft.Extensions.Logging.Configuration": "9.0.0",
          "OpenTelemetry.Api.ProviderBuilderExtensions": "1.15.3"
        },
        "runtime": {
          "lib/net9.0/OpenTelemetry.dll": {
            "assemblyVersion": "1.0.0.0",
            "fileVersion": "1.15.3.2017"
          }
        }
      },
      "OpenTelemetry.Api/1.15.3": {
        "dependencies": {
          "System.Diagnostics.DiagnosticSource": "10.0.0"
        },
        "runtime": {
          "lib/net9.0/OpenTelemetry.Api.dll": {
            "assemblyVersion": "1.0.0.0",
            "fileVersion": "1.15.3.2017"
          }
        }
      },
      "OpenTelemetry.Api.ProviderBuilderExtensions/1.15.3": {
        "dependencies": {
          "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0",
          "OpenTelemetry.Api": "1.15.3"
        },
        "runtime": {
          "lib/net9.0/OpenTelemetry.Api.ProviderBuilderExtensions.dll": {
            "assemblyVersion": "1.0.0.0",
            "fileVersion": "1.15.3.2017"
          }
        }
      },
      "OpenTelemetry.Extensions.Hosting/1.15.3": {
        "dependencies": {
          "Microsoft.Extensions.Hosting.Abstractions": "9.0.0",
          "OpenTelemetry": "1.15.3"
        },
        "runtime": {
          "lib/net9.0/OpenTelemetry.Extensions.Hosting.dll": {
            "assemblyVersion": "1.0.0.0",
            "fileVersion": "1.15.3.2017"
          }
        }
      },
      "System.Diagnostics.DiagnosticSource/10.0.0": {
        "runtime": {
          "lib/net9.0/System.Diagnostics.DiagnosticSource.dll": {
            "assemblyVersion": "10.0.0.0",
            "fileVersion": "10.0.25.52411"
          }
        }
      }
    }
  },
  "libraries": {
    "injector-deps/1.0.0": {
      "type": "project",
      "serviceable": false,
      "sha512": ""
    },
    "Microsoft.Extensions.Configuration/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-YIMO9T3JL8MeEXgVozKt2v79hquo/EFtnY0vgxmLnUvk1Rei/halI7kOWZL2RBeV9FMGzgM9LZA8CVaNwFMaNA==",
      "path": "microsoft.extensions.configuration/9.0.0",
      "hashPath": "microsoft.extensions.configuration.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Configuration.Abstractions/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-lqvd7W3FGKUO1+ZoUEMaZ5XDJeWvjpy2/M/ptCGz3tXLD4HWVaSzjufsAsjemasBEg+2SxXVtYVvGt5r2nKDlg==",
      "path": "microsoft.extensions.configuration.abstractions/9.0.0",
      "hashPath": "microsoft.extensions.configuration.abstractions.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Configuration.Binder/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-RiScL99DcyngY9zJA2ROrri7Br8tn5N4hP4YNvGdTN/bvg1A3dwvDOxHnNZ3Im7x2SJ5i4LkX1uPiR/MfSFBLQ==",
      "path": "microsoft.extensions.configuration.binder/9.0.0",
      "hashPath": "microsoft.extensions.configuration.binder.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.DependencyInjection/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-MCPrg7v3QgNMr0vX4vzRXvkNGgLg8vKWX0nKCWUxu2uPyMsaRgiRc1tHBnbTcfJMhMKj2slE/j2M9oGkd25DNw==",
      "path": "microsoft.extensions.dependencyinjection/9.0.0",
      "hashPath": "microsoft.extensions.dependencyinjection.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.DependencyInjection.Abstractions/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-+6f2qv2a3dLwd5w6JanPIPs47CxRbnk+ZocMJUhv9NxP88VlOcJYZs9jY+MYSjxvady08bUZn6qgiNh7DadGgg==",
      "path": "microsoft.extensions.dependencyinjection.abstractions/9.0.0",
      "hashPath": "microsoft.extensions.dependencyinjection.abstractions.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Diagnostics.Abstractions/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-1K8P7XzuzX8W8pmXcZjcrqS6x5eSSdvhQohmcpgiQNY/HlDAlnrhR9dvlURfFz428A+RTCJpUyB+aKTA6AgVcQ==",
      "path": "microsoft.extensions.diagnostics.abstractions/9.0.0",
      "hashPath": "microsoft.extensions.diagnostics.abstractions.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.FileProviders.Abstractions/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-uK439QzYR0q2emLVtYzwyK3x+T5bTY4yWsd/k/ZUS9LR6Sflp8MIdhGXW8kQCd86dQD4tLqvcbLkku8qHY263Q==",
      "path": "microsoft.extensions.fileproviders.abstractions/9.0.0",
      "hashPath": "microsoft.extensions.fileproviders.abstractions.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Hosting.Abstractions/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-yUKJgu81ExjvqbNWqZKshBbLntZMbMVz/P7Way2SBx7bMqA08Mfdc9O7hWDKAiSp+zPUGT6LKcSCQIPeDK+CCw==",
      "path": "microsoft.extensions.hosting.abstractions/9.0.0",
      "hashPath": "microsoft.extensions.hosting.abstractions.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Logging/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-crjWyORoug0kK7RSNJBTeSE6VX8IQgLf3nUpTB9m62bPXp/tzbnOsnbe8TXEG0AASNaKZddnpHKw7fET8E++Pg==",
      "path": "microsoft.extensions.logging/9.0.0",
      "hashPath": "microsoft.extensions.logging.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Logging.Abstractions/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-g0UfujELzlLbHoVG8kPKVBaW470Ewi+jnptGS9KUi6jcb+k2StujtK3m26DFSGGwQ/+bVgZfsWqNzlP6YOejvw==",
      "path": "microsoft.extensions.logging.abstractions/9.0.0",
      "hashPath": "microsoft.extensions.logging.abstractions.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Logging.Configuration/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-H05HiqaNmg6GjH34ocYE9Wm1twm3Oz2aXZko8GTwGBzM7op2brpAA8pJ5yyD1OpS1mXUtModBYOlcZ/wXeWsSg==",
      "path": "microsoft.extensions.logging.configuration/9.0.0",
      "hashPath": "microsoft.extensions.logging.configuration.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Options/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-y2146b3jrPI3Q0lokKXdKLpmXqakYbDIPDV6r3M8SqvSf45WwOTzkyfDpxnZXJsJQEpAsAqjUq5Pu8RCJMjubg==",
      "path": "microsoft.extensions.options/9.0.0",
      "hashPath": "microsoft.extensions.options.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Options.ConfigurationExtensions/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-Ob3FXsXkcSMQmGZi7qP07EQ39kZpSBlTcAZLbJLdI4FIf0Jug8biv2HTavWmnTirchctPlq9bl/26CXtQRguzA==",
      "path": "microsoft.extensions.options.configurationextensions/9.0.0",
      "hashPath": "microsoft.extensions.options.configurationextensions.9.0.0.nupkg.sha512"
    },
    "Microsoft.Extensions.Primitives/9.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-N3qEBzmLMYiASUlKxxFIISP4AiwuPTHF5uCh+2CWSwwzAJiIYx0kBJsS30cp1nvhSySFAVi30jecD307jV+8Kg==",
      "path": "microsoft.extensions.primitives/9.0.0",
      "hashPath": "microsoft.extensions.primitives.9.0.0.nupkg.sha512"
    },
    "OpenTelemetry/1.15.3": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-N0i6WjPoHPbZyms1ugbDIFAJFuGlpeExJMU/+XSL0lQRUkg/D0utFkDoLXf8Z1km5B+xVZ2GyMXXiX8qdeNmPg==",
      "path": "opentelemetry/1.15.3",
      "hashPath": "opentelemetry.1.15.3.nupkg.sha512"
    },
    "OpenTelemetry.Api/1.15.3": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-fX+fkCysfPut+qCcT3bKqyX4QN9Saf4CgX8HLOHywEVD+Xr7sULtfuypITpoDysjx8R59dn/3mWhgimMH8cm/g==",
      "path": "opentelemetry.api/1.15.3",
      "hashPath": "opentelemetry.api.1.15.3.nupkg.sha512"
    },
    "OpenTelemetry.Api.ProviderBuilderExtensions/1.15.3": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-SYn0lqYDwLMWhv/zlNGsQcl2yX++yTumanX46bmOZE/ZDOd1WjPBO2kZaZgKLEZTZk48pavIFGJ6vOvxXgWVFQ==",
      "path": "opentelemetry.api.providerbuilderextensions/1.15.3",
      "hashPath": "opentelemetry.api.providerbuilderextensions.1.15.3.nupkg.sha512"
    },
    "OpenTelemetry.Extensions.Hosting/1.15.3": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-u8n/W8yIlqv0BXZmvId1iVaeWXG42tGKdTkuLYg5g57Y/r9CeUNzqtrSHNdG5IoO8iPX79w3v+WsbAHgUQbfeg==",
      "path": "opentelemetry.extensions.hosting/1.15.3",
      "hashPath": "opentelemetry.extensions.hosting.1.15.3.nupkg.sha512"
    },
    "System.Diagnostics.DiagnosticSource/10.0.0": {
      "type": "package",
      "serviceable": true,
      "sha512": "sha512-0KdBK+h7G13PuOSC2R/DalAoFMvdYMznvGRuICtkdcUMXgl/gYXsG6z4yUvTxHSMACorWgHCU1Faq0KUHU6yAQ==",
      "path": "system.diagnostics.diagnosticsource/10.0.0",
      "hashPath": "system.diagnostics.diagnosticsource.10.0.0.nupkg.sha512"
    }
  }
}

@matt-hensley matt-hensley requested a review from mmanciop April 24, 2026 21:01
@grcevski
Copy link
Copy Markdown
Contributor

@matt-hensley and @martincostello from the SIG call we had today, there was a question, is it possible that the OTEL API package (that's now allowed) to break application still if it's incompatible with the auto injected SDK? If that's the case maybe disallowing all OTEL packages is better, but if the likelihood is small then we can keep it as is.

@mmanciop
Copy link
Copy Markdown
Contributor

@matt-hensley and @martincostello from the SIG call we had today, there was a question, is it possible that the OTEL API package (that's now allowed) to break application still if it's incompatible with the auto injected SDK? If that's the case maybe disallowing all OTEL packages is better, but if the likelihood is small then we can keep it as is.

I have never heard of an API package being incompatible with the SDK tbh.

@grcevski
Copy link
Copy Markdown
Contributor

@matt-hensley and @martincostello from the SIG call we had today, there was a question, is it possible that the OTEL API package (that's now allowed) to break application still if it's incompatible with the auto injected SDK? If that's the case maybe disallowing all OTEL packages is better, but if the likelihood is small then we can keep it as is.

I have never heard of an API package being incompatible with the SDK tbh.

@basti1302 on the call mentioned that he experienced issues while writing similar logic for Python.

@mmanciop
Copy link
Copy Markdown
Contributor

@matt-hensley and @martincostello from the SIG call we had today, there was a question, is it possible that the OTEL API package (that's now allowed) to break application still if it's incompatible with the auto injected SDK? If that's the case maybe disallowing all OTEL packages is better, but if the likelihood is small then we can keep it as is.

I have never heard of an API package being incompatible with the SDK tbh.

@basti1302 on the call mentioned that he experienced issues while writing similar logic for Python.

Yes but Python is a bit special. I specifically meant .NET :-)

@grcevski
Copy link
Copy Markdown
Contributor

Yes but Python is a bit special. I specifically meant .NET :-)

I see, OK. Does the change look good to you know? We can't merge even with 2 approvals because we still have your pending changes requested. Matt updated the code to allow OpenTelemetryApi.

@mmanciop
Copy link
Copy Markdown
Contributor

Yes but Python is a bit special. I specifically meant .NET :-)

I see, OK. Does the change look good to you know? We can't merge even with 2 approvals because we still have your pending changes requested. Matt updated the code to allow OpenTelemetryApi.

Let me try to break it with some preposterous combination of API and SDK. If I don't manage in the next 30m, I'll approve :-)

@mmanciop
Copy link
Copy Markdown
Contributor

Yes but Python is a bit special. I specifically meant .NET :-)

I see, OK. Does the change look good to you know? We can't merge even with 2 approvals because we still have your pending changes requested. Matt updated the code to allow OpenTelemetryApi.

Let me try to break it with some preposterous combination of API and SDK. If I don't manage in the next 30m, I'll approve :-)

Well, I was very wrong. There are combinations that break like a brick, especially with Older API + newer SDK. And issues with Geneva + OTLP exporter. This actually makes me wonder how will it work with libraries using native .NET instrumentation. I will force-push to the state where it denied injection if any OTel package was present, and will merge. With many apologies to @matt-hensley for the extra work.

@mmanciop mmanciop enabled auto-merge (squash) April 27, 2026 19:31
@mmanciop mmanciop merged commit 8c1c03a into open-telemetry:main Apr 27, 2026
37 checks passed
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.

Avoid double instrumentation in .NET

5 participants