Add OTEL tracing support for Wiremock + automatic OTEL for Aspire integration#1418
Add OTEL tracing support for Wiremock + automatic OTEL for Aspire integration#1418StefH merged 20 commits intowiremock:masterfrom
Conversation
Allows usage of aspire CLI which is very useful for dev in codespaces (for my next PR).
|
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. |
|
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. |
|
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. |
My docker project is here: https://github.com/wiremock/WireMock.Net-docker However, maybe you mean the Testcontainers project? |
src/WireMock.Net.Minimal/Settings/WireMockServerSettingsParser.cs
Outdated
Show resolved
Hide resolved
src/WireMock.Net.Minimal/Owin/OpenTelemetry/WireMockActivitySource.cs
Outdated
Show resolved
Hide resolved
Metrics is maybe not needed. By logs, you mean the normal logs? |
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... |
No I meant that one, as you still need to at least bump the version there. Good point about test containers tho. |
|
|
@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. |
src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj
Outdated
Show resolved
Hide resolved
src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj
Outdated
Show resolved
Hide resolved
examples/WireMock.Net.OpenTelemetryDemo/WireMock.Net.OpenTelemetryDemo.csproj
Outdated
Show resolved
Hide resolved
Update <Authors>
src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockActivitySource.cs
Outdated
Show resolved
Hide resolved
src/WireMock.Net.Minimal/Settings/WireMockServerSettingsParser.cs
Outdated
Show resolved
Hide resolved
src/WireMock.Net.Minimal/Owin/ActivityTracing/ActivityTracingOptions.cs
Outdated
Show resolved
Hide resolved
src/WireMock.Net.Minimal/Owin/ActivityTracing/ActivityTracingValidator.cs
Show resolved
Hide resolved
src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj
Outdated
Show resolved
Hide resolved
|
@StefH I've fixed all/most comments (one I don't think I should act upon) + added tests. |
|
If it's good as is, I'll update the docs and then we can merge both. |
|
@petrroll |
Adds optional tracing instrumentation and OTEL export support for WireMock server
Adds optional (based on config) instrumentation for frameworks that support Activity API:
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
#help-contributingor a project-specific channel like#wiremock-javaTests & documentation not yet updated, will do if we agree it's possible to eventually merge it.