Commit Graph

25 Commits

Author SHA1 Message Date
Piotr Kiełkowicz b27b90bb42
Get rid of wrapper.action in bytecode instrumentation (#1889) 2023-01-04 11:14:56 +01:00
Piotr Kiełkowicz d1e9202c38
Add NServiceBus traces and metrics instrumentation (#1881) 2023-01-03 11:55:55 +01:00
Piotr Kiełkowicz 46896a72ef
Enable nullable for main project (#1861)
* nullable

* nullable util

* nullable Tagging

* nullable logging

* nullable loading

* nullable configuration

* nullable CallTarget

* nullable calltarget-handlers-continuation

* nullable calltarget handlers

* fix tests

* leftovers

* cleanup #nullable enable

* update publicapi

* nullable AutoInstrumentation.Tests

* IntegrationsJsonGenerator

* dotnet format

* pr feedback

* pr feedback - plugin manager

* pr feedback StackExchangeRedisInitializer

* pr feedback - attributes names for instrument method

* PR feedback stack exchange Redis part 2

Co-authored-by: Paulo Janotti <pjanotti@splunk.com>
2022-12-21 20:45:28 +00:00
Piotr Kiełkowicz 2a81d693ca
Enable Nullable - part 1 (#1710)
Enable Nullable by default
2022-12-05 12:02:13 -08:00
Piotr Kiełkowicz d8d8332f63
Remove framework version from distribution structure (#1661) 2022-11-24 11:37:00 +00:00
Piotr Kiełkowicz 1ceac49732
Support for .NET 7 (#1617) 2022-11-15 09:30:23 +00:00
Piotr Kiełkowicz 5782c35eb2
Drop .NET Core 3.1 support (#1603) 2022-11-10 08:38:11 +00:00
Paulo Janotti 63a5236970
Log error if missing bytecode instrumentation method (#1520) 2022-11-02 08:58:07 +01:00
Piotr Kiełkowicz b4a4120bbd
Enable/disable log instrumentations (#1475)
* Introduce instrumentation types

* extend generator

* support for disabling logs bytecode integrations

* update documentation

* change LoggingBuilder instrumentation name to ILogger

* Support managing log instrumentation in managed code

* update changelog

* PR feedback - config

* add LogsNoneInstrumentations test

Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>
2022-10-21 13:31:53 -07:00
Piotr Kiełkowicz e9face3bac
Integrations json file generator (#1466) 2022-10-20 07:50:36 +00:00
Robert Pająk 8a34aaa0fa
PoC: Cleanup (#175)
* Clean build directory

* Add +x to build.sh

* Fixes

* Remove build directory

* Remove more unused stuff

* Move test-applications to samples

* Make poc.sh working from any dir
2021-05-22 08:25:02 -07:00
Paulo Janotti 87959cc830
PoC: minimizing the code: only calling the loader (#172)
* PoC: minimizing the code: only calling the loader

* Remove tests not being used

* Clean solution

* Remove some tools and fix solution

* Remove Az Pipelines

* Lean CI: remove Az and simplify GH workflows

* Fix env var on GH workflow for Windows

* Delete samples.sln and unused samples on the branch

* Remove extra solutions
2021-05-21 11:32:17 -07:00
Robert Pająk ea124dcec0
OpenTelemetry SDK PoC: Plan proposal and automation for testing (#167) 2021-05-20 07:36:31 +02:00
Dawid Szmigielski e616d380a0
Change version to 0.0.1 (#155)
* Change version to 0.0.1

* Add documentation

* Fix PrepareRelease tool; fix documentation

* Remove unnecessary line

* Update CHANGELOG.md

Co-authored-by: Robert Pająk <rpajak@splunk.com>
Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>
2021-04-30 12:24:24 -07:00
Rasmus Kuusmann e8c6df6372
Upstream 26.04.21 (#142)
* Catchup to upstream

* Actually build profiler in release mode (#1362)

Actually build the profiler in release mode. The changes in #1356 attempted to do this, but placed the build configuration changes into the display name of the tasks, not the actual command.

Bump OpenTracing from 0.12.0 to 0.12.1 in /src/Datadog.Trace.OpenTracing (#1385)

Bumps [OpenTracing](https://github.com/opentracing/opentracing-csharp) from 0.12.0 to 0.12.1.
- [Release notes](https://github.com/opentracing/opentracing-csharp/releases)
- [Commits](https://github.com/opentracing/opentracing-csharp/compare/0.12.0...0.12.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Update dependabot all in one go (#1387)

- For Datadog.Trace, allow all dependencies. For other projects, only allow direct dependencies. This cuts down on noise since all other projects go through Datadog.Trace
- For Datadog.Trace and Datadog.Trace.ClrProfiler.Managed, add packages that should be ignored

Update dependabot to manually ignore dependencies (#1399)

Copy/paste the Datadog.Trace.csproj ignored dependencies everywhere, since Datadog.Trace triggers issues everywhere. While potentially noisier than a small "allow" list, this will raise PR's if we ever add new packages which is better than not raising PR's.

Stop calling Environment.Exit in tests (#1400)

Add symbols to MSI (#1364)

* Add symbols to MSI
* Update the PrepareRelease tool

Include the job attempt number in integration test log uploads (#1403)

This is the only pipeline that publishes whether the pipeline succeeds or fails, so it's the only job vulnerable to duplicate artifacts

Update dependabot to ignore the MessagePack vendored dependency (#1404)

Add additional test for ContainerID parsing (#1405)

Python recently had an issue with container ID parsing in https://github.com/DataDog/dd-trace-py/issues/2314. This adds the problematic ID to our test suite to ensure we are not affected

Check agent version only once (#1406)

Fixes the CMake version 3.19.8 in CMakeLists (#1407)

Revert "ProcessExit event handler improvements (#1332)" (#1410)

This reverts commit 0aaa30eb253a6af8792cbd1ff5918927c663d777.

Include symbols in Linux packages (#1365)

Generate nuget symbols package (#1401)

* Generate nuget symbols package
* Enable source-link
* Enable deterministic builds

delete log file (#1408)

Bump version to 1.26.0 (#1411)

* Bump version to 1.26.0

Update NuGet packages in integration tests, under existing instrumentation version ranges (#1412)

Re-enable AspNet integration tests in CI (#1414)

Runs the AspNet tests added by https://github.com/DataDog/dd-trace-dotnet/pull/1288 . Currently, this only tests the `AspNetMvc` and `AspNetWebApi2` integrations because the `AspNet` integration is not yet enabled via automatic instrumentation.

The tests are run in the Windows IIS runs for the following reasons:
- Restoring the projects and publishing can be grouped into the existing `samples-iis.sln` solution
- Instrumenting IIS and IIS Express requires the Datadog.Trace assemblies to be in the GAC

- Adding the AspNet CI applications to `samples-iis.sln`, which we are already properly restoring and publishing in the Windows IIS jobs
- Removing some compile-time references to `Datadog.Trace.dll` and `Datadog.Trace.ClrProfiler.Managed.dll` with lookups via reflection. This is used so the site can give us a clear indicator whether automatic instrumentation is running
- Miscellaneous change: Stop Visual Studio from auto-generating a `launchSettings.json` for the Datadog.Trace.IntegrationTests project

Fix links in CHANGELOG (#1417)

Serialize tags/metrics in a single pass (#1416)

Ducktype reverse proxy (#1402)

* Add support for reverse proxy/ducktyping.

* Fixes ducktyping for non visible types.

* Changes ReverseProxyTests

* Enables tests on NET451, and adds a new test using public types.
Changes based on the review.

* Apply suggestions from code review

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

* Apply suggestions from code review

Co-authored-by: Kevin Gosse <krix33@gmail.com>

* Changes based on the review.

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
Co-authored-by: Kevin Gosse <krix33@gmail.com>

Fix git parser on really big pack files (>2GB) (#1413)

* Fix git parser on really big pack files. > 2GB

* Fix parser on big object size.

* changes based in the comments.

* Fixes.

* Apply suggestions from code review

Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>

Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>

Enable endpoint routing in aspnetcore benchmark (#1418)

Reinstate the consolidated multi-stage build pipeline (#1363)

Re-incorporate the unified build pipeline and ensure that the main pipelines can successfully run in parallel. The main difference between the two is that, for Linux builds, the managed assets are no longer being copied during the Profiler step but instead during the package step. Thus, the only changes in this PR that affects shared scripts are new conditional blocks that check a new `UNIFIED_PIPELINE` environment variable to determine in which step to copy the managed assets.

Notes:
- Reverts the "revert" PR https://github.com/DataDog/dd-trace-dotnet/pull/1335
- Adds the NuGet config change from https://github.com/DataDog/dd-trace-dotnet/pull/1353, which assumes the change will be taken

don't throw or log exceptions in TryDuckCast methods (#1422)

Bump version to 1.26.1 (#1424)

* Bump version to 1.26.1

* Update Changelog

Fix build issue when building MSI from the command line without the TracerHomeDirectory argument (#1423)

* tracer merge fix

* fix versions

* remove arm64 builds

* fix assembly naming

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
2021-04-26 21:38:29 -07:00
Dawid Szmigielski 68d5b3775c
Upstream sync 2012-04-13 (#123)
* Catchup to upstream

Bump version to 1.25.1 (#1330)

Add support for flushing partial traces (#1313)

* Implement partial flush

Bump version to 1.25.2-prerelease (#1333)

Revert "Add a consolidated multi-stage pipeline (#1320)" (#1335)

This reverts commit 74d81fd710a0efb98fcc444e78deaced530dc224.

Generate fake proj for dependabot (#1336)

Implement Dependabot Config (#1338)

ProcessExit event handler improvements (#1332)

* Improves the ProcessExit event handler.

* fixes #if

* Changes from review.

* Update src/Datadog.Trace/Tracer.cs

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

* Changes from reviews

* Add last delegate logic for CancelKeyPress event.

* Fix test

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

Delete OrleansCrash and remove it from our integration test suite (#1271)

This sample was originally added in https://github.com/DataDog/dd-trace-dotnet/pull/443 to fix an issue with the Sigil library on net461/netstandard2.0. Now that Sigil has been removed, we no longer need this test case, especially because it is demonstrating some unreliable behavior.

Update ASP.NET Core Resource Names (#1289)

* Add route template handling for AspNetCore diagnostic Observer

* Add tags for ASP.NET Core MVC actions

* Add Endpoint routing support to AspNetCoreDiagnosticObserver

Adds the AspNetEndpoint tag
Required adding a FrameworkReference which is likely not workable in the longer term.

* Added support for tagging Razor Page in AspNetCoreDiagnosticObserver

* Improve AspNetCoreDiagnosticObserver

Reduce string allocations
Fix pipeline re-execution behaviour

* Add FeatureFlag for controlling new resource names in ASP.NET Core

* Add tests for new diagnostic source behaviour

* Convert ASP.NET Core endpoint-routing support to duck typing

* Enable endpoint routing support for netcoreapp3.0

* Significant rework of the ASP.NET Core diagnostic observer

Create a separate span (aspnet_core.mvc) for each MVC execution
This is more complex than it initially seems due to the use of endpoint routing.
To more easily pass values between the various listener endpoints, makes use of the HttpContext.Features collection, to pass a feature through.
Additionally:
 - Parent span resource name is updated based on route name
 - Parent span tagged with the _first_ selected endpoint and route
 - Child (MVC) spans contains action/controller etc tags + same route as parent.
 - In error/pipeline re-execution scenarios, the parent span route is not updated, but you may see additional MVC spans (depending on pipeline configuration)

 All this is controlled by a feature flag - with the feature flag off (the default) the resource names will remain the same as currently shipped

 Updated the tests as appropriate, including checking child spans. Could do with refactoring (e.g. snapshot testing of spans)

* Create separate tags for ASP.NET Core

Instead of re-using the ASP.NET ones
Uses the pattern `aspnet_core.TAG`

* Remove unnecessary use of nested StringBuilder

* Fix case where IEndpointFeature is explicitly implemented

This occurs with Kestrel for example, where Http2StreamofT implements HttpProtocol, which explicitly implements IEndpointFeature. Our duck typing library doesn't currently catch that case, so this approach uses a method duck type instead

* Improve duck typing a bit

* Refactor RequestTrackingFeature in aspnetcore diagnostic observer

Handles cases where the pipeline is reexecuted before the endpoint routing executes. Occurs in cases such as a 404 handled by the statuscodepageswithrexecute handler, or errors in a "map" pipeline that are handled by the exception handler with reexecution

* Fix copy pasta

* Use StringBuilderCache in AspNetCoreDiagnosticObserver

* Rename Feature Flag to DD_TRACE_ROUTE_TEMPLATE_RESOURCE_NAMES_ENABLED

* Add parameter for readability

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

* Reduce number of ToLowerInvariant() calls when simplifying route pattern

* Rename aspnet_core.mvc -> aspnet_core_mvc.request

* Rename RequestTrackingFeature.Url -> OriginalUrl

* Fix Comment

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

* Guard against null EndpointFeatureType

* Add doc comments to duck typed proxies

* Reorder methods to match order they are called at runtime

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

Report Trace Drop/Keep Rate to the Agent (#1306)

* Add a moving average keep rate calculator

Uses a simple moving average implementation to calculate the rate at which traces were kept/dropped
Handles up to uint.MaxValue traces in a given timespan (1s by default, averaged over 10s)

* Add _dd.tracer_kr metric to root spans of traces

Records the current tracer keep rate on the root span of traces.

* Switch to TaskCompletionSource instead of CancellationToken

* Make _dd.trace_kr internal

* Apply suggestions from code review

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

* Rename _keepRateCalculator -> _traceKeepRateCalculator for clarity

* Update comment based on PR feedback

* Fix variable name

* Cast to CommonTags and use property where possible

* Fix the windowSize named parameter

* Fix error message

* Reduce allocations in the UpdateBucketTaskLoopAsync task

* Remove unused variable

* Fix references

* Add missing variable

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

Replace Task.Delay in dogstatsd with Thread.Sleep (#1344)

Add AssemblyLoadContext and Assembly.LoadFile testing to ServiceStackRedis sample (#1337)

To further test resiliency against assembly loading issues, add AssemblyLoadContext and Assembly.LoadFile testing to the ServiceStackRedis sample. This augments the existing ADO.NET tests that do a similar thing, except in the ServiceStack.Redis library, all of the types are defined in the third-party library, unlike ADO.NET where some types are defined in the framework-provided System.Data assembly.

Improve DD_TRACE_HEADER_TAGS to decorate web server spans based on response headers (#1301)

Previously, the `DD_TRACE_HEADER_TAGS` setting would accept a list of `<http_header_name>:<tag_name>` pairs and add tags to web server spans with the specified tag name if the header was present on an incoming HTTP request. This PR adds functionality to also consider headers from the HTTP response the web server issues. Additional changes include:

1. In accordance with the HTTP Headers Tracing RFC, `DD_TRACE_HEADER_TAGS` now accepts entries without a specified tag name. In this scenario, the resulting tag name will be `http.<request|response>.headers.<normalized_header_name>`.
2. All header tag names are now being normalized

Affected integrations:
- AspNet
- AspNetMvc
- AspNetWebApi2
- AspNetCore

Testing:
- Local testing for all integrations
- AspNetCore integration test added

Partial OTEL port to improve TagsList (#1311)

I looked to port https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/71

However, I don't think we necessarily need to take the changes from there, which can be summed up as adding a Metrics and Tags property on the ITags interface, to allow their Zipkin exporter to write the tags/metrics.

In the end, I just ported one unit test from the PR and modified it to work with our structure.

Increase diagnostic observer test timeout (#1331)

Fix references to dotnet-tracer-native.log (#1329)

* Copy all native log files

With rolling native log files, there's more than one log file, and we don't know its name ahead of time, so use globbing

* Replace obsolete DD_TRACE_LOG_PATH -> DD_TRACE_LOG_DIRECTORY

* We now produce multiple native log files, so need to publish the directory

* No need to touch file that won't be used

* Try outputting log files after execution, as can't easily tail them

* Also publish coredumps

* Add EOLs

* Use trap where possible

* Reenable -e

For simplicity, reinstate fail on first error, and use trap to copy logs and crashdumps

* Fix environment variable

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

OTel Port: Fix double parsing

Source: https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/96 (#1349)

Downgrading .NET SDK on Crank pipeline (#1352)

Fix Datadog.Trace.ClrProfiler.Native.sh (#1309)

Port changes from OTEL PR: https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/77

Adds `buildConfiguration` and `publishTargetFramework` variables into shell scripts

Simplify moving average calculator (#1350)

* Simplify moving average calculator

Was previously going a bit overboard with keeping things atomic, when in reality we only need the current buckets and keep rate to be atomic

* Update src/Datadog.Trace/Agent/MovingAverageKeepRateCalculator.cs

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

* Apply Kevin-level optimisations

Co-authored-by: Kevin Gosse <krix33@gmail.com>

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Co-authored-by: Kevin Gosse <krix33@gmail.com>

Update Uri cleaning algorithm to be more aggressive (#1327)

* Update Uri cleaning algorithm to be more aggressive

Replaces any hex-ish (alpha or `-`) string with `?`.
If it's numbers and dashes only, always replaces
If it contains alpha, must be at least 16 chars long and contain a number
Added in back-compat way, that avoids changing internal (public) APIs

* Conditionally enable the new URI cleaning algorithm in ASP.NET

Enabled when the new route names flag is enabled
Added a note that we're currently using the _legacy_ algorithm still in the generic scope factory for _outbound_ requests. We may want to update this, but wasn't sure if we should do it under the same flag, as it's _kinda_ unrelated

* Simplify implementation

* Mark older UriHelpers methods Obsolete (kept for back compat)

Add documentation to CleanUri method
Update tests to use non-obsolete methods

* Use new Uri cleaning in AspNetCore resources when feature flag enabled

* Remove the feature-flag behaviour i.e. always use the new Id replacement algorithm

We decided to take this approach as it's simpler, and in practice the cleaning algorithm should only be used when there's a 404 anyway. If customers find the new algorithm is causing them problems, opting in to the new route-based resource names should fix it.

The one other place this cleaning algorithm is used is in the ScopeFactory for outbound HTTP requests. There's no workaround there, but the chances of issues are small, so we're ok with the tradeoff for simplicity and performance

Fix native unit tests running in Release mode (#1355)

Fix the package build pipeline (#1356)

This build break was inadvertently introduced in https://github.com/DataDog/dd-trace-dotnet/pull/1309 because the build configuration was not tweaked appropriately for the package scripts and pipeline.

Fix small sync over async occurrence in DatadogHttpClient (#1348)

Co-authored-by: Kevin Gosse <krix33@gmail.com>

Log a warning if partial flush is enabled with an old agent (#1347)

Add benchmark for Serilog log injection (#1351)

Upgrade Serilog & Serilog.Sinks.File Vendors (#1345)

Fix Datadog.Trace.Tests.DogStatsDTests.Send_metrics_when_enabled (#1358)

Fix two bad assumptions in the Statsd assertions:
1. The heartbeat fires on a timer that is independent of sending a trace, so do not assert its presence
2. Sending a trace may require multiple requests to the trace agent since requests may fail, so assert that it's fired 1+ times instead of exactly once

Try fix scheduled benchmark/throughput runs (#1359)

Don't run Unit test or runner pipelines on all branch pushes (#1354)

There's a lot of duplicated effort caused by these branch-only pushes, and with limited runners available (especially macos), this causes a backlog of runs for PRs

We can always manually trigger a pipeline for a branch if you want a pre-PR check, so I think this is probably a good option?

* Fix files after pull from upstream

* Fix branch name in the pipelines

* Add necessary import

* Add necessary import

* Revert removing usings

* Remove arm64 pool

* Revert TagsListTests changes after pull from upstream

* Rewrite Accurate_Duration test to reduce flakiness  (#1360)

Co-authored-by: Kevin Gosse <krix33@gmail.com>
2021-04-14 11:01:08 -07:00
Dawid Szmigielski 7e7aa50aaf
Add support for 128bit traceid (#72)
* Exchange TraceId ulong type with ActivityTraceId

* Exchange TraceId ulong type with ActivityTraceId

* Revert SpanIdGenerator changes

* Add structure for TraceId and random number generator for 128-bit id generation

* Replace ActivityTraceId with custom TraceId

* Remove missed ActivityTraceId

* Fix tests after replacing ulong with TraceId

* Fix unit tests

* Add unit tests for TraceId

* Choose the TraceId format based on convention

* Set private assets to all on newly added reference

* Revert last change

* Revert set private assets to all on newly added reference

* Add source of random number generator

* Refactor ParseTraceId in SpanContextPropagator

* Refactor TraceId class

* Move TraceId generation to new Convention interface

* Change TraceId to default to Zero when incorrect string is passed; move AsBytes to extension class

* Make TraceId deafult to Zero in CorrelationIdentifier

* Overload == operator in TraceId

* Change 64bit TraceId format to previously used decimal one

* Remove unnecessary ToList

* Remove AsByte method from TraceId

* Revert MessagePack to use ulong again (lower bits of TraceId)

* Add clear documentation on how TraceId struct works to be compatible with DataDog

* Fix code after merge with master
2021-03-30 20:49:06 -07:00
Dawid Szmigielski 88eb7eebb2
Pull upstream changes (#89)
* Catchup to upstream

Fix and extend ASP.NET integration tests (#1246)

* minor: Build integration test project in debug configuration
* Add SerializableDictionary helper to satisfy IXunitSerializable
* Update AspNetMvc4Tests to add extra cases and fix broken tests
* Update AspNetMvc5Tests to test additional cases and fix broken tests
* Update AspNetWebApi2Tests to test additional cases and fix broken tests
* Don't use HttpStatusCode in member data as non-serializable
* Extract TestData classes from AspNet integration test classes
* Add tests for WebApi2 with conventions

Fix solution load deadlock for Rider in non windows OS (#1256)

* Add support to run integration tests in macos

* Revert the native project directory.

* Fix solution load deadlock for Rider in macOS (non windows machines)

* Fix Tests in CI

Fix CallTargetNativeTest build (#1254)

Small updates to Service Fabric doc (#1238)

Update .gitignore and 3rd party license file (#1260)

* Update gitignore to exclude automatic instrumentation build output. Based on changes in open-telemetry/opentelemetry-dotnet-instrumentation#47

* Add opentelemetry-dotnet-instrumentation to LICENSE-3rdparty.csv

HttpMessageHandler based integrations refactor. (#1258)

* Refactor of HttpMessageHandler based instrumentation.

* update integrations.json

* Fix Benchmark test

Minimize usages of Tracer.Instance in Datadog.Trace.Tests (#1262)

* Remove usages of Tracer.Instance in Datadog.Trace.Tests, except for the test classes that are actually testing the static property. These are marked with a TracerRestorerAttribute

* Combine remaining tests using Tracer.Instance into one test collection

Add calltarget support for Elasticsearch (#1248)

* Add calltarget support for Elasticsearch
* Disable Elasticsearch tests on ARM

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

Fix StoreWrapperMethodRef for CallTarget scenario. (#1259)

Fix Datadog.Trace.ClrProfiler.IntegrationTests.StackExchangeRedisTests.SubmitsTraces (#1266)

The KeyExpire API calls were expressed as DateTime's. This introduced variability because the DateTime for the final redis command could sometimes be represented as seconds and other times only as milliseconds, leading to occasional EXPIREAT (seconds) commands instead of the expected PEXPIREAT (milliseconds).

The fix is to make the API call with a specific TimeSpan instead so the resulting redis command is always PEXPIRE.

Downgrade the pair of StackExchange.Redis and StackExchange.Redis.StrongName NuGet packages to v1.2.3 to try to avoid a transient RedisConnectionException. (#1265)

Sources that lead me to believe the issue doesn't occur on v1.2.3:
- https://github.com/StackExchange/StackExchange.Redis/issues/762
- https://github.com/StackExchange/StackExchange.Redis/issues/1533#issuecomment-666941212

Propose fix to Datadog.Trace.Tests.RuntimeMetrics.RuntimeMetricsWriterTests.ShouldCaptureFirstChanceExceptions (#1263)

We were previously asserting that no first chance exceptions were being recorded at the end of the unit test execution, however there may be a race condition where other threads in the same AppDomain could be throwing exceptions which our runtime metrics may catch. Replace this overly broad check with one that only focuses on the custom exceptions we were throwing inside the unit test.

Propose fix to Datadog.Trace.ClrProfiler.IntegrationTests.SmokeTests.StackExchangeRedisStackOverflowExceptionSmokeTest.NoExceptions (#1264)

The program iterates over all keys in the database to test the stack overflow failure from https://github.com/DataDog/dd-trace-dotnet/issues/447. However, when a GET is issued for each key, some values are not strings. This is likely happening because another test application using the same redis instance (stackexchangeredis container in docker-compose.yml) adds other key/value pairs during its execution. While we could just patch the smoke test, the real fix is to make sure the tests that use the same instance for the operations do not run in parallel. As a result, I'm proposing putting all StackExchange tests into a new StackExchangeRedisTestCollection.

RabbitMQ CallTarget Integration (#1186)

This PR migrates the `RabbitMQ` integration to CallTarget instrumentation.

Removes the `leave.s` instruction after the `rethrow` instruction. The `leave.s` is not emmited by the roslyn compiler after a rethrow. (#1267)

DuckIgnoreAttribute to ignore members to be used when ducktyping (#1257)

* Adds the DuckIgnoreAttribute to ignore members to be used when the ducktype proxy is created.

* Changes based in the review.

* Changes based in the review.

Enable SocketsHttpHandler, CurlHandler and WinHttpHandler integrations by default. (#1277)

Enable Samples.Wcf to run in integration tests (#1273)

- Move WCF client functionality into `Samples.Wcf` test application
- Remove `Samples.WcfClient` test application
- Remove `Skip` attribute in `WcfTests`

Add CallTarget instrumentation for WCF (#1272)

Add CallTarget fastpath support for integrations with 7 and 8 parameters (#1261)

* Add Managed side modifications to accept fastpath for methods with 7 and 8 parameters.

* - Adds the fastpath support for methods with 7 and 8 arguments in the native side.
- Modify the current CallTargetNativeTest project to test the new paths.
- Create an integration test to use the CallTargetNativeTest project and Asserts the results.

* Fix CallTargetNativeTest for linux.

* Include CallTargetNativeTest into the build process for integration tests on linux.

* Fix CallTargetNativeTests

Enable inlining by default with calltarget (#1276)

Change the warning log to a debug one. (#1278)

Fixes Calltarget async continuations when an exception is thrown (#1270)

* Fixes Calltarget async continuations when an exception is thrown by the previous task.

* Move new tests to an unit test project.

* Fix files after merge, regenerate integrations.json
2021-03-16 09:24:17 -07:00
Paulo Janotti 37505fc3d0
Catchup to upstream (#70)
* Catchup to upstream

Add success/failure and timing information to tests (DataDog/dd-trace-dotnet#1210)

Switch integration tests to release (DataDog/dd-trace-dotnet#1212)

* Switch integration tests to release

* Fix build configuration

* Fix runner pipeline

bump Service Fabric version to 1.23.0 to match Datadog.Trace (DataDog/dd-trace-dotnet#1189)

CallTarget Integration: Add base DBCommand async overloads (DataDog/dd-trace-dotnet#1206)

* Add base DBCommand async overloads

* Add Samples.FakeCommand to test the DBCommand instrumentation.

* Add missing test.

* Fix FakeCommandTests.SpansDisabledByAdoNetExcludedTypes test

CallTarget Integration: ADO.NET MySqlData client version 6 (DataDog/dd-trace-dotnet#1184)

* Add MySqlData support and execute the tests in multiple client versions.

* Fix Samples.MySql.csproj project.

* Add old MySql server for older clients test.

* Fix StartsWith on .NET frameworks.

* Fix Sample.MySql project

* Fix the test for callsite instrumentation in 6.8.8 client version.

* change sample app connection string

* fix connection string param name.

* Improves the csproj file conditions.

* Remove code for debugging

* update integrations.json

CallTarget Integration: ADO.NET Microsoft.Data.Sqlite and System.Data.SQLite  (DataDog/dd-trace-dotnet#1191)

* Add Sqlite ADO.NET client structure.

* Add SqliteConstants and Definitions basic values

* Add missing methods instrumentation.

* Sqlite Samples Apps

* Add integration tests.

* Add missing build project.

* Add missing build project for arm64 and tests

* Remove the SQLite test from arm64 due to incompatibility. Sqlite requires the native sqlite lib.

* update integrations

CallTarget Integration: ADO.NET Oracle.ManagedDataAccess (DataDog/dd-trace-dotnet#1193)

* Add OracleConstants and OracleDefinitions

* Adding samples project structure.

* Adding sample projects.

* Remove TaskCancellationSource and Add Oracle.DataAccess assembly support based on the source code.

* update integrations.json

* update integrations.json

Add calltarget support for WebRequest (DataDog/dd-trace-dotnet#1204)

* Add calltarget support for WebRequest

Update stylecop (DataDog/dd-trace-dotnet#1216)

* Update stylecop

* Disable SA0001

Use release artifacts in package.sh (DataDog/dd-trace-dotnet#1222)

NUnit: Add support for TestCase custom name (DataDog/dd-trace-dotnet#1213)

* Adding support for testcase custom name and the IgnoreException.

* Include TestName to the properties metadata following the new CiAPP specs.

* Changes according to CiApp specs

Enable optimizations when building the profiler (DataDog/dd-trace-dotnet#1223)

Change `test.traits` format following the CiApp specs. (DataDog/dd-trace-dotnet#1221)

Bump the .NET Tracer version to 1.24.0 (DataDog/dd-trace-dotnet#1226)

switch build image to shared image (DataDog/dd-trace-dotnet#1100)

update builder tag to reference new builder with dotnet5 (DataDog/dd-trace-dotnet#1229)

Eager serialization of traces (DataDog/dd-trace-dotnet#1151)

* Implement eager serialization of traces
* Removing DD_TRACE_QUEUE_SIZE configuration key

Update test dependencies + fix warnings (DataDog/dd-trace-dotnet#1227)

* Update test dependencies + fix warnings

* Removing xunit tool

Remove obsolete Moq.ResetCalls (DataDog/dd-trace-dotnet#1231)

Replace map count->[] with map find (DataDog/dd-trace-dotnet#1224)

Fix environment variable name in docs (DataDog/dd-trace-dotnet#1233)

Remove heap allocations from COR_SIGNATURE definitions in the native profiler (DataDog/dd-trace-dotnet#1217)

* initial work to remove the heap allocation of signatures.

* Remove all calltarget signatures heap allocations.

Replacing DuckType `As<T>` with DuckCast, TryDuckCast, DuckAs and DuckIs (DataDog/dd-trace-dotnet#1220)

* Replacing DuckType `As<T>` with `DuckCast<T>` and `DuckIs<T>`

* Fixes test compilation.

* change `DuckIs<T>` to `TryDuckCast<T>`

* adding DuckAs and DuckIs extension methods.

* DuckType method extension tests.

Remove _W string operator from the native profiler (DataDog/dd-trace-dotnet#1215)

* Remove the string _W operator.

* Fix linux and test project compilation errors.

* fix linux compilation.

* change macro name from _LU to WStr as requested.

* Fix native test compilation error.

Fixes xUnit serializarion for CIEnvironmentVariableTests (DataDog/dd-trace-dotnet#1236)

Call the right Log overload (DataDog/dd-trace-dotnet#1240)

In some places, we call the Log overload expecting a line number, instead of the one with generic parameters.

Also disabled the Resharper warning in the places where we call the right one, to make the warning more efficient.

Fix NUnit passing status where there is not Assert. (DataDog/dd-trace-dotnet#1235)

Update the automatic logs injection sample applications (DataDog/dd-trace-dotnet#1195)

- Add another sample that consumes NLog 4.0, whose JsonLayout does not have the `includeMdc`/`includeMdlc` properties
- Update the `Datadog.Trace` package in the samples to `1.23.0` and allow it to be updated by our versioning tool
- Add `DD_ENV`, `DD_SERVICE`, and `DD_VERSION` to the logger configuration files
- Some general documentation cleanup

Update default log rate limit in debug mode (DataDog/dd-trace-dotnet#1239)

* If there's a problem constructing the logger, disable rate limiting by default

* Don't rate limit messages by default when in debug mode

CallTarget Integration: ServiceStack.Redis and StackExchange.Redis  (DataDog/dd-trace-dotnet#1230)

* StackExchange redis implementation.

* Fix tests

* Refactor RedisExecuteAsync and RedisExecuteSync classes and add missing types.

* Add CallTarget ServiceStack redis client instrumentation.
Fix System.Byte and System.SByte signature equivalence.

* Fixes tests

add Service Fabric sample app (DataDog/dd-trace-dotnet#1190)

Add GraphQL CallTarget instrumentation (DataDog/dd-trace-dotnet#1241)

Strengthen type check in the method resolution for CallSite instrumentation and improve fallback mechanism (DataDog/dd-trace-dotnet#1225)

- When resolving the original MethodInfo via metadata token, add a check to ensure the object instance can correctly be assigned to the MethodInfo type
- Enforce a stricter type check on `Task<>` return types to remove ambiguity in fallback method resolution. Modify all CallSite integrations that return `Task<>` to be explicit about the generic type
- Add failure mode to all ADO.NET test-application programs, which will run in integration-tests CI pipeline

===

It is possible to load the same assembly multiple times in an application by loading it into different assembly load contexts. One example is in .NET Core where an assembly may be loaded into the Default load context and then again into its own Assembly Load Context. When this happens, the Types from one assembly are not considered equal to the corresponding Type in the other assembly, even though the information that we can publicly observe (e.g. MVID and metadata tokens) appear to be the same. This causes a crash condition in our automatic instrumentation when the following happens:

1. Assembly1 (e.g. `System.Data.SqlClient.dll`) is loaded through the default load context
2. Our `ModuleLookup.PopulateModules` method caches a key-value pair of Assembly1.MVID and Assembly1.Module
3. The same Assembly1, let's call it Assembly1~New, is loaded into a new ALC
4. Automatic instrumentation is triggered for Assembly1\~New. We retrieve the MethodInfo by getting the cached Assembly1.Module (NOT equivalent to Assembly1\~New.Module), get a metadata token from it, and construct a dynamic method that calls into the original method
5. Invoking the original method results in a type cast exception on the instance object

One potential solution that was considered but rejected was improving the module caching to consider multiple versions of the same assembly. The only way to differentiate between the assemblies would be to compare Assembly objects or the IntPtr to the Assembly, which seemed too complex to me.

The solution pursued is to detect this scenario by adding an additional type check after we get the target MethodInfo and check that the instance object can be assigned to the Type containing the MethodInfo. Failing this check forces the method resolution to use the reflection fallback to find the right method.

This fix resolves the issue, but required a cascading set of changes to perform stronger name checks on return types when method overloads exist. Once this was done, further testing demonstrated the fallback mechanism worked for all of our integrations (minus RabbitMQ).

After testing all affected CallSite integrations except `AspNetWebApi2` and `XUnit`, the only integration whose fallback method resolution fails is `RabbitMQ`. That may require the integration point to be modified, so the work should be deferred to a separate work item.

Add CallTarget support to MongoDB (DataDog/dd-trace-dotnet#1214)

* Add CallTarget support to MongoDB

Adding Git information to test spans (DataDog/dd-trace-dotnet#1242)

* Initial basic GitInfo implementation.

* Adds Author, Committer and Message git parser.

* Changes based on the review.

Update .NET SDK versions in build (DataDog/dd-trace-dotnet#1237)

Still pinned .NET 5 SDK to latest (to avoid issues when new versions are released)
Use runtime where possible
Windows integration test pipeline installers continue to use sdk, as it includes the asnetcore runtime
Update README with latest SDK requirements

Add calltarget instrumentation for ASP.NET MVC and WebAPI (DataDog/dd-trace-dotnet#1208)

* Add calltarget instrumentation for ASP.NET MVC and WebAPI
* Convert ASP.NET WebAPI callsite integration to ducktyping

Update the version of log4net we use in our tests from 2.0.8 to 2.0.12 (DataDog/dd-trace-dotnet#1243)

Adds GitParserTests to the suite. (DataDog/dd-trace-dotnet#1247)

* Adds GitParserTests to the suite.

* Fix tests

* Fix DateTime format assert

Remove Sync-over-async in DatadogHttpClient (DataDog/dd-trace-dotnet#1218)

* Convert DatadogHttpClient to use ReadAsync instead of ReadByte
* Avoid hanging when chunked encoding (unsupported) used
* Fix new line in HTTP headers - HTTP requires that CRLF is always used, regardless of environment, so the previous implementation was invalid on Linux
* Add a SkipUntil method to optimise seek operations in network stream
* Add additional optimisations for async paths in DatadogHttpClient
* Add unit tests for DatadogHttpClient response parsing and network partial data handling
* Handle large skipping with small buffer in SkipUntil

Rename test configuration tags to follow CIApp specification (DataDog/dd-trace-dotnet#1251)

Fix CiApp Tests ServiceName (DataDog/dd-trace-dotnet#1244)

* Fix Tests ServiceName

* Changes DD_SERVICE_NAME to DD_SERVICE

* Changes based on the review.

* Fix ConfigurationSourceTests, due DD_SERVICE being set when testing DD_SERVICE_NAME.

* Add missing DD_ENV to benchmark tests.

CallTarget: CurlHandler integration (DataDog/dd-trace-dotnet#1252)

* Initial CurlHandler integration.

* Adds WinHttpHandler and CurlHandler test using an HttpMessageInvoker.

* Add integration and test for internal WinHttpHandler and CurlHandler test

* Apply suggestions from code review

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

* Apply suggestions from code review

Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>

* Remove comment.

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>

* Fix added env vars

* Separate interfaces for OTel exporters

* Skip flaky test ShouldCaptureFirstChanceExceptions

* Run PrepareRelease integrations and versions

* Fix garbled native constants

* Remove and ignore ./blog/ folder

* Fixes to Az Pipeline files: runner and unit-tests

* Keep dotnet dev req in desc order for consistency

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
2021-03-04 14:07:43 -08:00
Dawid Szmigielski 06269b95ec
Change env vars prefixes; rename profiler native dll (#61)
* Change profiler GUID; rename env variables

* Rename env variables

* Rename OPENTELEMETRY prefix to OTEL

* Rename env variables prefixes from DD to OTEL; change profiler ID

* Rename OPENTELEMETRY prefix to OTEL

* Rename instrumentation to autoinstrumentation

* Rename instrumentation to autoinstrumentation

* Fix profiler native dll name

* Fix profiler native dll name references

* Fix missed env variables

* Fix capitalization

* Fix missed env var names

* Fix missed env var names

* Revert unnecessary changes
2021-03-02 14:51:19 -08:00
Paulo Janotti 344d9e5ed7
Catchup to Upstream (#46)
* Catchup to Upstream

Update .NET tracer to 1.22.1-prerelease (DataDog/dd-trace-dotnet#1172)

Ignore agent and port when in AAS (dogstatsd) (DataDog/dd-trace-dotnet#1174)

Patch .NET 5.0 SDK cert issue (DataDog/dd-trace-dotnet#1175)

As described in NuGet/Announcements#49 and NuGet/Home#10491

Fix drive space issues related to sample projects (DataDog/dd-trace-dotnet#1171)

Exclude the profilers when buiding samples
This avoids copying 100s of MB per sample
Instead, they will load from the IntegrationTests output folder
Disables shadow copy ing the integration tests

Add MacOS support for runner/standalone tool (DataDog/dd-trace-dotnet#1136)

Adds MacOS profiler to the tool and the standalone app

fix runner

clean artifacts

Changes

MySql CallTarget integration (DataDog/dd-trace-dotnet#1168)

Initial commit for MySql instrumentation.

Fix CallTarget span count

update integrations.json

Npgsql CallTarget integration (DataDog/dd-trace-dotnet#1164)

Initial migration for Npgsql to CallTarget.

Test changes

Update Integrations.json file

Update the expected span count for calltarget instrumentation.

Update src/Datadog.Trace.ClrProfiler.Managed/AutoInstrumentation/AdoNet/Npgsql/NpgsqlConstants.cs

Co-authored-by: Zach Montoya zach.montoya@datadoghq.com

update integrations.json
Co-authored-by: Zach Montoya zach.montoya@datadoghq.com

Add missing delete[] instructions. (DataDog/dd-trace-dotnet#1177)

Add instrumentation for HttpWebRequest.GetRequestStream (DataDog/dd-trace-dotnet#1106)

Exponential Backoff Named Pipe Check (DataDog/dd-trace-dotnet#1176)

Refactor ADO.NET integrations to use the assembly integration attribute (DataDog/dd-trace-dotnet#1173)

Refactor all ADO.NET integrations to use the Assembly attribute.

Applies changes from review.

Changes from review

Add a better exception message on GenerateIntegrationDefinitions

fix typo

update integrations.json

Fix compilation and refactor MySql and Npgsql to the new integration format.

Disable automatic logs injection during IIS PreStartInit phase (DataDog/dd-trace-dotnet#1157)

This change fixes a crash that occurs under the following conditions:

.NET Framework application is hosted in IIS
Automatic logs injection is enabled
Application uses the log4net logging library
Automatic instrumentation is triggered during the IIS PreStartInit phase
In order to store ambient information for the logging context on .NET Framework, log4net uses CallContext. The first time a property is stored, a log4net dictionary type is created and permanently stored in the CallContext, even if the dictionary is later found to be empty. This creates an error condition: If this is stored into the CallContext during the IIS PreStartInit phase (which occurs in the application-specific AppDomain), then a crash will occur when the phase is finished and execution resumes in the IIS default AppDomain.

The solution is two-fold:

When automatic instrumentation is enabled, we already perform IL rewriting at the beginning of the IIS PreStartInit code path to load our managed code. Modify this code path to begin and end with a call to AppDomain.SetData to set a flag that indicates if the IIS PreStartInit phase is still running. This flag can be observed from elsewhere in the AppDomain and need not be on the same thread.
Register to a new TraceStarted event provided by the ScopeManager and register a callback to evaluate whether we're still running in this PreStartInit phase. It will either check for the AppDomain flag (if it was not-null) or it will fallback to checking the StackTrace (which is expensive). As soon as we detect false, we won't execute these checks again.
Optimizations to this strategy include never subscribing to the TraceStarted event if one of the following conditions is met at Tracer startup:

Automatic instrumentation is enabled and the IIS PreStartInit flag is already false
No automatic instrumentation is enabled and the process name is not w3wp or iisexpress
[AAS] Enable DD_LOG_LEVEL with DD_TRACE_DEBUG (DataDog/dd-trace-dotnet#1178)

Fix WinHttpHandlerIntegration (DataDog/dd-trace-dotnet#1170)

minor: fix logs in sample app
minor: fix documentation
Restructure HttpMessageHandlerTests to test all instrumentations
HttpClientHandler
SocketsHttpHandler
WinHttpHandler

Including when HttpClientHandler is not used, and when the SocketsHttpHandler is disabled.

Fix WinHttpHandlerIntegration
WinHttpHandlerIntegration was not working in tests previously. This fixes the integartion tests so that we correctly instrument WinHttpHandler

As of .NET 5.0, WinHttpHandler lives in a separate assembly: https://docs.microsoft.com/dotnet/core/compatibility/networking/5.0/winhttphandler-removed-from-runtime

Fix ServiceMappingTests
This was using the HttpMessageHandler sample, but that was made much more complex, so switch to reusing WebRequest for simplicity

Add Curl to alpine 2.x-3.x images
When DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER is "0", HttpClientHandler uses the "native" handler, which is CurlHandler on linux
Alpine doesn't have curl by default, so will throw TypeInitializationException unless it's added

AAS Prerelease 1.22.2 (DataDog/dd-trace-dotnet#1180)

CIApp Specs tests (DataDog/dd-trace-dotnet#1154)

Add json data

Add Ci environment variable tests from https://github.com/DataDog/datadog-ci-spec

MsTestV2 CallTarget integration (DataDog/dd-trace-dotnet#1132)

MsTestV2 CallTarget Instrumentation

Update integrations.json

Fix from rebase

Change the folder structure with a new Testing parent folder.

update integrations.json

Changes from the review

update integrations.json

Publish the profiler logs as artifact instead of tailing them (DataDog/dd-trace-dotnet#1181)

Bump the .NET Tracer version to 1.23.0 (DataDog/dd-trace-dotnet#1185)

Add support for synchronous HttpClient.Send() (DataDog/dd-trace-dotnet#1162)

Add HttpClientHandler sync Send integration
Virtually identical to SendAsync integration, so extracted common code to HttpClientHandlerCommon
Kept existing HttpClientHandlerIntegration name for back compat reasons
Only available in .NET 5.0 +

Add SocketsHttpHandler sync CallTarget integration

Add HttpClient.Send() tests

Fix environment variables overwrite. (DataDog/dd-trace-dotnet#1182)

Refactor regression test to expose / remove unused Datadog.Trace.AspNet code (DataDog/dd-trace-dotnet#1160)

The Log4Net.SerializationException regression test does the bare minimum to simulate the IIS PreStartInit phase to make sure that initializing a Tracer with LogsInjectionEnabled=true doesn't crash with a SerializationException. Refactor to remove a code path that is no longer used in the Datadog.Trace.AspNet.

Add Area tag to ASP.NET integration (DataDog/dd-trace-dotnet#1183)

Add area support for aspnet MVC + WebApi2 integration
Add area to AspNetMvc4 sample
Enhance AspNet tests to check correct tags are added, and to test areas
Implement log rate limiting as per RFC (DataDog/dd-trace-dotnet#1153)

Replace Log.Verbose with Log.Debug

Update the minimum log level to Debug

The RFC only uses Debug, Warn, and Error. We add Information, for emitting non-error logs (such as configuration status logs)

Update some log levels to closer align with the RFC

Add IDataDogLogger wrapper around ILogger

We'll use this to control which log levels etc are available, add rate limiting etc.
For now, implements all currently used APIs of ILogger

Add method for retrieving IDatadogLogger
Unfortunately, despite being internal, we can't change the DatadogLogging class as it will cause MethodNotFound exceptions when there's a mismatch between Manual and Automatic packages.
Instead, mark the old methods obsolete, and add new preferred methods to use.

Replace usages of ILogger with IDatadogLogger

Make IDatadogLogger interface consistent across log levels

Ensuring we don't box and allocate unnecessarily makes the interface quite verbose unfortunately.
Replace use of params. This makes for an awkward interface for callers when many parameters are used, as you must pre-allocate the array at the call site.
Removing the use of params is necessary so that we can rate limit using [CallerFilePath], which requires optional parameters, and so are not compatible with params arguments

Add [CallerLineNumber] and [CallerFilePath] attributes
Required for the log rate limiting RFC.
Unfortunately, means that some logging calls will be ambiguous unless you specify generic arguments, which is not ideal.
Placed the LineNumber attribute first, as more common to have a string argument than an int argument

Add LogRateLimiter to ensure we only write a given log X times per second
Based on the APM Tracer Logging RFC
The default (null) implementation doesn't filter any log messages
All log messages that are written indicate how many previous instances were skipped

Allow controlling rate limiting with DD_LOGGING_RATE, as per RFC

Replace SafeLogError with Error

As we now have a wrapper for the ILogger, no reason to have a separate logging extension, as can make all logging events safe
The extension was not compatible with the CallerMemberName attribute so would need updating anyway
Confirmed with a microbenchmark that the extra overhead of adding the try-catch for every log event should be negligible + it's only there when the log level is enabled anyway

Remove unused extension
Doesn't add anything over calling _logger.Error directly, and hides caller member name attributes

Propogate caller member attributes in logging extensions
Necessary for rate limiter to throttle based on original call site, otherwise all logs that call the extension would be throtted together

Handle circular static logger initialization in EnvironmentHelpers
DatadogLogging creates a shared logger instance. Creating this instance requires using EnvironmentHelpers.
This in turn tries to get the DataDogLogging.SharedLogger
This is initially set to a "null" logging implementation, and will remain as such for the lifetime of the program
Using a Lazy<> means the logger is only retrieved when ther's an exception in EnvironmentHelpers, hopefully after SharedLogger has been updated

Rollback CallerMemberAttributes in CallTargetInvoker.LogException
Not entirely sure how to get these to hook to work, or if it's even possible...

Replace empty array with Datadog.Trace.Util.ArrayHelper.Empty
Co-authored-by: Kevin Gosse krix33@gmail.com

No need to use Select( x=> x.ToSring())
Co-authored-by: Kevin Gosse krix33@gmail.com

PR review fixes
Revert log level change
Fix rate value guard
Don't add "skip count" message if skipCount == 0
Add comments
Fix usage of Clock in tests
LogRateBucketInfo can be readonly struct
Use struct as key for dictionary
Add escape hatch if CallerLineNumber attributes fails for some reason

Fix merge issue

Fix rate limit

Co-authored-by: Zach Montoya zach.montoya@datadoghq.com

Bail-out of LogRateLimiter if either filepath or line number is empty
Co-authored-by: Kevin Gosse krix33@gmail.com
Co-authored-by: Zach Montoya zach.montoya@datadoghq.com

Fix some diagnostic warnings in tests (DataDog/dd-trace-dotnet#1197)

Fix xUnit complaining about unserializable tests

Fix duplicate collection definition

Properly disable parallelization in CIEnvironmentVariableTests (DataDog/dd-trace-dotnet#1198)

Properly drain stdout/stderr in integration tests (DataDog/dd-trace-dotnet#1192)

Properly drain stdout/stderr in integration tests
Add diagnostics
Change the folder structure to use an Http parent folder. (DataDog/dd-trace-dotnet#1196)

Update integrations.json version (and fix version numbers broken in
DataDog/dd-trace-dotnet@d72b04c)

Make tool/standalone build wait on MacOS profiler build (DataDog/dd-trace-dotnet#1202)

Remove the Analyzed Span flag on Benchmarks instrumentation (DataDog/dd-trace-dotnet#1179)

Fix RequestReJIT deadlock. (DataDog/dd-trace-dotnet#1203)

Initial work to request rejit in a custom thread.

Adding shutdown mechanism.

Comment shutdown temporarily.

remove warnings.

Add support for mdMethodDef array.

formatting: missing space.

Call RejitHandler Shutdown() to stop custom thread before profiler shutdown.

Make the diagnostic log fully fire-and-forget (DataDog/dd-trace-dotnet#1169)

Avoids a case where it would lead to the HttpMessageHandler integration being called from the Tracer constructor, which in turns would call Tracer.Instance, creating a second instance of the tracer.

Update README with current links (DataDog/dd-trace-dotnet#1200)

Use DD_TRACE_LOGGING_RATE instead of DD_LOGGING_RATE (DataDog/dd-trace-dotnet#1207)

Fix MaximumVersion xml comment (DataDog/dd-trace-dotnet#1209)

Manual cherry-pick corrections

Remove deprecated method from ZipkinApi
2021-02-15 07:33:06 -08:00
Paulo Janotti dd306ab44b
Catchup to upstream (#38)
Reimplement batching on top of dogstatsd (#989)

Fix benchmarks project location in minimal solution (#994)

dd-trace dotnet cli tool (#962)

* Initial commit

* Add the linux native image into the nuget package.

* new folder structure and initial runner program file.

* Changes

* Update git ignore

* fix build

* New nuspec structure to improve nuget file size

* Removal of System.CommandLine dependency

* Refactoring and code improvements.

* fixes ignore readme.txt in nuspec.

* code cleaning.

* Adds the tool runner to the set versions tools.

* Changes based on comments.

* Apply suggestions from code review

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

* Changes from code review

* Changes from code review

* Adds a project to an standalone version.

* Change the Console project to Standalone and remove the tool compilation to the standard managed job.

* Fixes unit test pipeline

* Adds a new pipeline to build both the tool and the standalone app.

* fixes runner.yml

* fixes runner.yml

* debugging commit

* Add multiple process check for docker

* remove debugger step in runner.yml

* Update src/Datadog.Trace.Tools.Runner/Options.cs

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

* Fixes runner pipeline in azure.

* forcing linux platform in docker image

* Removed unused var

* Removed Windows machine build condition on BuildCsharpProjects

* Update solution and project for new directory structure.

* Fixes SetAllVersions

* Fixes runner.yml and linux native binary

* fixes

* Fix runner.yml

* Adds artifact publish

* fix

* Exclude the runner from the CSharpProject group.

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

Add error message when http response code is 5xx (#992)

Fix tags serialization (#996)

Add experimental integration for Microsoft.ServiceFabric.Services.Remoting.V2 (#972)

Uniformize instrumentation tags (#980)

* Hardcode const values into tags

Some values, such as SpanKind, never change for a given tag type. Having readonly property for those allow to reduce the size of the class.

Also, introduce a InstrumentationTags base class to reduce duplication.

Add .NET 5 target to integration tests (#995)

Edited the major version of integrations to target 5.x assemblies
Added a job to run .NET 5 integration tests
Added the .NET 5 SDK to all impacted pipelines
Updated the framework detection logic in tests because the TFM does not contain "netcoreapp"
Updated MySQL in Alpine because of weird failures with Alpine 3.12 (the .NET 5 image is not available for Alpine 3.10)

Automatic Instrumentation: Load Datadog.Trace.dll into a separate AssemblyLoadContext on .NET Core (#999)

Load Datadog.Trace.dll into a separate AssemblyLoadContext on .NET Core so it doesn't clash with the one provided by the NuGet package.

This fixes the error `System.IO.FileLoadException: Could not load file or assembly 'Datadog.Trace, Version=1.X.X.X Culture=neutral, PublicKeyToken=def86d061d0d2eeb'` when combining manual instrumentation (Datadog.Trace NuGet package) and automatic instrumentation on .NET Core

Remove dependency on Sigil 4.7.0 / Sigil-vNext 4.8.41 (updated) (#993)

This PR removes usages of `Sigil 4.7.0` and `Sigil-vNext 4.8.41`, removing `Sigil.dll` dependency on all target frameworks.

- Remove `Sigil` NuGet packages from `Datadog.Trace.ClrProfiler.Managed.csproj` and add direct NuGet package references to `System.Reflection.Emit` NuGet packages that were previously transitively referenced for the `netstandard2.0` build target
- `Datadog.Trace.ClrProfiler.Emit.ObjectExtensions`
  - Replace all usages of `Sigil.Emit<T>` with `System.Reflection.Emit.ILGenerator`
  - Store static field `System.Reflection.Emit.ModuleBuilder Module` to hold single module in which `MethodBuilder` dynamic methods will be emitted
- `Datadog.Trace.ClrProfiler.Emit.MethodBuilder`
  - Replace all usages of `Sigil.Emit<T>` with `System.Reflection.Emit.ILGenerator`
- `Datadog.Trace.ClrProfiler.Emit.DynamicMethodBuilder'1`
  - Replace all usages of `Sigil.Emit<T>` with `System.Reflection.Emit.ILGenerator`
- Fix `ExecuteReaderAsync` in the `SqlCommandIntegration` and `NpgsqlCommandIntegration` classes that began failing after removing Sigil. The return types were specified by the delegate to be `Task<DbDataReader>` even though the public interfaces were specified to return `Task<SqlDataReader>` and `Task<NpqgsqlDataReader>`

Fix HttpModule precondition (#1010)

Update .NET Tracer version to 1.20.0 (#1013)

Update Serilog automatic logs injection to use the new message property names (#1009)

- When using the Serilog logging library, change the message property names set by the automatic logs injection:
  - `dd.trace_id` => `dd_trace_id`
  - `dd.span_id` => `dd_span_id`
  -  `dd.env` => `dd_env`
  - `dd.service` => `dd_service`
  - `dd.version` => `dd_version`

Replaces the current profiler logger with spdlog. (#1005)

* Replaces the logs with spdlog.

* added missing files.

* Remove unused import.
Fix test project compilation.

* formatting fixes.

* Fixes the linux compilation.

* Use CMake Mirror for download binaries.

* Set curl to follow redirects.

* Adds the fmt compilation on alpine.

* Include licenses.

Add support for token resolution in DumpIL (#1012)

Vendor Tool Optimization (#1006)

fix assembly names in NpgsqlCommand.ExecuteScalarAsync() integration (#997)

Fixes ducktyping on non public structs targets (#1014)

bump version to match latest Datadog.Trace; add net461 target (#1017)

Modify our HttpModule to propagate the newly created span context through HTTP headers so the WCF pipeline can pick up the distributed trace context (#1018)

When a WCF service is hosted in IIS, the WCF service is hosted [side-by-side](https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/wcf-services-and-aspnet) with the ASP.NET pipeline so it cannot retrieve the current Datadog scope that is created by the HttpModule.

Once the HttpModule creates an `aspnet` span, the HttpModule will also inject the trace context into the HTTP request via the distributed tracing headers. Then, when the WCF pipeline is later invoked, the trace context of the `aspnet` span will be extracted from the HTTP headers of the request object (unchanged in this PR), which then connects the spans into one trace.

This has been validated in the following scenarios when hosting a WCF service on IIS:
1. HTTP request from browser (no distributed tracing)
2. Distributed trace

In both cases, the traces that were incorrectly created in parallel are now nested correctly.

StatsdClient Upgrade (#1008)

Avoid segfault in NetCoreAssemblyLoadFailureOlderNuGet regression test (#1022)

Adds a delay for the netcoreapp2.1 version of the NetCoreAssemblyLoadFailureOlderNuGet regression test to avoid a segfault when the application exits. We do this for all other regression tests that exit quickly so we no longer get a Non-success exit code 139 when running the regression test.

Fix application name. (#1024)

Improve managed tracer logs (#1011)

- Rename log files to dotnet-tracer-managed-*.log
- Add Debug level logs to document how many traces we attempt to send to the Tracer and a confirmation of how many traces succeeded or failed to send
- For exceptions when sending traces to trace agent, only log intermediate retry failures in Debug mode.

Fix an exception when the ducktype chaining is used with a public struct (private structs works fine). (#1023)

Optimize event matching in DiagnosticsObserver (#1020)

* Optimize event matching in DiagnosticsObserver

Creates a signed package using internal CI (#1019)

Make additional managed + native logging improvements (#1025)

Makes planned improvements to the managed and native tracer logging:
- Both
  - Adds a new `DD_TRACE_LOG_DIRECTORY` environment variable to take precedence over `DD_TRACE_LOG_PATH`
- Native
  - Renames output file from `dotnet-profiler.log` to `dotnet-tracer-native.log`
  - Adds `Windows`/`Linux` to the native log output
  - Change the default behavior to only print out the Datadog environment variables that are set. When set to debug mode, the native logs will write all Datadog environment variables, including empty ones
- Managed
  - Adds unit tests for dynamically setting the managed tracer's log-level

One additional fix is made: Do not use the `EnvironmentHelpers` utility class in the `EnvironmentConfigurationSource` class. This creates an indirect dependency from the configuration system to the logging system.

Add robustness to manual instrumentation code paths on .NET Framework (#1001)

Goal:
Identify and mitigate issues that arise when the .NET Tracer manual instrumentation is used in a heavily restricted .NET Framework environment. This PR avoids the automatic instrumentation code paths.

Improvements for restricted environment:
- Create a new test application that manually creates Datadog spans while running in an AppDomain with only the `SecurityPermissionFlag.Execution` permission
- Modify vendored Serilog code that produces code that may be unverifiable on .NET Framework. This throws a VerificationException when not run in full trust
- Wrap several .NET Framework method calls in try/catch blocks so SecurityException's are caught. Additionally, wrap several callsites with helper methods so that .NET Framework types and methods that require full trust callers can be enclosed in try/catch blocks
- Replace TracerConstants. with a constant string to be regenerated by the PrepareRelease tool, which avoids a SecurityException due to missing FileIOPermission when discovering the codebase of the Datadog.Trace assembly

Unrelated improvements:
- Fix possible NullReferenceException from calling GetEnvironmentVariables
- Log unhandled exceptions in Tracer logs

Add automatic instrumentation for apps/libraries referencing System.Data 2.0.0.0 (#1000)

Fixes missing ADO.NET automatic instrumentation spans when running an application on .NET Framework 4.5 (or higher) and the application or a library was built against .NET Framework 2.0.

When a .NET application or library is built for an older version of the .NET Framework it will have assembly references to that version of the framework assemblies (e.g. System.Data 2.0.0.0), but when it is run against a later version of the .NET Framework, the .NET Framework will automatically unify the framework assemblies to the current version. This means if a .NET Framework 2.0 application referenced System.Data 2.0.0.0 but it was run on .NET Framework 4.5, the runtime would actually load System.Data 4.0.0.0. In such a scenario, we should be performing automatic instrumentation because System.Data 4.0.0.0 is loaded. However, we currently do not instrument these call sites because our CallSite instrumentation can only see the version that the application/library referenced, which was System.Data 2.0.0.0, and our ADO.NET instrumentation has a set minimum AssemblyVersion of 4.0.0.0.

The proposed change is to lower the minimum AssemblyVersion of ADO.NET integration methods from 4.0.0.0 to 2.0.0.0 for the synchronous methods. This will be valid because:
1. The `ExecuteXXX` API's are identical between 2.0 and 4.0 (used for method replacement)
2. The `IDbCommand` interface is identical between 2.0 and 4.0 (used to populate span information)
3. If automatic instrumentation is on, then the user must be running .NET Framework 4.5 and, by extension, using System.Data 4.0.0.0 at runtime.

- Lower the minimum AssemblyVersion for `DbCommand`, `IDbCommand` and `SqlCommand` integration methods from `4.0.0.0` to `2.0.0.0`
- Add a new Samples.SqlServer.NetFramework20 that uses a .NET Framework 2.0 library (compiled against System.Data 2.0.0.0)

Update .NET Tracer version to 1.20.1-prerelease (#1032)

Adds try/catch to the spdlog rotating_logger_mt (#1028)

* Adds try/catch to the spdlog rotating_logger_mt

* Tries to create directory tree if is missing on linux.

* change based in comments.

Adds PlatformTarget in the ServiceFabric project file (#1030)

CleanUriSegment improvements. (#1027)

* CleanUriSegment improvements.

* Change the code and inline manually.

* Update src/Datadog.Trace/Util/UriHelpers.cs

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

* Change the algorithm to the best option according the Benchmarks: CleanUriSegmentNewNoTryParseNoDash

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

Use the new statsd API (#1026)

Use .NET 5.0 RTM in tests (#1036)

Use local trace count for trace count header (#1045)

Add Microsoft.Data.SqlClient.SqlCommand integration (#998)

generate random trace ids for rules-based sampler tests (#1042)

Removes the rotating file sink and replace it with a basic file sink. (#1044)

CleanUriSegment optimization. (#1037)

Changes the CleanUriSegment loop to a do/while (#1050)

DuckTyping fixes (#1048)

* DuckTyping fixes

* Changes.

Skip publishing the standalone CLI if the build is running inside VS (#1051)

Update .NET Tracer version to 1.21.0 (#1053)

Implement runtime metrics on netcoreapp3.1 (#1015)

improvements to rules-based sampler tests, redux (#1052)

* refactor SpanIdGenerator to make is an instance class and allow passing a seed
* don't use the thread static id generator in test

Fix CI links in Readme.md (#1058)

Update of the semantic conventions. (#1056)

AspNetCoreDiagnosticObserver optimizations. (#1038)

* Adds DuckTyping support for the diagnostic observer.
Adds ReferenceEquals optimization

* Update src/Datadog.Trace/DiagnosticListeners/AspNetCoreDiagnosticObserver.cs

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

* fix compilation issues

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

Add internal setting for the size of the trace queue (#1033)

don't use global tracer in rate limiter tests (#1047)

Fix AspNetCoreDiagnosticObserver bug (#1061)

* Fix AspNetCoreDiagnosticObserver bug.
Adds a CompleteDiagnosticObserverTest based in the benchmark test logic.

* Changes based in the review.

* - Adds support for BindingFlags in the DuckTyping library.
- Add a test for the UnhandledException branch
- Adds IgnoreCase binding flags to the AspNetCoreDiagnosticObserver

Ducktyping: DynamicMethod call through delegates. (#1054)

* Removes the DynamicMethod calli and changed with a CustomDelegate approach.

* Improves the performance of the DelegateCache class

* Update readme to modify the behavior on DynamicMethod calls.

* Fix delegate field name

Ensures the managed loader is loaded only once. (#1055)

* Adds an Interlocked.CompareExchange to the loader IL code to ensure the loader is loaded only once.

* Fix docs

* Adds a new Integration test for the multiloader bug.

* Add Samples.NoMultiLoader to the build script.

* Change based in the review.

* Update src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

Optimize IsIntegrationEnabled (#1016)

Index integrations by id instead of name for faster lookup time.

Add runtime metrics for .net framework (#1057)

Add MacOS support (#1059)

* Include osx versions of fmt and spdlog libraries

* First CMakeLists.txt changes

* Fixes compilation and linker errors for macos

* Extract process name from PID in OSX

* Keeping the WSTRINGSTREAM in non OSX platforms.

* Update Azure Pipeline

* Remove linux profiler build warnings

* Removes unnecessary lib/fmt_x64-osx folder

* Remove specific version of spdlog_x64-osx as is the same as the linux version

* Enable unit tests on macOS

Reset the GC mutex after resetting the mock (#1063)

Buffer exception count before sending (#1065)

Add runtime metric for CPU usage in percent (#1064)

* Add runtime metric for CPU usage in percent
* Detect cases when OnEventWritten is called before the constructor

Allow users to add "_dd.measured" metric to spans (#1066)

Try fixing race condition in GC test (#1071)

Commenting the spdlogger error handler. (#1073)

Temporarily disable runtime metrics (#1079)

Limit test parallelism to CPU count (#1078)

Test was running with 10 threads even though CI agent has 2 cores

Disable parallelization on runtime metrics tests (#1077)

Suppress warning NETSDK1138 (#1084)

This warning is about using versions of the framework that are not supported anymore.

Increase number of iterations for sampler tests (#1083)

With seed 771467036 and 10k iterations, the test fails with a difference of 5.6%

- Adds JobUrl for AzurePipelines (#1082)

- Remove JobUrl for Jenkins
- Populate the Tag property
- Adds missing WorkspacePath property

Log content of http response on failure (#1086)

Fixes GetILCodes crash when the original string does not have the \0 char. (#1087)

Add more information to the assertion (#1085)

Trying to debug a flaky test

Fix spurious InvalidOperationException in tests (#1091)

AAS Tags Enhancements (#1090)

Run statsd worker in a dedicated thread (#1095)

Add automatic instrumentation for WebRequest.GetResponse() calls that reference System 2.0.0.0 (#1093)

Similar to the recent System.Data v2.0.0.0 PR (#1000), we do not currently instrument calls to `WebRequest.GetResponse()` when libraries reference System 2.0.0.0, because we set the minimum version of calls to be 4.0.0.0. This lowers the minimum version allowed and adds an integration test to demonstrate the added instrumentation.

Keep same syncronization context for continuations. (#1094)

Add new configuration setting DD_TRACE_ADONET_EXCLUDED_TYPES to exclude instrumentation from specified AdoNet types (#1076)

Replaces #1072

The ADO.NET instrumentation is one of the few integrations that (currently with CallSite instrumentation) may generate multiple spans because we instrument calls to the `IDbCommand` interface and `DbCommand` base class. Current configuration settings allow us to exclude entire integrations from creating spans, but we are missing a way to prevent a subset of Db classes from generating spans. This PR adds a `DD_TRACE_ADONET_EXCLUDED_TYPES` setting that will filter out spans that would be generated from the user-specified database types, such as `System.Data.SqlClient.SqlCommand` and `Microsoft.Data.SqlClient.SqlCommand`.

Changes proposed in this pull request:
- Add `DD_TRACE_ADONET_EXCLUDED_TYPES` configuration setting
- Add unit tests for `DD_TRACE_ADONET_EXCLUDED_TYPES` in `Datadog.Trace.ClrProfiler.Managed.Tests` project
- Add integration test for `DD_TRACE_ADONET_EXCLUDED_TYPES` in `HttpMessageHandlerTests` of the `Datadog.Trace.ClrProfiler.IntegrationTests` project

Move DuckTyping library to Datadog.Trace assembly (#1098)

* Merge Datadog.Trace.DuckTyping to Datadog.Trace and remove the dependency.

* PrepareRelease msi

Bump the .NET Tracer version to 1.21.1 (#1099)

Activate C# 9 (#1089)

Revert "Temporarily disable runtime metrics (#1079)" (#1101)

This reverts commit a85d1fab075a981ebf7deaf262612c24a4dce6af.

Updating packages pipeline to .NET Core SDK 5 (#1102)

Collect metrics from aspnetcore eventcounters (#1074)

Add automatic instrumentation for RabbitMQ.Client library (#1081)

Adds automatic instrumentation for the `RabbitMQ.Client` library versions 3.6.9-6.2.1. The following spans are automatically generated when using the library:
- `exchange` operations
  - `exchange.declare`
- `queue` operations
  - `queue.declare`
  - `queue.bind`
- `basic` operations
  - `basic.publish`
  - `basic.get`
  - `basic.deliver`

Test Scenarios
1.  Binding a queue to an exchange with a specified routing key, publishing a message to the same exchange with the same routing key, and directly getting a message
2. Creating a queue, publishing a message to the default exchange using the queue name as the routing key, and directly getting the message
3. Creating a queue, publishing a message to the default exchange using the queue name as the routing key, and setting up a consumer to pull incoming messages on that queue

Isolate StringBuilderCache (#1103)

Update .NET Tracer to 1.21.2-prerelease (#1104)

Verbose Assert Message - DogStatsD Tests (#1105)

Ensure we count the span of the right test run (#1097)

Mock the clock in the RateLimiter tests (#1088)

Attempt to fix integration-tests build failure "Cannot open Datadog.Trace.dll | Datadog.Trace.AspNet.dll" (#1107)

Set `BuildInParallel=false` for the offending build step that is causing the following build errors:
- `Cannot open 'D:\a\1\s\src\Datadog.Trace.AspNet\obj\Debug\net45\Datadog.Trace.dll'`
- `Cannot open 'D:\a\1\s\src\Datadog.Trace.AspNet\obj\Debug\net45\Datadog.Trace.AspNet.dll'`

Cache FrameworkDescription (#1092)

Improve non-windows dev experience and toolchain update (#1096)

* First test to improve CMake build

* update unit-tests

* Update CMakeLists.txt

* update

* Download dependencies from make

* refactor libs

* add missing spdlog lib

* fix windows build

* force clang

* Update dockerfiles

* adding DEBIAN_FRONTEND=noninteractive

* update dockerfiles

* Update CMakeLists.txt

* Adds prerequisites detection.

* Remove bitness message in the native logs.

* Remove macOS temporal files

Disable dogfooding temporarily (#1112)

* Disables dogfooding temporarily

* Disable MSBuild custom logger.

Update the datadog agent container image. (#1111)

Add integration tests for runtime metrics (#1108)

Logs and Tracing Disable in AAS (#1109)

CallTarget Instrumentation V1 (#1007)

* Adds a basic rejit handler to retrieve all data needed for IL Rewrite

* Changes and a new function to check if a method should be instrumented or not depending of the functionID (compatible with the inlining function)

* Rejit changes with callback.

* Adds initial modifications to support call target

* Ensure we can parse the method signature before procesing.

* CallTargetState and CallTargetReturn structure

* Initial calltarget invoker handlers.

* Adds exception logger

* remove unused usings

* Adds CallTargetInvokerException and logger.

* Adds CallTargetTokens class and initial base EnsureCorLibTokens method.

* EnsureBaseCalltargetTokens WIP

* CallTargetTokens class WIP

* CallTarget WIP

* WIP

* WIP

* Fixes compilation error WIP

* WIP

* WIP

* WIP

* Finishing modifying the local vars signature and initializing variables.

* add check for return ref methods.

* BeginMethod fast path wip

* BeginMethodWithArray implementation.

* Fixes based in the test suite.

* Added try/catch in the begin method and logexception method.

* Fixes type_valueType default value. Enable DEBUG flag for the CallTargetInvoker.

* Adds EndMethod and try catch clauses.

* Fixes EndMethod return value implementation, and MethodImpl options to force Optimization and AggressiveInlining

* Fixes ReJIT deadloack and add an option to enable inlining.

* changes

* formatting fixes.

* Add inlining environment variable option.
Add token resolution for DumpIL

* Add UserString in DumpIL

* Initial work for enabling support to NGEN images

* Add two missing files to the CMakeLists

* Adds the CallTargetNativeTest project.

* changes the launchSettings

* Fixes the integrations.json

* Adds a check for ref arguments.

* fixes native test suite.

* Fixes some Cmake warnings.

* Fixes remaining CMAKE warning.

* Initial CallTargetInvoker BeginMethod handler implementation.

* CallTargetInvoker handler WIP

* Fix rebase from master

* Fixes ducktyping call in calltargetinvokerhandler

* CallTargetInvokerHandler WIP

* CallTargetInvokerHandler EndMethod WIP

* CallTargetInvokerHandler EndMethod WIP

* EndMethod with return values and Noop5Integration WIP

* Add missing Noop arguments.

* Added CreateSlowBeginMethodDelegate implementation.

* Adds OnAsyncMethodEnd to Noop integrations.
Adds Async interfaces for ducktyping.
Fixes DuckTyping chaining for struct types.

* Adds a continuation helper for OnAsyncMethodEnd, and changes the signature of the method to match the signature of OnMethodEnd.

* WIP

* Async continuations WIP

* Async continuations.

* Remove unused types and refactor things.

* HttpClient instrumentation test

* Adds support for the new InstrumentMethodAttribute

* Add an HttpClientBenchmark for CallTarget instrumentation

* Complete refactoring of the CallTargetInvoker.

* Refactor changes.

* Fix compilation fail with spdlog

* HttpClient integration refactor

* Change HttpClient namespace to HttpClientHandler.
Adds SocketsHttpHandler

* WinHttpHandler integration

* Adds comparison of the assembly name on the CallTarget_RequestRejitForModule

* Change AspNetCoreDiagnosticObserver to use DuckTyping

* Add EH clauses to the DumpIL, also remove two unnecessary instructions.

* remove indent to avoid stackoverflow

* Better documentation in the native files.

* Remove NGEN flag

* Revert PrepareRelease tool launch settings

* Remove previous NGEN work, and save it for another PR

* revert some Debug's

* Change based in zach suggestion.

* Fix enumerator iterator.

* Revert AspNetCoreDiagnosticObserver, there's already a PR with this optimization.

* Adds the IntegrationName property to the InstrumentMethodAttribute.

* Fixes the HttpClientBenchmark using block

* Small optimization when calculating the result type for Task<> and ValueTask<>

* Refactoring the proxy type creation IL code.

* Changes based in the review.

* Renamig calltarget solution folder to instrumentation based in the review

* Changes based in the review

* Update src/Datadog.Trace.ClrProfiler.Native/clr_helpers.cpp

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>

* Changes and fixes based in the review

* Fix integrations.json of the sample app.

* Fixes and refactoring.

* Adds a CallTargetEnabled environment variable in to the profiler to filter the integrations.json file and to enable or disable the calltarget mode.

* Fixes native tests.

* Fix IntegrationMapper.cs compile error after merging from master

* Move NoOp integrations to the CallTargetNativeTest.

* Restore the Disable NGEN images flag and improve the CallTargetEnabled message.

* Adds CallTarget variant for HttpMessageHandlerTests

* Changes from the review

* Fix segmentation fault on linux/macos from an uninitialized pointer.

* Fix Scope ExecutionContext in HttpIntegration

* Fix comments typo.

* Replace the anonymous method with a ContinuationAction static method.

* Change HexStr with TokenStr when showing token hex values.

* Prettier GetILCodes.

* Changes based in the review

* Apply suggestions from code review

Co-authored-by: Kevin Gosse <krix33@gmail.com>

* Fix merge from master

* Changes based in the reviews.

* Remove duplicates.

* Update integrations.json

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
Co-authored-by: Kevin Gosse <krix33@gmail.com>

Fix crash caused by EventCounters test (#1113)

Fix logging tests (#1115)

* Fix logging tests
* Disable parallelization on configuration tests

Fix failures in RuntimeMetricsWriterTests.CleanupResources (#1121)

The test could fail if an exception was thrown from another thread and that thread was still executing the FirstChanceException handler when unsubscribing

Run MongoDB tests on 2.11.* (#1119)

Removes the Logger::Shutdown method, and uses a guard to ensure the Shutdown() and ProfilerDetachSucceeded() are called after not modules are in process. (#1117)

Reenable dogfooding by removing the breaking change (#1116)

Removing warnings from the clang-tidy utility. (#1118)

* Removing warnings from the clang-tidy utility.

* increase integration tests timeout

Catch all exceptions when closing HttpListener (#1122)

Looks like there's no end to the kind of ways it can fail.

Added configuration for span errors based on http status codes (#1123)

* Added configurable options for errors based on status codes
- Move ConvertStatusCodeToString to SpanExtensions
- Introduce a IHasStatusCode interface for direct access to the strongly typed tags
Co-authored-by: Maximo Bautista <max.bautista97@gmail.com>

Fix profiler shutdown race condition (#1125)

* Fix shutdown race condition causing the stackoverflow exception + mutex error.

* changes to make it compatible with clang.

* change the .ctor

Http Over Named Pipes (#1046)

Fix SqlCommand.ExecuteNonQuery integration (#1120)

Fix AgentWriterBenchmark (#1126)

Fix path to benchmarks (#1127)

Shutdown logger before profiler shutdown. (#1124)

Fix dotnet 2.x shutdown bug affecting the profiler shutdown. (#1128)

Remove Restriction for Pipe Request Content-Length (#1133)

Bump .NET Tracer version to 1.22.0 (#1140)

Add a prefix filter in the PrepareRelease tool to filter out other version numbers in CMakeLists.txt (#1141)

Add VB tests for SQL server (#1137)

Fix reading from standard input / Console.ReadLine on the runner. (#1135)

XUnit CallTarget integration (#1130)

* XUnit integration using CallTarget instrumentation.

* integrations tool update

* Add OnMethodEnd callback recover ExecutionContext workaround.

* Change based in the review.

* Change based in the review.

* Update integrations.json

* Fix CIApp compability by removing the Analyzed flag in the span.

NUnit CallTarget integration (#1131)

* CallTarget NUnit Integration

* Changes based in the reviews.

* Changes from reviews

* Update integrations

* Fix CIApp compability by removing the Analyzed flag in the span.

* update integrations.json

Add configuration for customising span service names (#1142)

* Fix RabbitMQ not using correct servicename

* Add DD_TRACE_SERVICE_MAPPING configuration key

Used to rename a sub-service name based on configuration
For most integrations, the key is the integration type
For DbCommands, this is based on dbType.
For HttpClient, we map all http-clients, regardless of destination

* Add fastpath avoiding dictionary lookup when no service name mappings

* Add integration test for service mapping

* Wrap ServiceNameMappings dictionary to avoid direct external access

Additional mappings can be added using the `SetServiceNameMappings` method
The default path, where there are no mappings, avoids the dictionary lookup. If required, we can further optimise this later (e.g. handle small number of mappings, known integration service names etc)

* Add support for null IDictionary in .ctor

Avoids creating an unneccessary instance in TracerSettings

* Use IsNullOrWhiteSpace when creating configuration key values

* Update service mappings API to allow replacing whole configuration

Update CiApp tags according the specs. (#1145)

* Update CiApp tags according the specs.

* changes from PR review

Fix CIApp integrations by removing the Analyzed span tag. (#1144)

Scope restore on CallTarget async integrations (#1134)

* Add Scope restore support for CallTarget async integrations.

* Change OnMethodBegin code

* Fix XUnit and NUnit integration.

* Renaming OldScope to PreviousScope

Add Site Extension Version to Trace Tags (#1149)

hide build warnings for EOL targets (#1152)

Use the command as query in MongoDb (#1138)

Packages pipeline fix (#1155)

* add git to package.dockerfile

* adds --fix-missing to the apt-get command

SqlClient CallTarget integration (#1146)

* SqlClient calltarget integration Scaffolding

* SqlCommand calltarget integration.

* Update Tests

* Remove DEBUG flag

* Update integration

* Changes from the review

* Add span null check.

* Change constants class name

* Add support for custom InstrumentMethodAttribute

Fix Packages pipeline AWS cli installation (#1158)

* test different installation of aws-cli

* display installed aws cli version

Reduce number of Skipped tests (#1004)

Remove `TargetFrameworkVersionsFact` and `TargetFrameworkVersionsTheory` types so that we reduce the number of tests that are built and skipped. Instead, framework-dependent tests are only built and ran on the appropriate framework(s).

Build and Test ARM64 automatic instrumentation in CI (#1114)

* Add arm64 profiler build in unit-tests

* adds managed unit-tests for arm64 linux.

* Add integration tests for arm64

* Adds missing RabitMQ integration tests from ARM64

* Missing sample

* Add missing Samples.RuntimeMetrics

* Remove netcoreapp3.1. Is not compatible with ReJIT

* Removes the timeoutInMinutes increase

Remove reference to non-existent project (#1159)

Removed in https://github.com/DataDog/dd-trace-dotnet/commit/5c803ee09e85006

Fix ARM64 integration tests (#1166)

* Adds ArmUnsupported test category

Update dogstatsd client to v6.0.0 (#1143)

Replace log messages using string.Format style with structured log style (#1163)
2021-01-28 09:18:14 -08:00
Paulo Janotti dfa81475ce
Directory Restructuring (#973) (#27)
Simplify root directory and logically move directories for a more hierarchical structure. This PR implements the proposal outlined in https://github.com/DataDog/dd-trace-dotnet/issues/951.

Main changes include:
* Root directory now has the following directories:
    - blog
    - build
    - docs
    - samples
    - src
    - test
    - tools
* The build directory now holds release artifacts, docker files / scripts, and C# projects that are used to maintain the build files.
* The samples directory now holds non-product related code that was originally in the customer-samples directory, so that users can see the product in action.
* The src directory now holds the WindowsInstaller project so all source files needed for the product build are in the src directory.
* The test/test-applications directory is now the root directory for all test applications, with the two main flavors being `integrations` and `regression`. This significantly reduces the number of directories at the root.

Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
2020-11-03 11:04:25 -08:00
Paulo Janotti beb1d91648
Catchup to upstream prior dir reorg (#26)
* Squashed commit of the following:

commit adde8e2251
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Oct 19 19:04:19 2020 +0200

    Add a helper for empty arrays (#991)

    Acts as a polyfill on NET45, and redirects to default implementation on other runtimes

commit 2b5f7848d6
Author: Tony Redondo <tony.redondo@datadoghq.com>
Date:   Mon Oct 19 17:21:22 2020 +0200

    Redis instrumentation to ducktyping (#985)

    * Changes redis instrumentation to ducktyping.

    * Added StackExchange redis client integration

    * Changes based on the code review.

commit 2a582e84f1
Author: Tony Redondo <tony.redondo@datadoghq.com>
Date:   Mon Oct 19 16:00:59 2020 +0200

    Remove IgnoresAccessChecksToAttribute. (#990)

commit 837dd88237
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Oct 19 14:48:29 2020 +0200

    Split smoke tests into separate jobs (#920)

commit ef1edfb90d
Author: Tony Redondo <tony.redondo@datadoghq.com>
Date:   Fri Oct 16 17:57:48 2020 +0200

    Fixes setup tracer script on linux with a prerelease version. (#988)

commit 7438c8a63d
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Thu Oct 15 15:55:27 2020 -0400

    Bump verison to 1.19.6-prerelease (#986)

commit ac9609f1bd
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Thu Oct 15 15:54:35 2020 -0400

    keep Datadog.Trace.DuckTyping.dll assembly version at 1.0.0 (#987)

commit 106a8e0749
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Oct 14 14:25:25 2020 +0200

    Avoid string allocation for status code (#979)

commit f8426570b0
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Oct 14 11:14:55 2020 +0200

    Don't use string.Join for simple concatenation (#981)

commit 18728a3f18
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Tue Oct 13 15:19:43 2020 -0700

    Add PropertyFetcher tests to make sure behavior for both reference types and value types are tested (#982)

    These tests were also run against the pre-1.18.2 implementation of PropertyFetcher where retrieving properties on value types failed.

commit 1d6d4a05bf
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Oct 12 11:02:11 2020 +0200

    Use specialized storage for tags (#945)

commit 33c8bbc8f0
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Oct 12 10:46:51 2020 +0200

    Prefix Redis keys to avoid collisions with other tests (#978)

commit 2938c5a421
Author: Tony Redondo <tony.redondo@datadoghq.com>
Date:   Fri Oct 9 17:27:44 2020 +0200

    HttpMessageHandlerIntegration with duck typing (#976)

    * Initial duck typing conversion of the HttpMessageHandlerIntegration.

    * Removes old integration version

    * Adds the duck typing lib to the minimal solution.

commit 1193a08bde
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Fri Oct 9 09:52:27 2020 -0400

    avoid null reference exceptions when setting special span tags (#977)

commit 4411fd6887
Author: Colin Higgins <colin-higgins@users.noreply.github.com>
Date:   Thu Oct 8 15:56:07 2020 -0400

    Do not apply RateLimiter when using Agent sampling rates (#963)

commit 0efd7e3640
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Oct 8 11:31:07 2020 -0700

    Fix IIS Express fixture in Datadog.Trace.ClrProfiler.IntegrationTests (#966)

commit 67ffd74a6a
Author: Tony Redondo <tony.redondo@datadoghq.com>
Date:   Thu Oct 8 15:20:39 2020 +0200

    Adds IgnoresAccessChecksToAttribute trick to disable visibility checks and remove the double indirection calls on framework 4.6+. (#975)

commit 51c1e52e79
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Oct 8 13:01:47 2020 +0200

    Use HttpClient to send traces on netcoreapp target

    Restores #938

commit c6dce9caf3
Author: Tony Redondo <tony.redondo@datadoghq.com>
Date:   Thu Oct 8 11:09:41 2020 +0200

    Adds the DuckTyping library (#946)

    * Initial DuckTyping commit.

    * Change benchmark file names

    * Duck type readme documentation.

    * Fixes source code formatting.

    * Fixes formatting.

    * Update README.md

    * Fixes comments and docs.

    * - Disable compilation for the DuckType benchmarks (so we can skip them by default).
    - Refactor the ProxyActivator class and make it public.

    * Requested review changes and performance improvements. Also drops the ProxyActivator class.

    * Fixes visibility checks in .net framework

    * Changes to improve performance.

    * Adds a fast path for the a common case where we have one proxy definition for one target type 1:1 relation.

    * - Changes based in the review.
    - New Ducktype exceptions.
    - Refactoring

    * Adds the project to SetAllVersions file

    * Adds Struct data copy support to DuckType

    * Changes based in the code review

    * Fixes and changes based on the review.

    * Adds new tests to the suite.

    * Adds benchmark test for copy to struct option in duck typing

commit fc506c51de
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Oct 8 10:51:20 2020 +0200

    Enable detection of .NET 4.6.1 for GAC (#964)

commit a0fdde86c7
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Oct 8 10:50:54 2020 +0200

    Use ICorProfilerInfo4 in the profiler (#967)

    This way, we ensure that we do not attach to processes running a version of .NET older than 4.5.

commit 8a00ae2f1a
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Oct 8 10:50:25 2020 +0200

    Increase benchmarks iteration time to reduce noise (#970)

commit 203b927e4a
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Oct 7 16:14:33 2020 -0700

    Delete unused Samples.Elasticsearch.MultipleAppDomains test application (#971)

commit 2d74f5576d
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Oct 7 16:13:47 2020 -0700

    Add RabbitMQ sample (#944)

    Adds a distributed tracing example for the RabbitMQ C# SDK, which is currently not supported for automatic instrumentation

commit 96fadb461f
Author: MacroGreg <macrogreg@users.noreply.github.com>
Date:   Wed Oct 7 09:45:43 2020 -0700

    Version bump to 1.19.5 (#968)

commit d22eecd404
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Oct 5 20:02:22 2020 +0200

    Scope the HttpModule to .NET 4.0+ (#965)

commit ab12bd6681
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Oct 2 13:37:36 2020 +0200

    Add a benchmark for GraphQL (#949)

    Note: this commit also changes the way the assembly is fetched in the integration

commit 69220109d2
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Oct 1 17:33:32 2020 -0700

    Fix InvalidProgramException when instrumenting a constrained virtual method call (#937)
    `System.InvalidProgramException: Common Language Runtime detected an invalid program.`
    The issue occurs when the automatic instrumentation tries to redirect a constrained virtual method call. A constrained virtual method call is a `constrained` IL instruction followed by a `callvirt` IL instruction. This can occur when making a method call to an object whose type is a generic type variable. Since the automatic instrumentation modifies the original method call to a `call` IL instruction to invoke any one of the static integration methods, the `constrained` IL instruction is no longer valid because it does not prefix a `callvirt` IL instruction, and the result is an `InvalidProgramException`.
    When trying to apply automatic instrumentation, check if the original `callvirt` IL instruction is preceded by a `constrained` IL instruction and, if so, bail out on instrumentation in this specific method.
    - Implement profiler fix
    - Add the constrained virtual method call scenario to the AdoNet sample apps, which simultaneously tests that we do not crash and will test that, in the future when CallTarget instrumentation is performed, we correctly instrument these calls
    - Set the environment variable `DD_TRACE_NETSTANDARD_ENABLED=true` for all AdoNet sample apps by default
    - Add to the process exclusion list in `devenv.bat`

commit caad2cdfc3
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Oct 1 16:09:35 2020 +0200

    Improve HttpMessageHandler benchmark (#961)

    - Since we accept type inheriting from HttpClientHandler, no need to override the type name in the integration
    - Fill the RequestUri, otherwise some code is skipped

commit dc333dff43
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Thu Oct 1 07:37:12 2020 -0400

    stop initializing global tracer in static constructor (#954)

    * stop creating first Tracer instance in static ctor

    * create Tracer instance in getter if null

    * remove uses of TracerSettings.DisableSharedInstance

    * remove LazyInitializer.EnsureInitialized()

    * use LazyInitializer.EnsureInitialized()

commit a4e990a839
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Thu Oct 1 07:35:47 2020 -0400

    remove assembly reference to System.Net.Http (#927)

commit f3934c302a
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Oct 1 13:33:29 2020 +0200

    Clean workspace between builds (#943)

commit 963c3e29b2
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Sep 30 22:05:22 2020 +0200

    Revert "Use HttpClient to send traces on netcoreapp target (#938)" (#959)

    This reverts commit d2d6aea6ce.

commit ae44ebf482
Author: Colin Higgins <colin-higgins@users.noreply.github.com>
Date:   Wed Sep 30 13:19:48 2020 -0400

    Unused utility (#960)

commit f145a41ed7
Author: Tony Redondo <tony.redondo@datadoghq.com>
Date:   Wed Sep 30 18:40:12 2020 +0200

    Adds Datadog.Trace.MSBuild project to SetAllVersions file (#957)

commit 2a516f59ac
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Tue Sep 29 18:24:11 2020 -0400

    Merge hotfix 1.19.4 branch (#958)

commit 346a2069a6
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Sep 29 12:24:59 2020 +0200

    Properly instrument custom HttpClientHandler implementations (#952)

    * Enable integration for types inheriting from HttpClientHandler

commit de6aa8bfb5
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Mon Sep 28 18:26:43 2020 -0400

    remove setter from GlobalSettings.DiagnosticSourceEnabled (#953)

commit 3fb0fe2213
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Sep 25 18:53:42 2020 +0200

    Add a write and flush benchmark with more realistic traces (#947)

commit ae4feac06f
Author: Colin Higgins <colin-higgins@users.noreply.github.com>
Date:   Thu Sep 24 12:38:00 2020 -0400

    Blog - azure service fabric setup (#932)

commit a2a3d9bc9e
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Sep 24 16:16:29 2020 +0200

    Add new integration benchmarks (#941)

commit d2d6aea6ce
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Sep 24 13:05:53 2020 +0200

    Use HttpClient to send traces on netcoreapp target (#938)

commit de410d92a0
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Mon Sep 21 22:09:02 2020 +0200

    Ci App - unit tests dogfooding (#933)

    * Adds the benchmark pipeline to the project solution.

    * Adds the tracer to unit tests build and test process.

    * Changes the CoorelationIdentifierTests to run in serial mode and ensuring the tracer is restored in each test.

    * Change attribute usage

    * Fixes AzureAppServicesMetadataTests to run sequentially and to restore the AzureAppServices metadata before each test execution.

    * Adds native build logger

    * Adds missing logger in the native compilation.

commit 9d1f0e380c
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Sep 21 17:38:14 2020 +0200

    Add support for netcoreapp3.1 (#912)

commit 220ea3ece4
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Thu Sep 17 18:16:59 2020 -0400

    use Tracer.Instance in ASP.NET Core integration (#903)

commit b5f0808f3f
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Sep 17 13:39:56 2020 -0700

    Remove net45 and net461 assembly reference on System.Runtime.Serialization.dll (#929)

    Remove HAVE_DATA_CONTRACTS and HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE compiler flags in the vendored Newtonsoft.Json implementation to remove System.Runtime.Serialization.dll assembly reference on net45 and net461

commit ce0a51c673
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Thu Sep 17 21:25:41 2020 +0200

    Fixes the truncated branch name on azure pipelines. (#936)

commit 04361ce078
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Sep 17 20:32:20 2020 +0200

    Remove SQL tests that don't enable netstandard (#935)

commit 6a74fcc813
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Wed Sep 16 12:19:26 2020 -0400

    Version bump 1.19.3 (#934)

commit 6c5656e29d
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Sep 16 11:24:20 2020 +0200

    Use dedicated pool to run benchmarks (#931)

commit cf6af6902f
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Sep 15 17:49:32 2020 +0200

    Tail logs only once in Linux integration tests (#930)

commit 71e116052c
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Tue Sep 15 08:22:42 2020 -0400

    add value of DD_TRACE_NETSTANDARD_ENABLED to profiler log (#928)

commit 6026c19c87
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Mon Sep 14 13:50:52 2020 -0700

    In Datadog.Trace.Tests.Sampling.RateLimiterTests.Limits_Approximately_To_Defaults, reduce the number of spans sent in each burst to unit-test rate limiter in a non-overloaded state. (#926)

    In Datadog.Trace.Tests.Sampling.RateLimiterTests.Limits_Approximately_To_Defaults, reduce the number of spans sent in each burst to unit-test rate limiter in a non-overloaded state.

    The current unit test sends approximately 800 spans a second whereas the default threshold is 100 spans a second. In this scenario, the rate limiter is more aggressive than anticipated and leads to transient test failures. Instead, reduce the load to 400 spans a second.

commit 689067fffc
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Sep 11 18:45:46 2020 -0700

    Make Datadog.Trace.Tests.AgentWriterTests.WriteTrace_2Traces_SendToApi more reliable (#923)

    Force a flush in Datadog.Trace.Tests.AgentWriterTests.WriteTrace_2Traces_SendToApi to make sure the trace is written to the API

commit 4981e332bf
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Sep 11 10:11:56 2020 -0700

    Fix SecurityException when making cross-AppDomain method calls and using CallContext (#925)
    `System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.`
    The issue manifests under three conditions:
    1. The user is running .NET Tracer 1.19.2 on .NET Framework
    2. The `net45` Datadog .NET Tracer is used (default scenario), which stores the ambient `Active` scope inside the CallContext because there is no AsyncLocal<T> type
    3. A method call is made into a new AppDomain without the `SecurityPermissionFlag.RemotingConfiguration` enabled
    For net45 where AsyncLocal<T> is not a built-in Framework class, we must propagate the ambient context using LogicalCallContext. One consequence of this is that we invoke the System.Runtime.Remoting infrastructure, and if a remote method call or cross-AppDomain method call is made, objects stored inside the LogicalCallContext are transmitted to the other side (aka the "server").

    For distributed garbage collection, the "server" uses leases / sponsors to keep track of what objects are needed by "clients" (our original AppDomain) and should not be garbage collected. If we do not refresh the lease on objects stored inside the LogicalCallContext, the "server" will garbage collect them and disconnect them, meaning any accesses of the object inside the LogicalCallContext will throw a RemotingException.

    The previous solution for this problem was to create a wrapper object called `DisposableObjectHandle` (which is the object stored in the CallContext and transmitted to the "server") and let it manage its Lifetime with the Remoting infrastructure, which includes calling into the `base.InitializeLifetimeService()` method which is `SecurityCritical`. However, if execution flows into an AppDomain that does not have the `SecurityPermissionFlag.RemotingConfiguration` enabled, this will result in a SecurityException.
    Modify the `DisposableObjectHandle` wrapper to return `null` for its `InitializeLifetimeService()` method, which will keep the object alive indefinitely and not require any method calls into `SecurityCritical` code. Then, only remove the object from the "server" when the ambient `Active` scope in the originating AppDomain changes. This method call will not be invoked inside the locked-down AppDomain but instead in the application AppDomain where `Datadog.Trace` is loaded from the GAC.

commit ed745572d6
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Sep 10 09:39:14 2020 -0700

    Move the Thread.Sleep call to the end of the Main methods in the smoke tests to avoid netcoreapp2.1 profiler shutdown race condition. (#921)

    Move the Thread.Sleep call to the end of the Main methods in the smoke tests to avoid netcoreapp2.1 profiler shutdown race condition.

commit f9455b8eec
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Sep 10 09:38:02 2020 -0700

    Fix Datadog.Trace.Tests.DogStatsDTests.Send_metrics_when_enabled (#922)

    - The dogstatsd test waits for one span to get to the agent, which will automatically happen at Tracer startup due to the startup diagnostics check. Disable this feature when running the unit test.

    - Remove statsd.VerifyNoOtherCalls(). With a timer-based heartbeat, we can easily get statsd.Send() methods that are not verified in between the previous check and the end of the method.

commit 0ea2fd1db7
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Sep 10 17:23:51 2020 +0200

    Remove usages of WebClient.IsBusy (#918)

commit 4a9afe12e1
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Thu Sep 10 16:51:49 2020 +0200

    Reverts the analytics tag removal. (#924)

commit 81c8ce6c97
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Sep 10 14:22:45 2020 +0200

    Cache agent response and discard default sampling rates (#902)

    * Cache agent response and discard default sampling rates

commit af3da2219c
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Sep 10 13:39:24 2020 +0200

    Fix warnings in benchmarks project (#917)

commit 3b1cd0992c
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Sep 10 13:39:10 2020 +0200

    Make benchmark results more stable (#897)

    * Make benchmark results more stable

    - Add a setting to disable the default Tracer instance
    - Force an invocation of the aspnetcore benchmark in the static constructor

commit e22b435c35
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Sep 9 19:18:36 2020 +0200

    Don't build samples in parallel (#919)

commit 6afd3a6466
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Sep 9 17:56:23 2020 +0200

    Optimize AspNetCoreDiagnosticObserver path (#907)

    * Optimize header tags feature on aspnetcore
    - Remove the intermediary dictionary
    - Skip the feature if no header tag is set
    * Remove heap allocations
    - Cache the string for status code 200 (nominal case)
    - Remove useless Uri creation when calling GetRelativeUrl

commit b173bb4f8b
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Sep 9 16:52:53 2020 +0200

    Add unit tests for AspNetCoreDiagnosticObserver (#916)

commit d26d95b8ad
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Sep 9 12:18:31 2020 +0200

    Update benchmarks.yml for Azure Pipelines (#915)

commit 0e63d9bce8
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Wed Sep 9 11:56:14 2020 +0200

    Dump IL rewrite code from profiler to the log (#871)

    * Adds a new env var to dump the il code being modified.

    * Improve  GetIlCode by resolving the names of the opcodes.

    * removes unused imports

    * Add support for CEE_SWITCH_ARG and CEE_COUNT

    * formatting

    * fixes MaxStack calculation when CEE_COUNT and CEE_SWITCH_ARG are used.

    * Using std::endl for endline chars.

    * Adds the current max stack value to the dump

    * Update src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp

    Co-authored-by: Kevin Gosse <krix33@gmail.com>

    Co-authored-by: Kevin Gosse <krix33@gmail.com>

commit 789a6872a1
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Wed Sep 9 10:44:30 2020 +0200

    Changes test spans sampling priority (#911)

    * Changes the UserKeep sampling priority (2) to AutoKeep (1) and removes the Analytics tags according to the CiApp specification.

    * Changes test spans sampling priority to Benchmarkdotnet

commit b19bea4751
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Wed Sep 9 10:36:59 2020 +0200

    Change the span duration of a benchmark test to the mean duration. (#914)

commit d43c04c91d
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Wed Sep 9 10:35:33 2020 +0200

    Flushes the tracer buffer before exiting the ExportToFiles method. (#913)

commit 3cdf1f69d1
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Wed Sep 9 10:18:49 2020 +0200

    MSBuild logger try/catch blocks (#873)

    * Add some try/catch blocks to avoid breaking builds in case of errors.

    * Ensures the sampling priority as AutoKeep (1)

commit ffe97c72ab
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Sep 4 15:21:09 2020 -0700

    Do not use GitVersion in packages build pipeline (#910)

    We only use GitVersion to print out a commit descriptor file index.txt for testing purposes, but we can do this without a third-party external Azure Pipelines task.

commit 7162150e51
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Sep 3 15:39:03 2020 -0700

    Remove cron job since this will fire for each merge to master (#905)

commit 4b14fc581b
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Sep 3 10:11:04 2020 -0700

    Unit test improvements (#888)

    Affected tests:
    - `Datadog.Trace.Tests.DogStatsDTests.Send_metrics_when_enabled`: Improve the logic that validates 1+ errors when sending traces to the agent

commit 927fe32ca7
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Sep 3 19:00:40 2020 +0200

    Force msbuild to build sequentially (#883)

commit 6bb330811f
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Sep 2 13:17:21 2020 -0700

    Remove assembly reference to System.Xml.Linq (#898)

    Newtonsoft.JSON uses System.Xml.Linq features when compiled with the HAVE_XLINQ compilation flag. Removing this will still allow correct funtionality while removing an assembly reference that is not used by the rest of the Tracer.

commit 5c85e5dfef
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Sep 2 13:13:28 2020 -0700

    Replace individual authors in NuGet package with Datadog (#900)

commit cb759c4952
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Sep 2 13:11:29 2020 -0700

    Ensure that we send statsd metrics on trace agent request failure (#899)

commit 08fcdde30e
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Sep 2 11:57:57 2020 +0200

    Make sure to build the benchmarks when validating the code (#894)

    * Make sure to build the benchmarks when validating the code

    * Skip net472 compilation on Linux

commit 3517c776bd
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Sep 2 11:24:16 2020 +0200

    Add a benchmark for aspnetcore (#879)

    * Add benchmark for aspnetcore

commit 1a9d39a5df
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Sep 1 19:53:14 2020 +0200

    Fix compilation of benchmarks (#893)

commit 9732cb1c2c
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Mon Aug 31 11:42:28 2020 -0700

    Update version to 1.19.2 (#895)

commit 8ce36c0e71
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 28 15:59:13 2020 -0700

    Remove experimental Azure Pipelines (#892)

commit 3c3cb95820
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 28 15:55:38 2020 -0700

    Re-add azure-pipelines.yml with trigger: -master and pr: -master as suggested by Microsoft (#891)

commit 0cfc8c5736
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 28 15:37:09 2020 -0700

    Delete azure-pipelines.yml per recommendation of Microsoft (#890)

commit ca47103542
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 28 15:04:04 2020 -0700

    New integration-test pipeline to see if CI triggers function correctly (#889)

commit d95f03669a
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 28 12:10:46 2020 -0700

    Add more resiliency to unit tests (#886)

    Tests affected:
    - `Datadog.Trace.Tests.ApiTests.SendTracesAsync_500_ErrorIsCaught`
    - `Datadog.Trace.Tests.Sampling.RateLimiterTests.Limits_Approximately_To_Defaults`

commit 0e7efe8390
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Aug 28 15:01:24 2020 +0200

    Change table names in Dapper test (#887)

    This could cause error if the test runs simultaneously with Samples.Npgsql

commit a1723bd91a
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Aug 28 11:08:50 2020 +0200

    Increase LocalDB connection timeout in tests (#885)

commit a2348ecfef
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Aug 28 09:58:21 2020 +0200

    Add delay to all smoke tests to prevent SIGSEGV (#884)

commit 0ead03c41f
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Aug 27 19:18:18 2020 -0700

    Small improvements to ObjectExtensions class (#863)

    - Add unit tests to make sure the `CallMethod` overloads work with different specified return types
    - Add fix to include the return type in `CallMethod` cache keys
    - Remove unused `CreatePropertyDelegate`

commit a55c7e1d09
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Aug 27 18:03:19 2020 -0700

    Fix trace agent connection issues that emerge in Azure App Service environment (#852)

    - Fix regression from v1.18.0 when the Tracer began using WebRequest instead of HttpClient. This change caused us to miss SocketExceptions that indicated we needed to restart the trace agent, since the SocketException was nested in two exceptions instead of one. Now, we unwrap the exceptions until reaching the innermost exception to determine if we encountered the SocketException.
    - Make Api._tracesEndpoint mutable so retries can receive an updated port number, if needed.
    - Reset the ProcessMetadata.HasAttemptedStartup field when forcing a restart so consecutive failed Trace agent responses don't trigger resets that are already in-progress.
    - Immediately catch ArgumentExceptions when invoking Process.GetProcessById because we fully expect this to occur.

commit c9740be924
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Aug 27 14:39:16 2020 -0700

    Fix "FileNotFoundException (Could not load file or assembly ‘System.Net.Http, Version=4.0.0.0’ . . .)" (#880)
    Beginning with .NET Tracer v1.18.0, the following error message begins occurring: `Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.` This occurs in the following conditions:
    - The application targets .NET Framework 4.6 or higher
      - .NET Core is unaffected
    - The application references the System.Net.Http NuGet package
    - The application has a binding redirect on System.Net.Http to load a version higher than 4.0.0.0
    - At least one application assembly references System.Net.Http 4.0.0.0 (the same as the .NET Tracer)

    This occurs because the .NET Tracer still has  a transitive dependency on `System.Net.Http, Version=4.0.0.0` by having an assembly reference to `System.ServiceModel, Version=4.0.0.0`. This transitive dependency on System.Net.Http was not an issue until version 1.18.0 of the .NET Tracer when the .NET Tracer began implementing a new CLR Profiler callback called `ICorProfilerCallback6::GetAssemblyReferences` (see #876 for further background). This new behavior results in the .NET runtime eagerly loading the entire assembly closure for a given assembly to ensure that the domain-neutral decision made at the time of loading is correct. In our case, the assembly closure walk of `Datadog.Trace.ClrProfiler.Managed` triggers an eager load of System.Net.Http v4.0.0.0. However, this load fails, and all subsequent loads of System.Net.Http v4.0.0.0 (including those from the application code) return with a cached load failure, even though they should be redirected to the version specified in the web.config.
    - Remove assembly reference to `System.ServiceModel.dll` in `Datadog.Trace.ClrProfiler.Managed.dll`
    - Modify WCF automatic instrumentation to dynamically access fields / properties on WCF objects
    - Add a test for the WCF automatic instrumentation

commit 6167e273f2
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Aug 27 13:48:17 2020 -0700

    Remove System.Diagnostics.DiagnosticSource from the .NET Framework build (#881)

    After working on #880 (which focuses on System.Net.Http), it seems especially dangerous to even have an assembly reference on an assembly that can be provided by NuGet instead of the GAC. After further testing, the same System.Net.Http failure mode can occur with System.Diagnostics.DiagnosticSource if there is a binding redirect on the assembly and one of the assemblies in the application was compiled against the same version as the .NET Tracer (System.Diagnostics.DiagnosticSource Version=4.0.2.1).

    Since we do not use System.Diagnostics.DiagnosticSource right now on .NET Framework, this change removes it from the build to get rid of the possibility of assembly loading issues. Properly loading this on .NET Framework will be addressed when we begin moving towards using the Activity class to propagate events.

commit a6e9c7f246
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Aug 27 19:01:19 2020 +0200

    Skip DNS resolution when agent is bound to localhost (#865)

commit 5197cceb99
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Aug 27 18:10:55 2020 +0200

    Increase timeout for Windows integration tests (#882)

commit 0d6505f528
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Aug 25 16:10:05 2020 +0200

    Use a cached buffer for serialization (#867)

    * Use a cached buffer for serialization

commit 7d88cf43df
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Aug 25 16:09:07 2020 +0200

    Add a delay on netcoreapp2_1 tests to avoid SIGSEGV (#878)

    * Add a delay on netcoreapp2_1 to avoid SIGSEGV

    * Fix compilation error

commit 043d91f38b
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Aug 25 16:08:47 2020 +0200

    Update CI job for benchmarks (#877)

commit 5d9bb20836
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Mon Aug 24 10:38:28 2020 +0200

    Fixes InvalidProgramException when reading push values outside the boundaries of the array (#875)

    This PR fixes a possible InvalidProgramException when the IL method body contains switch statements due to invalid maxstack header value by reading outside the boundaries of the push values array. To mitigate this we add the missing values to the array.

commit e10efdd8f5
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Aug 24 10:35:28 2020 +0200

    Update benchmarks.yml for Azure Pipelines (#874)

commit 3d62e0e2cf
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 21 10:24:06 2020 -0700

    Fix "CallVirtual expected a StackExchange.Redis.RedisBase; found StackExchange.Redis.RedisBase" (#872)
    Today we still have an issue in the automatic instrumentation of `StackExchange.Redis.RedisBase.ExecuteAsync`. The first time this method is executed, the type of the object instance is saved and cached for speedup purposes. Unfortunately, this leads to errors when both `StackExchange.Redis` and `StackExchange.Redis.StrongName` libraries are brought into the app because they can both enter this integration method but the types are **not** identical because they are defined in separate assemblies.
    - Fix the `StackExchange.Redis.RedisBase.ExecuteAsync` method replacement to always perform a type lookup on the instance object
    - Improve our test application to exercise async code paths when both `StackExchange.Redis` and `StackExchange.Redis.StrongName` libraries are used
    - Extra: Small GraphQL edit which removes unused code path

commit e5e4ac039d
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Fri Aug 21 11:55:55 2020 +0200

    NUnit framework integration (#870)

    * Initial integration structure

    * Fixes integration types.

    * finishing the NUnit test framework integration.

    * Fixes.

commit 7b9bd2bf2c
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Aug 20 12:13:16 2020 -0700

    Vendor Newtonsoft.Json 12.0.1 (#838)
    This PR vendors `Newtonsoft.Json 12.0.1` which removes the assembly dependency on `Newtonsoft.Json.dll` for all target frameworks.
    1. Adding the source of `Newtonsoft.Json 12.0.1` into the Vendors folder and prefixing the namespaces with Datadog
    2. Revising 3rd party license file
    3. Normalizing line endings for the output of the UpdateVendors tool
    1. Deserialize the (small) response from the Trace agent after submitting traces
    2. Deserialize an input `datadog.json` configuration file
    3. Deserialize `DD_TRACE_SAMPLING_RULES`
    4. Serialize startup diagnostic logs into a JSON object

commit 525565d215
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Tue Aug 18 10:35:15 2020 -0700

    Revert "Skip DNS resolution when agent is bound to localhost (#841)" (#864)

    This reverts commit 7839843fbf. The tests need to be updated to accommodate the DNS change.

commit aa4183751c
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Aug 18 18:37:40 2020 +0200

    Add netstandard feature flag to the diagnostic log (#866)

commit 09708ae956
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Aug 18 18:37:17 2020 +0200

    Switch back to installing the sdk in the build image (#868)

    The base runtime does not contain the required aspnetcore runtime

commit 356eb12fe2
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Aug 18 10:41:15 2020 +0200

    Add CI pipeline for benchmarks (#862)

commit effc52ce15
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Aug 17 18:45:14 2020 +0200

    Add DatadogExporter to SpanBenchmarks (#861)

    Also, fix a compilation error

commit 105399c179
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Aug 14 17:46:01 2020 +0200

    Always use the default WebRequest for the http:// prefix (#860)

commit 7efc479418
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 14 08:29:46 2020 -0700

    Fix DisconnectRemoteObjectsAfterCrossDomainCallsOnDispose unit test (#855)

    * Fix DisconnectRemoteObjectsAfterCrossDomainCallsOnDispose by introducing a CountdownEvent with a timeout

    Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

commit 36f0050c75
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Aug 14 17:20:31 2020 +0200

    Add benchmark for the AgentWriter (#842)

    * Disable trace and diagnostic logs for benchmarks

    * Add benchmark for flushing traces in the agent

commit 5618720f1c
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Aug 14 17:01:15 2020 +0200

    Configure the benchmarks project for micro-benchmarks (#859)

    * Configure project for microbenchmarks

    - Added to the minimal solution
    - Added a microbenchmarks folder with gitignore file

commit 7839843fbf
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Aug 14 16:45:20 2020 +0200

    Skip DNS resolution when agent is bound to localhost (#841)

    * Skip DNS resolution when agent is bound to localhost

commit 2781748ec4
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Thu Aug 13 21:52:28 2020 +0200

    Azure Pipelines Environment Variables fixes (#857)

    * Fixes:
    - PipelineUrl double slash '/'
    - Retrieve Commit sha from the PR and fallback to merge commit (in case of a PR).
    - Retrieve Branch from the PR and fallback to merge branch (in case of a PR).

    * Fix env var key

commit 90b5d730b4
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Aug 13 17:21:42 2020 +0200

    Use command-line args to configure benchmarks (#853)

    * Configure benchmark from command line
    * Add Datadog exporter to default config

commit 16f72c51a2
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Thu Aug 13 11:03:34 2020 -0400

    use fixed SDK version instead of latest (#854)

commit ab1b1eb3af
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Aug 13 11:51:34 2020 +0200

    Fix error handling when sending traces to the agent (#850)

commit 04241cd1f6
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Aug 13 11:13:06 2020 +0200

    Fix templates for log messages (#847)

commit 2081eaac25
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Tue Aug 11 16:17:36 2020 -0700

    Fix "System.Runtime.Remoting.RemotingException: Object /xxx/xxx.rem has been disconnected or does not exist at the server." (#822)

    When building Datadog.Trace for net45, we simulate AsyncLocal storage (needed for correct scope management) by storing the current Scope in the Logical Call Context. This uses the remoting infrastructure which sets default leases on objects stored in the Logical Call Context. If execution happens in another AppDomain and the lease expires, we get the above exception.

    This PR follows the solution laid out by Serilog when they previously encountered this error. See issue https://github.com/serilog/serilog/issues/987 and the corresponding fix https://github.com/serilog/serilog/pull/992. When adding objects to the Logical Call Context, add logic so they always have an object claiming a lease on them from the host AppDomain so they never get removed from the "remote client" (Logical Call Context).

commit e540c8ab97
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Tue Aug 11 13:19:32 2020 -0400

    Merge release/1.19.1 into master (#851)

commit 51647160d0
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Aug 10 19:25:40 2020 +0200

    Fix early disposal of the IApiResponse instance (#846)

    * Fix early disposal of the IApiResponse instance

commit 4b8037d1b7
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 7 16:12:08 2020 -0700

    Remove NuGet package dependencies from Datadog.Trace and Datadog.Trace.ClrProfiler.Managed (#761)

    - Remove `Microsoft.CSharp` NuGet package reference. This was only necessary for using the `dynamic` keyword, so those have been refactored to objects that use our existing `ObjectExtensions` methods
    - Remove `System.Runtime.InteropServices.RuntimeInformation` NuGet package reference. This is responsible for the additional `System.Runtime.InteropServices.RuntimeInformation.dll` on all platforms. It is built-in for `netstandard2.0` so the logic that uses the new API's was ifdef'd out of the .NET Framework build targets.
    - Remove `Microsoft.Win32.Registry` NuGet package reference. This was no longer needed after refactoring of `FrameworkDescription` code.

commit 185943a714
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 7 16:07:42 2020 -0700

    Remove unnecessary System.Collections.NonGeneric NuGet package (#839)

    Remove unnecessary System.Collections.NonGeneric NuGet package that was originally added to vendor Serilog. This was defined in the original Serilog.csproj when compiling for netstandard2.0, but the final assembly only has one assembly reference, which is netstandard.dll, so this NuGet package is unnecessary and can be removed without affecting the compilation.

    This saves space by not publishing the System.Collections.NonGeneric.dll for the netstandard2.0 framework in the Windows MSI and it saves potential confusion about the dependency tree of Datadog.Trace.dll

commit f57a8c6098
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 7 16:06:54 2020 -0700

    Improve HttpClient and WebClient sample to test all public API methods (#830)

    - Remove WebRequest-related tests out of the all-encompassing Samples.HttpMessageHandler sample application and place it into a new sample application Samples.WebRequest
    - Rename test files so they either say "HttpMessageHandler" or "WebRequest", which matches the integration name
    - Improve Samples.HttpMessageHandler sample application by executing all `xxxAsync` methods in the HttpClient public API
    - Improve Samples.WebRequest sample application by executing all `Downloadxxx` and `Uploadxxx` methods in the WebClient public API and executing `GetResponse` and `GetResponseAsync` methods in the WebRequest public API

commit 39e3e3e44f
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Aug 7 13:10:35 2020 -0700

    Bump .NET Tracer version to 1.19.0 (#845)

commit 94ae046163
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Fri Aug 7 09:52:10 2020 -0400

    dummy edit to try to trigger CI pipeline (#844)

commit 1885c2ffc4
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Fri Aug 7 09:43:03 2020 -0400

    add test ci pipeline (#843)

commit dab78e575e
Author: Kevin Gosse <krix33@gmail.com>
Date:   Fri Aug 7 15:07:29 2020 +0200

    Ensure the HttpWebResponse is disposed (#840)

commit c5c518552a
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Thu Aug 6 18:16:00 2020 -0400

    add feature flag to instrument calls into netstandard.dll (#834)

commit 4863ad486a
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Aug 5 10:07:59 2020 -0700

    Run the Azure DevOp packages pipeline nightly (#833)

    Schedule the packages build to run once daily at midnight if the source hasn't changed from the last scheduled run. This is typically not needed but currently the build is not being triggered on each merge, so this can act as a way to keep the packages build running consistently.

commit 2ab6ad437d
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Wed Aug 5 09:49:56 2020 -0400

    include master explicitly in CI trigger (#837)

commit 9a512899c2
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Tue Aug 4 12:09:53 2020 -0700

    Temporarily create duplicate unit-test-experimental Azure DevOps Pipeline (#832)

    The `unit-tests` and `packages` pipelines are currently only being triggered for PR's but not continuous integration (commits to `master`). This PR duplicates the `unit-tests` pipeline into a new `unit-test-experimental` pipeline, in hopes that creating a new build and merging the pipeline definition to `master` solves the issue, as this seems to be a transient issue with Azure DevOps (see https://stackoverflow.com/questions/45471377/vsts-continuous-integration-triggers-not-working).

commit dd7dda7bf6
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Tue Aug 4 18:42:16 2020 +0200

    BenchmarkDotNet integration (#817)

    * Adds a BenchmarkDotNet integration by using an Exporter.
    * Adds a new benchmarks folder with a benchmark project.

commit 8cd942906e
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Tue Aug 4 18:41:02 2020 +0200

    Profiler FlattenIntegrations call (#831)

    * - Changes the FlattenIntegrations call to the Initialize method.
    - Refactor the version comparisor for the Managed side of the profiler reducing string allocations.

    * Removes the private integrations_ vector no longer in use.

commit 2f54732ed0
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Tue Aug 4 09:38:20 2020 +0200

    msbuild logger integration (#811)

    * MsBuild integration by using a logger implementation.
    * Writes the msbuild errors and warning as a json string to be collected with the CI instrumentation.

commit 8d580e06b6
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Mon Aug 3 11:19:00 2020 -0700

    Fix flaky Samples.SqlServer integration test (#827)

    Add several connection retries in Samples.SqlServer to overcome flaky connection failures.

commit 8f7d98e9a5
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Mon Aug 3 09:20:48 2020 -0700

    Fix flaky OrleansCrash smoke test (#826)

    Wait for the Orleans client to be initialized before calling GetGrain.

commit 90bc7e8655
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Mon Aug 3 12:22:32 2020 +0200

    xUnit framework integration (#802)

    * Adds the xUnit test framework integration to report test traces using the profiler.

    - Adds the xUnit integration class to handle test executions.
    - Extracts CI environment variable values.
    - Modifies the tracer to support flushing data without closing the writer.
    - Modifies the span allowing to reset the start time just before the test starts, allowing us to have more precise data.
    - Adds new span types.

commit fb2359b06c
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Aug 3 12:06:57 2020 +0200

    Optimize HttpMessageHandlerIntegration (#808)

    * Optimize HttpMessageHandlerIntegration

    - Make SpanContextPropagator.Inject generic to prevent the boxing of the headers collection
    - Add an overload in TypeExtensions to avoid building the full type name
    - Stop using String keys in AsyncHelper
    - Reuse the boxed cancellationtoken when needed
    - Split SendAsyncInternal to avoid allocating the async state machine on the fast path
    - Cache the "namespace and name filters" array
    - Cache the return task type

    * Added a generic task converter and stopped relying on AsyncHelper

    * flipped order of equality checks

    Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

commit b9ef99f2cb
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Fri Jul 31 09:13:42 2020 -0700

    Delete SecurityGrant.FileNotFound smoke test and application (#828)

    This test attempted to replicate the dreaded domain-neutral issues and is now superseded by the test application Samples.MultiDomainHost.Runner

commit 58e323325b
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Jul 29 01:35:47 2020 +0200

    Fix RNG seeding issues on .NET Framework (#795)

    On .net framework, the clock is used to seed the new random instances.
    The resolution is too low, so if a bunch of threads are created at the same time, they'll all get the same seed. Instead, use a shared random instance to generate the seed.

commit 4f67f024e1
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Tue Jul 28 10:50:18 2020 -0400

    Add "contact support" details to bug report template (#825)

commit ec5f59eaab
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Mon Jul 27 14:58:39 2020 -0700

    Vendor MessagePack 1.9.3 (#806)

    This PR vendors `MessagePack 1.9.3`, which removes a number of external assembly dependencies while minimally affecting our current Datadog trace exporting code.

    Changes in this pull request:
    1. Adding the source of `MessagePack 1.9.3` into the Vendors folder and prefixing the namespaces with Datadog
    2. Removing code that relied on the `System.Threading.Tasks.Extensions 4.5.3` NuGet package
    3. Removing code that relied on the `System.ValueTuple 4.5.0` NuGet package
    4. Removing code that relied on the `System.Reflection.Emit.Lightweight 4.3.0` NuGet package
    5. Removing code that relied on the `System.Reflection.Emit 4.3.0` NuGet package
    6. Removing unsafe code (which removes dependency on `System.Runtime.CompilerServices.Unsafe.dll`)
    7. Revising 3rd party license file

    Results:
    Reduces the assembly dependencies of `Datadog.Trace` in the following ways:
    - All target frameworks
      * MessagePack.dll
      * System.Runtime.CompilerServices.Unsafe.dll
      * System.Threading.Tasks.Extensions.dll
    - net45
      * System.ValueTuple.dll
    - net461
      * System.ValueTuple.dll
      * Large number of other implementation assemblies when the net461 Tracer had at least one netstandard.dll dependency
    - netstandard2.0
      * System.Runtime.Serialization.Primitives.dll

commit f003c9a167
Author: Grégoire <gregoire.verdier@gmail.com>
Date:   Thu Jul 23 19:29:35 2020 +0200

    Make createLogPath.sh executable (#804)

commit 83618738cc
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Thu Jul 23 09:24:01 2020 -0400

    rename settings (#816)

commit 7b8441216c
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Jul 22 15:01:22 2020 -0700

    Add status code in ASP.NET integration (#814)

    - Add status code in ASP.NET integration both on error and on success
    - Modify all ASP.NET integrations to automatically set `span.Error = true` when the response status code is 5xx. This is the default behavior across server spans in Datadog tracers

commit f24d8f3a4d
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Jul 22 13:01:37 2020 -0700

    Standardize copyright information across the repo (#794)

commit 91bc9b1970
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Jul 22 10:24:04 2020 -0700

    Fix Linux integration-tests build for projects referencing Samples.DatabaseHelper.netstandard (#815)

    Change Samples.DatabaseHelper.netstandard to use TargetFrameworks

commit bb948c153d
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Jul 22 02:18:22 2020 +0200

    Make the RateLimiterTest duration more predictable (#791)

    Now removing the time spent to send requests from the pause between bursts.

commit 9b47646a26
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Jul 21 22:39:17 2020 +0200

    Add status code support for ASP.NET MVC/WebAPI (#807)

    This correctly sets status codes on successful and failing requests for ASP.NET MVC or ASP.NET WebAPI spans.

commit 1d3527eac5
Author: Kevin Gosse <krix33@gmail.com>
Date:   Tue Jul 21 20:48:18 2020 +0200

    Extend the DD_TRACE_ENABLED to manual instrumentation (#796)

commit 46b41858f0
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Tue Jul 21 11:38:03 2020 +0200

    Fixes the MongoDB integration on Execute with Void return type. (#810)

    * Fixes the MongoDB integration on Execute with Void return type.

    * Adds a test for the WireProtocol.Execute integration with the void return type.

    * Adds #ifdef MongoDB 2.2, based on the PR review

commit 540eaed101
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Mon Jul 20 22:32:11 2020 -0400

    bump version to 1.18.4-prerelease (#812)

commit 8584a31bec
Author: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
Date:   Mon Jul 20 22:14:01 2020 -0400

    ADO.NET instrumentation improvements/fixes (#753)

commit 92d3593adc
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Jul 16 17:18:16 2020 -0700

    Bump the .NET Tracer version to 1.18.3 (#809)

commit e2fbaaa475
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Thu Jul 16 10:00:34 2020 +0200

    Adds a catch for ObjectDisposedException in MockTracerAgent (#805)

    * Adds a catch for ObjectDisposedException

commit 1d24a28090
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Jul 15 16:19:20 2020 -0700

    Add DD_TRACE_HEADER_TAGS environment variable to map incoming HTTP headers to tags (#801)

    Adds a new environment variable `DD_TRACE_HEADER_TAGS` which accepts a list of HTTP-header-name to tag-name pairs, which will be added to the root span of web server traces.

    Usage: `DD_TRACE_HEADER_TAGS=x-CASE-insensitive-Header:my-tag-name, User-Id:userId`

    Changes include:
    - A new method `SpanContextPropagator.ExtractHeaderTags` to create new tags from an incoming HTTP request by matching the headers with those specified by the `DD_TRACE_HEADER_TAGS` configuration. This has been applied to all server integrations
    - Changes to `SpanExtensions.DecorateWebServerSpan` to receive an additional list of HTTP header / tag name pairs. All server integrations use this helper to add information to the root span
    - Changes to the Wcf samples to pass custom HTTP headers with the client calls
    - Feature validation added to the `AspNetCore` integration tests
    - Renaming of `SpanContextPropagationHelpersTests.cs` to `ReflectionHttpHeadersCollectionTests.cs`

    Integrations Tested:
    - `AspNet`
    - `AspNetMvc`
    - `AspNetCore`
    - `Wcf`

commit ffc9cc6b77
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Mon Jul 13 12:05:38 2020 -0700

    Refactor SpanContextPropagator and TracerSettings.GlobalTags (#790)

    - Add unit tests to ensure `SpanContextPropagator.Inject`/`SpanContextPropagator.Extract` work correctly on different implementations of `Datadog.Trace.Headers.IHeadersCollection`
    - Improve GlobalTags by trimming the whitespace on keys and values, and modify `ConfigurationSourceTests` unit tests to enforce the behavior
    - Remove the `SpanContextPropagatorHelpers` class so now `SpanContextPropagator` is the uniform way to access headers for injection/extraction through the `Datadog.Trace.Headers.IHeadersCollection` abstraction. This helper class was first introduced in #750 when removing all hard assembly references to `System.Net.Http`, but it unnecessarily separated out injection/extraction logic. This PR improves this by just re-creating the original wrapper but instead of wrapping a strongly-typed `HttpHeaders` object, we just wrap it as an `object` and use reflection to implement the header modifications.
    - Add small utility app `StartDistributedTrace` to easily start a new distributed trace with the simple command line `dotnet run <URL>`

commit d37635a44b
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Jul 13 19:24:14 2020 +0200

    Implement DD_TRACE_STARTUP_LOGS flag (#799)

    Used to disable startup diagnostic log

commit 793cd23277
Author: Kevin Gosse <krix33@gmail.com>
Date:   Mon Jul 13 19:11:32 2020 +0200

    Fix null-check for service version (#798)

commit 1764b03954
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Jul 9 12:40:07 2020 -0700

    Bump .NET Tracer version to 1.18.2 (#793)

commit 5c059e16c4
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Wed Jul 8 21:06:21 2020 +0200

    Adds support for 'x-datadog-origin' http header (#781)

    * Adds support for 'x-datadog-origin' http header
    - Enable Extractor to parse the header and store it in the span context.
    - Enable Injector to inject the span context origin property to propagate the value.
    - Sets the '_dd.origin' tag to a new span if the span context has the origin value and if is the root span of a trace.
    - New constant values for the http header and the span tag.
    - Unit tests for Extract, Inject and setting the tag in the root span.

    * Changes based on the review
    - Changing the SpanContext Origin property to internal.
    - Moving the Origin set tag block to the DecorateRootSpan method.
    - Removing the ToList() and the double enumeration from the SpanContextPropagator.

    * Changes based on the review:
    - Adds the Origin header logic to SpanContextPropagatorHelpers.
    - Changed the unit tests for SpanContextPropagatorHelpers to consider the new origin header.
    - Fixes the OriginHeader_InjectFromChildSpan test.

    * Restore previous ctor to avoid a binary breaking change and introducing a new internal ctor for the origin header.

commit 87a006678a
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Jul 8 21:02:59 2020 +0200

    Increase time allotted to smoke tests (#788)

    * Double the execution time of smoke tests

commit 11e721b0c2
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Jul 8 08:09:19 2020 -0700

    Improve de-duplication logic for automatic instrumentation of outbound HTTP calls (#780)

    This PR improves the `Datadog.Trace.ClrProfiler.ScopeFactory.CreateOutboundHttpScope` helper method, used by both the `WebRequest` integration and the `HttpMessageHandler` integration, in the following ways:
    1. Removes several possible locations for a `NullReferenceException` to occur in the method
    2. Adds a more robust check on the parent span so that the HTTP span de-duplication logic (e.g. automatic instrumentation from nested `HttpMessageHandler` objects) will only consider spans created by automatic instrumentation, not custom spans

commit 3c2e450514
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Jul 8 15:17:05 2020 +0200

    Optimize UriHelper.GetRelativeUrl (#783)

    Reduce the number of intermediate strings.

commit 6d72a76f3b
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Jul 8 14:26:48 2020 +0200

    Reduce heap allocations in AspNetCoreDiagnosticObserver (#779)

    * Reduce heap allocations in AspNetCoreDiagnosticObserver

    - Use a wrapper on top of IHeaderDictionary instead of duplicating the headers
    - Make all methods that expect a IHeadersCollection generic, to avoid boxing the wrapper
    - Cache the SamplingPriority values to avoid the costly enum conversion
    - Remove the ToList when accessing the header values

commit 7f3529c122
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Jul 8 12:43:33 2020 +0200

    Make RateLimiter tests more consistent (#787)

    - Reuse the same workers for each burst
    - Remove the initialization/warmup time from the "elapsed" computation
    - Simplify synchronization by using Barrier

commit 46701a442e
Author: Tony Redondo <tonyredondo@gmail.com>
Date:   Wed Jul 8 10:02:26 2020 +0200

    Improvement  in ToBoolean StringExtensions (#789)

    * Improvement  in ToBoolean StringExtensions
    * Use Equals instead Compare

commit d571a1fac4
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Mon Jul 6 11:13:23 2020 -0700

    Bump .NET Tracer version to 1.18.1-prerelease (#785)

commit b706db9cec
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Thu Jul 2 12:19:59 2020 -0700

    Update iis calculation to use correct iisexpress.exe process name. (#778)

commit 382ea15cb0
Author: Kevin Gosse <krix33@gmail.com>
Date:   Thu Jul 2 10:52:48 2020 +0200

    Cache tags from DbCommand (#774)

    * Cache the tags extracted from connection strings
    * Disable the cache if too many different connection strings are used

commit 6a1abe0a45
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Jul 1 21:15:38 2020 -0700

    [ClrProfiler] Guarantee that startup hook only runs at one callsite in IIS applications (#775)

    Modify the profiler so that, when running IIS or IIS Express on .NET Framework, the startup hook is only inserted in the `System.Web.Compilation.BuildManager.InvokePreStartInitMethods`. This has the following effects:

    1. This removes the guess-and-check nature of valid callsites for the startup logic when running IIS. Before, `System.Web.Compilation.BuildManager.InvokePreStartInitMethods` was called out as a valid callsite, but it was possible for other modules to be loaded and methods to be called before this, causing the startup logic to run in the incorrect place.
    2. This leaves ASP.NET Core apps hosted on IIS and IIS Express unchanged as they will still load at the earliest possible time in the setup of the ASP.NET Core application.
    3. For ASP.NET (.NET Framework) applications, additional AppDomains that are not the main AppDomain won't be automatically instrumented. This trade-off should be acceptable as any automatic tracing there would be disconnected from the original request anyways since it is separated by the AppDomain boundary.

commit ac08da6bc1
Author: Zach Montoya <zach.montoya@datadoghq.com>
Date:   Wed Jul 1 12:33:56 2020 -0700

    Allow a trace count of zero in MockTracerAgent (#776)

commit 0078656f08
Author: Kevin Gosse <krix33@gmail.com>
Date:   Wed Jul 1 12:15:14 2020 +0200

    Suppress heap allocations in TracerSettings.IsIntegrationEnabled (#772)

    * Suppress heap allocations in TracerSet…

* Merge corrections

Remove extra files
2020-10-29 09:34:17 -07:00
MacroGreg 9560dd1677
Forking the DataDog .NET Tracer to seed the OTel .NET Auto-Instrumentation-Agent.
This is a fork of the DataDog .NET Tracer (aka "in-process agent", aka "auto-instrumentation agent").
It acts as the initial seed for the official Open Telemetry .NET Tracer.

We are doing this by merging the current master of https://github.com/DataDog/dd-trace-dotnet into an empty master of https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation.
In addition, I cleaned up all auxiliary files not directly related to the product (e.g., demos, tools, vendor-specific integration tests and benchmarks, we well as others). We can add them in later from the original repo if the community requires.

Everything builds, all unit tests are passing.
2020-08-20 13:35:02 -07:00