Commit Graph

37 Commits

Author SHA1 Message Date
Igor Kiselev 6e307db05b
Automatic LoaderOptimization.SingleDomain (#4187)
* All non-default app domains use LoaderOptimization.SingleDomain

Solves "Loading this assembly would produce a different grant set from other instances" for IIS .Net Framework applications.
__DDVoidMethodType__  injected to mscorlib.
__DDVoidMethodType__.__DDPatchAppDomainSetup__ use reflection-created delegate that calls
OpenTelemetry.AutoInstrumentation.Loader.AppConfigUpdater.ModifyConfig to modify AppDomainSetup by setting LoaderOptimization.SingleDomain.
That method called from AppDomain.CreateDomain and AppDomainManager.CreateDomainHelper.
OpenTelemetry.AutoInstrumentation.Loader.AppConfigUpdater loader assembly loaded from __DDVoidMethodType__ static ctor.
Added helpers: SignatureBuilder and MemberResolver.

* Added installer parameter to skip GAC registration

Added Asp.Net tests without registration assemblies in GAC.
Removed LoaderOptimization=SingleDomain through registry change for ASP.Net tests.

* Removed LoaderOptimization workaround from test dockerfiles

* Code format applied

* Updated test build to produce no-GAC docker images

* Extended  SignatureBuilder by providing semi-safe wrappers

Moved it to be header-only.
Added unit tests for SignatureBuilder.

* Updated change log and documentation

* Removed Troubleshooting link from IIS instrumentation docs

* Fixed accident docker file changes

* Added comment about callers of AppConfigUpdater.ModifyConfig

* Update CHANGELOG.md typo based on review

Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>

* Smaller cleanups

* Minor names/comments changes based on @zacharycmontoya review

* Fixed formatting

* Make AppConfigUpdater internal

---------

Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>
2025-05-12 13:39:04 +02:00
Piotr Kiełkowicz b07874afc4
OpenSSF Scorecard - pin docker images to exact digest - ASP.NET Framework (#4124) 2025-04-03 12:06:34 +02:00
Piotr Kiełkowicz e0a0202757
Drop reference to FluentAssertions (#3947)
* Drop reference to FluentAssertions

* PR feedback

* PR feedback - assertions for repeated executions
2025-01-17 09:24:47 -08:00
Mateusz Łach 52d169a744
[WCF] Fix WCF instrumentation initialization (#3650) 2024-09-20 06:55:45 +00:00
Piotr Kiełkowicz 86a32ceb4a
Capture HTTP Headers/gRPC Metadata as span attributes (#3444) 2024-06-12 05:25:47 +00:00
Piotr Kiełkowicz 8516612166
Simplify copyright disclaimer (#3181) 2023-12-08 09:41:25 +01:00
Piotr Kiełkowicz 938d1b021d
Support for .NET 8 (#2996)
Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
2023-11-16 06:34:31 +01:00
dependabot[bot] 6c1736c4be
Bump Testcontainers from 3.2.0 to 3.3.0 (#2718)
* Bump Testcontainers from 3.2.0 to 3.3.0

Bumps [Testcontainers](https://github.com/testcontainers/testcontainers-dotnet) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/testcontainers/testcontainers-dotnet/releases)
- [Changelog](https://github.com/testcontainers/testcontainers-dotnet/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/testcontainers/testcontainers-dotnet/compare/3.2.0...3.3.0)

---
updated-dependencies:
- dependency-name: Testcontainers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Teestcontainers 3.3.0 introduces breaking changes.
Adjust code to mitigate issues

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2023-06-28 06:46:26 +00:00
Paulo Janotti dc39cd3992
Rename build_data dir to test-artifacts (#2618)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2023-06-08 15:21:06 -07:00
Piotr Kiełkowicz 5425e26980
ASP.NET test - smoke test in Classic mode (#2595)
* ASP.NET test - smoke test in Classic mode

* dotnet format

---------

Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>
2023-06-02 20:11:02 +00:00
Piotr Kiełkowicz 7ef1dfcd18
IIS-tests remove unneeded bindings (#2594) 2023-06-02 15:18:19 +03:00
Mateusz Łach 19f4480590
[WCF] Automated test for iis-hosted service scenario (#2576) 2023-05-26 12:08:39 +02:00
Rasmus Kuusmann 3e3b3550a4
Add Asp.Net WebApi tests (#2272) 2023-03-01 11:49:07 +00:00
Piotr Kiełkowicz fe24131b79
Bump Testcontainers to 2.4.0 (#2144) 2023-02-02 10:56:40 +00:00
Piotr Kiełkowicz fc205e349b
Env var instrumentation - uppercase id (#2141) 2023-02-02 09:21:54 +01:00
Piotr Kiełkowicz 740b802101
Env var instrumentation improvements (#2088) 2023-02-01 20:42:10 +01:00
Robert Pająk 39868fd0d6
Support configuration via app/web.config (#2066) 2023-01-23 22:12:30 +01:00
Robert Pająk 75fa18eb76
Add tests for configuration via app/web.config (#2014) 2023-01-23 09:32:42 +00:00
Rasmus Kuusmann dd79e41efc
Enable implicit usings (#1966)
* use implicit usings

* enable implicit usings for nuke project

* fixes
2023-01-10 10:03:46 -08:00
Rasmus Kuusmann 50ab2d2ff6
Update TestApplication.AspNet (#1910)
* change aspnet testapplication name to match the pattern

* rename missing places

* fix aspnet test
2023-01-09 15:29:26 -08:00
Robert Pająk 46873fea5a
Remove HttpListener healthz endpoint and refine HealthzHelper (#1547)
* Remove healthz from HttpListener

* Improve HealthzHelper

* do not require testName

Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2022-11-08 19:38:52 +00:00
Robert Pająk 3656f610bc
Refactor TestHttpServer and fix HttpListener leakage (#1545) 2022-11-08 11:21:22 +00:00
Robert Pająk c587f56bc5
Refine tests to reduce usage of optional args and optimize defaults (#1543) 2022-11-08 08:29:15 +01:00
Robert Pająk 3b6643476d
AspNetTests: use MockSpansCollector instead of LegacyMockZipkinCollector (#1440) 2022-10-18 15:50:04 +02:00
Robert Pająk 4e8fff6ba6
Rename MockZipkinCollector to LegacyMockZipkinCollector (#1428) 2022-10-17 14:56:24 +03:00
Robert Pająk 5feddfdebe
Refactor AspNetTests (#1371) 2022-10-06 01:26:07 +02:00
Robert Pająk ad16e9c11e
Refine MockMetricsCollector and metrics tests (#1276)
* Refine MockMetricsCollector and metrics tests

* Add missing metrics expectation in AspNetTests

* Fix checking InstrumentationScopeName

* Remove space

* Fix AssertExpectations and cleanup

* Fix missingExpectations loop

* Do not expect OpenTelemetry.Instrumentation.Http in AspNetTests

* Refine AssertExpectations in MockMetricsCollector

* Refine looping logic in AssertExpectations

* Fix race condition

* Better comment
2022-09-26 16:51:09 -07:00
Piotr Kiełkowicz c5527e4533
Ensure that mock collectors are available (#1270)
* Healthzz for MockZipkinCollector

* Healthzz for MockMetricCollector

* Healthzz for MockLogsCollector

* Extract HealthZ handler to common class
2022-09-23 11:01:19 -07:00
Robert Pająk 554c0c09b2
Fix race condition in mock collectors (#1254)
* Fix race condition in mock collectors

* Add missing lines

* Fix build

* Revert one little change

* Remove usage of timeout when calling WaitFor

* Same as before

Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Paulo Janotti <pjanotti@splunk.com>
2022-09-21 19:41:53 +00:00
Rasmus Kuusmann c3ab169955
Change mock agent to async (#1147) 2022-09-12 09:44:38 +00:00
Rasmus Kuusmann c083d5f81d
Enable all metrics by default (#934)
* Enable all metrics by default

* fix asp.net metrics tests

* typo fix

Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>

Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>
2022-07-14 12:46:40 -07:00
Robert Pająk e013026f8b
Refactoring (#922)
* Remove unused files

* Move TestApplication.AspNet higher

* AspNetTests.SubmitMetrics requires admin
2022-07-07 08:51:10 +02:00
Robert Pająk 77998bde98
Add PluginsTests (#910)
* Add PluginsTests

* Refactor RunTestApplicationAndWaitForExit

* Refactor MockZipkinCollector

* Refactor MockCollector

* Update test/IntegrationTests/Helpers/TestHelper.cs

Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>

* Update PluginsTests.cs

Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>
2022-07-01 11:53:02 -07:00
Rajkumar Rangaraj 94fbe95c39
ASP.NET metrics tests (#901)
* .NET Framework metrics tests

* save work in progress

* Metrics exporter interval.

* Remove old changes

* Fix collector

* OTEL_AUTO_METRIC_EXPORT_INTERVAL->OTEL_METRIC_EXPORT_INTERVAL

* PR feedback.

* PR feedback
2022-06-30 21:11:08 +00:00
Robert Pająk f94589b41c
Add SmokeTests.ApplicationIsIncluded (#905)
* Add ApplicationIsIncluded test

* Rename AssertExpectationsMet to AssertSpanExpectations

* Refactor

* Refactor

* Refactor

* Rename TestApplication.StartupHook to TestApplication.Smoke

* Fix SmokeTests
2022-06-29 09:41:38 -07:00
Paulo Janotti bf24e78dfe
Do not require elevation to run MockZipkinCollector (#874)
* Switch MockZipkin to localhost (non-admin)

* Mock zipkin on "*:{port}" for test with Windows container

* Fail AspNet integration test if not Administrator

* Add host parameter to MockZipkinCollector
2022-06-28 10:50:19 +00:00
Robert Pająk bf22f0350e
Reorganize integration tests into one project (#878)
* Move integration tests to Helpers project

* Remove empty projects

* Flatten test project structure

* Move IntegrationTests.AspNet to IntegrationTests

* Update dependabot.yml

* Update AspNetTests.cs
2022-06-23 17:42:56 +00:00