Skip to content

feat(automation): integrate .NET instrumentation watcher#421

Open
Pittu-Sharma wants to merge 27 commits into
open-telemetry:mainfrom
Pittu-Sharma:feat/dotnet-instrumentation-watcher
Open

feat(automation): integrate .NET instrumentation watcher#421
Pittu-Sharma wants to merge 27 commits into
open-telemetry:mainfrom
Pittu-Sharma:feat/dotnet-instrumentation-watcher

Conversation

@Pittu-Sharma
Copy link
Copy Markdown
Contributor

Description

This PR establishes the foundation for tracking .NET instrumentation metadata within the OpenTelemetry Ecosystem Explorer by implementing a dedicated .NET watcher.

Since the OpenTelemetry .NET ecosystem does not use a centralized catalog API like other ecosystems, this watcher dynamically traverses the open-telemetry/opentelemetry-dotnet-contrib repository using the GitHub Git Tree API to discover .csproj files and classify them.

Resolves #101.

Changes Made

  • Created .NET Watcher: Implemented dotnet_client.py, inventory_manager.py, and instrumentation_sync.py inside ecosystem-automation/dotnet-instrumentation-watcher.
  • Registry Initialization: Scaffolded the ecosystem-registry/dotnet/ snapshot directory and enabled versioned schema generation (instrumentation.yaml).
  • CI / Automation Integration:
    • Hooked the new watcher into .github/workflows/nightly-registry-update.yml to ensure metadata stays fresh automatically.
    • Added full test coverage for the watcher and linked it to the test-ecosystem-automation runner in .github/workflows/build-and-test.yml.
  • Monorepo Stabilization: Removed conflicting __init__.py files across all watcher test suites to resolve pytest discovery errors on Windows. Patched instrumentation_transformer.py in the DB builder to prevent compilation crashes when metadata keys are missing.
  • Roadmap Documentation: Added docs/dotnet-integration-roadmap.md mapping out the database and frontend integration tasks.

Testing and Compliance

  • All 372 monorepo unit tests pass locally (uv run pytest).
  • Python code strictly adheres to project formatting and linting rules (uv run ruff check . and uv run ruff format .).
  • Missing copyright headers have been applied and checked (uv run python scripts/check_copyright.py).
  • Markdown documentation passes project standards (bun run lint:md).

@Pittu-Sharma Pittu-Sharma requested review from a team as code owners May 10, 2026 14:29
@netlify
Copy link
Copy Markdown

netlify Bot commented May 10, 2026

Deploy Preview for otel-ecosystem-explorer ready!

Name Link
🔨 Latest commit ed77be6
🔍 Latest deploy log https://app.netlify.com/projects/otel-ecosystem-explorer/deploys/6a0b941d718cb600082fd116
😎 Deploy Preview https://deploy-preview-421--otel-ecosystem-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Pittu-Sharma Pittu-Sharma force-pushed the feat/dotnet-instrumentation-watcher branch from a1ef98a to 450c83f Compare May 10, 2026 14:43
@Pittu-Sharma
Copy link
Copy Markdown
Contributor Author

Hi, @jaydeluca , Please review the PR once. If any changes are required please let me know.

Comment thread ecosystem-registry/dotnet/v1.0.0/instrumentation.yaml Outdated
Comment thread ecosystem-registry/dotnet/v1.0.0/instrumentation.yaml Outdated
Comment thread ecosystem-registry/dotnet/v1.0.1-SNAPSHOT/instrumentation.yaml Outdated
- Replace GitHub Tree discovery with NuGet owner search
- Fetch accurate package versions directly from NuGet
- Filter out deprecated packages (e.g. Instana, Jaeger)
- Use core OpenTelemetry package version for ecosystem registry snapshots
- Remove unused GITHUB_TOKEN from nightly update workflow
@Pittu-Sharma Pittu-Sharma force-pushed the feat/dotnet-instrumentation-watcher branch from 884917d to 9daeef2 Compare May 12, 2026 15:32
@Pittu-Sharma
Copy link
Copy Markdown
Contributor Author

Hi @martincostello, I've just updated the PR with the following changes:

  • NuGet V3 API Migration: Fully transitioned from GitHub Tree discovery to the NuGet V3 Search API (owner:OpenTelemetry). This ensures we only track released components and ignore internal source files.
  • Dynamic Versioning: Removed all hard-coded versions; the watcher now fetches real, package-specific versions directly from NuGet.
  • Deprecation Filtering: Implemented automatic filtering for packages marked as deprecated or legacy (such as OpenTelemetry.Exporter.Instana and OpenTelemetry.Exporter.Jaeger).
  • Ecosystem Snapshot Strategy: Registry versions are now based on the core OpenTelemetry package version.
  • Rebased: I have rebased the branch with the latest main to resolve merge conflicts and the 'out-of-date' status.
    All unit tests are passing and the registry is now populated with accurate metadata.

Thanks again for the guidance!

Comment thread ecosystem-registry/dotnet/v1.15.3/instrumentation.yaml Outdated
Comment thread ecosystem-registry/dotnet/v1.15.3/instrumentation.yaml Outdated
Comment thread ecosystem-registry/dotnet/v1.15.3/instrumentation.yaml
Comment thread ecosystem-registry/dotnet/v1.15.3+SNAPSHOT/instrumentation.yaml
@Pittu-Sharma
Copy link
Copy Markdown
Contributor Author

