Skip to content

Conversation

@petrroll
Copy link
Contributor

@petrroll petrroll commented Jan 9, 2026

Adds optional tracing instrumentation and OTEL export support for WireMock server

Adds optional (based on config) instrumentation for frameworks that support Activity API:

  • Custom WireMock DT/Activity instrumentation that's part of WireMock middleware
  • ASP.NET DT/Activity http.server instrumentation for WireMock ASP.NET server (not implemented for OWIN)

Adds inbuild OTEL exporter for WireMock ASP.NET server
Adds ability to propagate the OTEL/DT config when server is run from command line (should get picked up by Docker container when build)
Adds config surfaces for Aspire integration (requires new container version)

Based on #1418

References

Fixes #1214

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

Tests & documentation not yet updated, will do if we agree it's possible to eventually merge it.

petrroll and others added 2 commits January 8, 2026 21:04
Allows usage of aspire CLI which is very useful for dev in codespaces (for my next PR).
@petrroll
Copy link
Contributor Author

petrroll commented Jan 9, 2026

I also thought about updating the docker repo but I'm super confused by the two projects there, the local on older version and non local.

@petrroll
Copy link
Contributor Author

petrroll commented Jan 9, 2026

For now it's just traces. But metrics and logs should be super easy. Though the logging in the project is tad non-simple and mildly custom so I'm not super sure.

@petrroll
Copy link
Contributor Author

petrroll commented Jan 9, 2026

I also see there's version 2 and I didn't check how much it uses the same things. But if nothing this PR should show it it can be transplanted / implemented there.

@StefH
Copy link
Collaborator

StefH commented Jan 10, 2026

I also thought about updating the docker repo but I'm super confused by the two projects there, the local on older version and non local.

My docker project is here: https://github.com/wiremock/WireMock.Net-docker
But I don;t think you need to change something there.


However, maybe you mean the Testcontainers project?
https://github.com/wiremock/WireMock.Net/tree/master/src/WireMock.Net.Testcontainers
That project could also have OTEL I think?

Copy link
Collaborator

@StefH StefH left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@StefH
Copy link
Collaborator

StefH commented Jan 10, 2026

For now it's just traces. But metrics and logs should be super easy. Though the logging in the project is tad non-simple and mildly custom so I'm not super sure.

Metrics is maybe not needed.

By logs, you mean the normal logs?
So implementing IWireMockLogger ?

@StefH
Copy link
Collaborator

StefH commented Jan 10, 2026

I also see there's version 2 and I didn't check how much it uses the same things. But if nothing this PR should show it it can be transplanted / implemented there.

First I will merge this to the normal 1.x version, and then I can merge it into 2.x and hope it's easy to do...

@petrroll
Copy link
Contributor Author

I also thought about updating the docker repo but I'm super confused by the two projects there, the local on older version and non local.

My docker project is here: https://github.com/wiremock/WireMock.Net-docker But I don;t think you need to change something there.

However, maybe you mean the Testcontainers project? https://github.com/wiremock/WireMock.Net/tree/master/src/WireMock.Net.Testcontainers That project could also have OTEL I think?

No I meant that one, as you still need to at least bump the version there. Good point about test containers tho.

@StefH
Copy link
Collaborator

StefH commented Jan 10, 2026

I also thought about updating the docker repo but I'm super confused by the two projects there, the local on older version and non local.

My docker project is here: https://github.com/wiremock/WireMock.Net-docker But I don;t think you need to change something there.
However, maybe you mean the Testcontainers project? https://github.com/wiremock/WireMock.Net/tree/master/src/WireMock.Net.Testcontainers That project could also have OTEL I think?

No I meant that one, as you still need to at least bump the version there. Good point about test containers tho.

  1. Yes, I need a new version also when this one is finished.
  2. If it's easy, add OTEL to Testcontainers , else make a new PR after this one is merged to main.

@StefH StefH added the feature label Jan 11, 2026
@petrroll
Copy link
Contributor Author

petrroll commented Jan 11, 2026

@StefH please check now, reworked in split way (OTEL vs Activity tracing), and I think it should be fine :). We'll just need to update the docker image executable to use the package and set the OTEL part up.

@petrroll petrroll requested a review from StefH January 11, 2026 16:00
@StefH
Copy link
Collaborator

StefH commented Jan 17, 2026

@petrroll do you have time to complete all PR comments?

@petrroll
Copy link
Contributor Author

petrroll commented Jan 17, 2026 via email

@petrroll petrroll requested a review from StefH January 18, 2026 11:29
@petrroll
Copy link
Contributor Author

@StefH I've fixed all/most comments (one I don't think I should act upon) + added tests.

@petrroll
Copy link
Contributor Author

If it's good as is, I'll update the docs and then we can merge both.

@StefH StefH merged commit 4525c61 into wiremock:master Jan 18, 2026
6 checks passed
@StefH
Copy link
Collaborator

StefH commented Jan 19, 2026

@petrroll
This is merged to main and I created a new NuGet

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenTelemetry Support for .NET Aspire

2 participants