Skip to content

[MTP] Add initial support for OTel - #6511

Merged
Amaury Levé (Evangelink) merged 29 commits into
mainfrom
dev/amauryleve/otel-mtp
Dec 12, 2025
Merged

Amaury Levé (Evangelink) merged 29 commits into
mainfrom
dev/amauryleve/otel-mtp

Conversation

@Evangelink

@Evangelink Amaury Levé (Evangelink) commented Sep 3, 2025 •

Copy link
Copy Markdown
Member

This PR introduces OpenTelemetry support to the platform, enabling distributed tracing and metrics collection for test runs. The main changes include adding a new extension project for OpenTelemetry integration, updating dependencies and sample usage, and instrumenting the test execution flow to emit telemetry data.

  • Added new project Microsoft.Testing.Extensions.OpenTelemetry with wrappers for activities, counters, and histograms, and a platform service implementation for telemetry instrumentation.

  • Modified Playground.csproj and Program.cs to demonstrate enabling OpenTelemetry tracing and metrics via the new provider and exporter.

View on Aspire:

  • Traces:
image image
  • Metrics:
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces OpenTelemetry support to the Microsoft Testing Platform, enabling distributed tracing and metrics collection for test runs. The implementation provides instrumentation capabilities while maintaining compatibility with the platform's netstandard2.0 target framework.

Key changes include:

  • Added new Microsoft.Testing.Extensions.OpenTelemetry extension project with OpenTelemetry integration
  • Introduced telemetry interfaces and platform services for activity tracking, counters, and histograms
  • Updated existing services to accept the new OpenTelemetry service parameter and instrument test execution flows
  • Enhanced the Playground sample to demonstrate OpenTelemetry usage with OTLP exporters

Reviewed Changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Platform/Microsoft.Testing.Platform/Telemetry/TelemetryManager.cs Added OpenTelemetry provider support and renamed BuildAsync to BuildTelemetryAsync
src/Platform/Microsoft.Testing.Platform/Services/TestApplicationResult.cs Added OpenTelemetry service integration and test execution instrumentation
src/Platform/Microsoft.Testing.Extensions.OpenTelemetry/ New extension project providing OpenTelemetry wrappers and platform service implementation
test/UnitTests/ Updated test constructors to accommodate new OpenTelemetry service parameter
src/Platform/Microsoft.Testing.Platform/Hosts/ Added activity tracking throughout host execution flows
samples/Playground/ Added OpenTelemetry configuration example with tracing and metrics

@Evangelink
Amaury Levé (Evangelink) changed the base branch from rel/4.0 to main October 2, 2025 13:52
Comment thread Directory.Packages.props Resolved
Comment thread samples/Playground/Playground.csproj Resolved
# Conflicts:
#	Directory.Packages.props

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's probably nice if we can have a complete sample, whether it's using Aspire or something else.

auto-merge was automatically disabled October 31, 2025 09:07

Pull request was closed

@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/otel-mtp branch October 31, 2025 09:07
# Conflicts:
#	Directory.Packages.props
#	test/UnitTests/Microsoft.Testing.Platform.UnitTests/ServerMode/ServerTests.cs
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/otel-mtp branch December 12, 2025 11:26
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.

5 participants