Hi @martincostello — thank you for the detailed review! I've addressed all the points raised. Here's a summary of what i have changed.

  1. NuGet V3 Service Index (dynamic endpoint discovery) : The client now fetches https://api.nuget.org/v3/index.json first and dynamically resolves the SearchQueryService URL from the resources array before issuing any search query. This makes the implementation forward-compatible if NuGet ever changes its endpoint URLs.
  2. Prerelease package support : Added prerelease=true to the NuGet search query so these packages are discovered and included in the registry.
  3. Filtering deprecated and OpenTelemetry.Contrib.* packages : The watcher now explicitly skips:
  • Any package whose ID starts with OpenTelemetry.Contrib. (legacy packages)
  • Any package flagged as deprecated in NuGet metadata
  1. Snapshot versioning : Snapshot versions now use the +SNAPSHOT build segment (e.g. 1.15.3+SNAPSHOT) rather than bumping the patch to produce 1.15.4-SNAPSHOT.
  2. Error handling for core version resolution : If the core version can't be resolved or returns an invalid semver string, the process now logs an explicit error and exits rather than producing a potentially incorrect registry snapshot.

Comment thread ecosystem-automation/dotnet-instrumentation-watcher/tests/test_dotnet_client.py Outdated
Comment thread ecosystem-automation/dotnet-instrumentation-watcher/tests/test_dotnet_client.py Outdated
Comment thread ecosystem-registry/dotnet/v1.15.3+SNAPSHOT/instrumentation.yaml Outdated
Comment thread ecosystem-registry/dotnet/v1.15.3/instrumentation.yaml Outdated
- NuGet V3 Service Index (dynamic endpoint discovery)
- Error on service index failure instead of fallback
- Remove 1.0.0 version fallback; raise NuGetAPIError
- Filter deprecated packages using NuGet metadata (covers .Contrib)
- Correct version sorting by using top-level version field
- Add prerelease package support in tests
- Restore 'primary' variant to GlowBadge for UI compatibility
@Pittu-Sharma
Copy link
Copy Markdown
Contributor Author

Hi @martincostello, thank you for the detailed review! I have addressed all the issues raised. Here is a summary of the changes:

  1. Dynamic Service Discovery: The client now dynamically resolves the SearchQueryService URL from the NuGet V3 service index. If the index cannot be fetched or is missing the resource, it now raises an explicit NuGetAPIError instead of falling back to a hardcoded endpoint.
  2. Version Resolution: Removed the silent fallback to 1.1.0. The get_core_version method now raises an error if the core OpenTelemetry package cannot be resolved, ensuring we don't produce a registry with incorrect metadata.
  3. Deprecation-based Filtering: Removed the explicit name-based check for OpenTelemetry.Contrib.*. The watcher now relies solely on the deprecation flag from the NuGet API, which correctly identifies those legacy packages.
  4. Updated Tests:
  • Refactored tests to mock the deprecation flag instead of relying on package naming.
  • Updated the mock data to include prerelease version strings (e.g., 1.2.3-preview.4) to ensure they are handled correctly.
  • Verified that exceptions are correctly propagated during API failures.
  1. Fixed Version Sorting: Corrected the logic for identifying the latest package version. Instead of sorting the versions array locally (which was causing lexical sorting issues), the client now uses the top-level version field from the NuGet search result, which correctly represents the latest version according to NuGet's semver rules.
  2. Registry Update: Regenerated the registry files. The instrumentation.yaml now correctly reflects the latest versions and properly includes/excludes packages based on the updated logic.

I have also fixed a small regression in the frontend GlowBadge component to ensure all project tests are passing.

Please let me know if there's anything else you'd like me to adjust!

Comment thread ecosystem-registry/dotnet/v1.15.3+SNAPSHOT/instrumentation.yaml
Comment thread ecosystem-registry/dotnet/v1.15.3/instrumentation.yaml
- Added semVerLevel=2.0.0 to NuGet API queries to include newer OTel versions
- Updated logic to use top-level 'version' field from NuGet as source of truth
- Implemented filtering based on NuGet 'deprecation' flag
- Regenerated .NET instrumentation registry with correct versions
@Pittu-Sharma
Copy link
Copy Markdown
Contributor Author

Hi @martincostello, thank you for the feedback. I have now addressed the issues with the incorrect data in the registry:

  1. Fixed Version Discovery: I identified that the NuGet Search API was filtering out newer SemVer 2.0.0 packages by default. I have updated the DotNetInstrumentationClient to explicitly include semVerLevel=2.0.0 in all queries. This correctly surfaces the latest versions (e.g., 1.15.1-beta.1 for GrpcNetClient instead of the old 1.0.0-rc9).
  2. Source of Truth: The logic now uses the top-level version property from the NuGet API response as the source of truth for the latest version, ensuring we don't rely on local sorting which was causing issues.
  3. Deprecation Filtering: Added a check for the deprecation flag in the NuGet metadata. The watcher now correctly skips packages that have been deprecated.
  4. Registry Refresh: I have regenerated both v1.15.3/instrumentation.yaml and v1.15.3+SNAPSHOT/instrumentation.yaml with the corrected logic and verified the versions are now accurate.

Copy link
Copy Markdown
Member

@jaydeluca jaydeluca left a comment

Choose a reason for hiding this comment

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

Thank you @martincostello for helping with the review 🙏

the logic for the watcher looks good, and the resulting registry is a good start, but I think we'll need to wait until open-telemetry/opentelemetry-dotnet#7295 makes some progress before we move this ecosystem forward after this PR is merged. There just isn't enough useful information to do much with yet.

Can you just remove the docs/dotnet-integration-roadmap.md file and revert the changes to unrelated files? Also, I'm assuming the ecosystem-registry/dotnet/v1.0.0/instrumentation.yaml file should also be deleted?

Comment thread docs/dotnet-integration-roadmap.md Outdated
Comment thread ecosystem-explorer/src/components/ui/glow-badge.tsx
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.

Research .NET Instrumentation

3 participants