OpenTelemetry .NET Automatic Instrumentation
Go to file
Rajkumar Rangaraj 8de8f3f221
Metrics exporter prep - Rename tracer-based files (#672)
2022-05-13 10:28:50 +00:00
.config update .config file (#644) 2022-05-03 13:24:00 -07:00
.cspell Spellcheck documentation (#627) 2022-04-25 10:04:54 -07:00
.github Add Containers Nuke parameter (#668) 2022-05-13 11:41:51 +02:00
.nuke [POC] Add native tests (#201) 2021-07-20 10:46:07 -07:00
.vscode Spellcheck documentation (#627) 2022-04-25 10:04:54 -07:00
build Add Containers Nuke parameter (#668) 2022-05-13 11:41:51 +02:00
dev Pre-beta example fixes (#557) 2022-04-19 14:50:46 -07:00
docs List Raj as a maintainer (#667) 2022-05-11 23:09:14 +00:00
examples Metric Exporters Prep - Rename ConfigurationKeys Variables (#657) 2022-05-11 06:30:51 +00:00
src Metrics exporter prep - Rename tracer-based files (#672) 2022-05-13 10:28:50 +00:00
test Metrics exporter prep - Rename tracer-based files (#672) 2022-05-13 10:28:50 +00:00
.clang-format Forking the DataDog .NET Tracer to seed the OTel .NET Auto-Instrumentation-Agent. 2020-08-20 13:35:02 -07:00
.cspell.json Spellcheck documentation (#627) 2022-04-25 10:04:54 -07:00
.dockerignore Rename Samples applications to TestApplications (#486) 2022-04-13 15:29:13 -07:00
.editorconfig Forking the DataDog .NET Tracer to seed the OTel .NET Auto-Instrumentation-Agent. 2020-08-20 13:35:02 -07:00
.env Enable azure pipelines (#12) 2020-09-01 16:37:11 -07:00
.gitattributes Forking the DataDog .NET Tracer to seed the OTel .NET Auto-Instrumentation-Agent. 2020-08-20 13:35:02 -07:00
.gitignore Add markdownlint (#556) 2022-04-20 10:50:20 +02:00
.markdownlint.yaml Update Changelog and MongoDB docs (#635) 2022-04-28 22:54:51 +00:00
CHANGELOG.md Add metrics environment variables (#671) 2022-05-13 10:09:13 +00:00
Common.props Add copyright header in C# files and improve Stylecop.Analyzer usage (#415) 2022-03-18 08:25:23 +01:00
Directory.Build.props Add copyright header in C# files and improve Stylecop.Analyzer usage (#415) 2022-03-18 08:25:23 +01:00
GlobalSuppressions.cs Add copyright header in C# files and improve Stylecop.Analyzer usage (#415) 2022-03-18 08:25:23 +01:00
LICENSE Initial commit 2020-07-14 20:50:30 -04:00
OpenTelemetry.AutoInstrumentation.DotSettings Rename assemblies to OpenTelemetry.AutoInstrumentation (#363) 2022-02-15 11:49:09 -08:00
OpenTelemetry.AutoInstrumentation.proj Rename Samples applications to TestApplications (#486) 2022-04-13 15:29:13 -07:00
OpenTelemetry.AutoInstrumentation.sln Update MongoDb integration (#421) 2022-04-26 12:15:11 -07:00
build.cmd [POC] Add OTEL_DOTNET_TRACER_INSTRUMENTATIONS and bump dependencies (#204) 2021-07-29 08:54:30 +02:00
build.ps1 [POC] Add OTEL_DOTNET_TRACER_INSTRUMENTATIONS and bump dependencies (#204) 2021-07-29 08:54:30 +02:00
build.sh [POC] Add native tests (#201) 2021-07-20 10:46:07 -07:00
defaults.env Fix DOTNET_STARTUP_HOOKS in defaults.env (#634) 2022-04-28 07:43:21 +02:00
devenv.bat Rename assemblies to OpenTelemetry.AutoInstrumentation (#363) 2022-02-15 11:49:09 -08:00
git-clean.cmd Forking the DataDog .NET Tracer to seed the OTel .NET Auto-Instrumentation-Agent. 2020-08-20 13:35:02 -07:00
integrations.json Update MongoDb integration (#421) 2022-04-26 12:15:11 -07:00
nuget.config Create nuget.config (#120) 2021-04-08 09:21:33 -07:00
opentelemetry-logo-64x64.png Exchange datadog logo files with opentelemetry ones (#64) 2021-03-02 21:02:41 -08:00
opentelemetry-logo-256x256.png Exchange datadog logo files with opentelemetry ones (#64) 2021-03-02 21:02:41 -08:00
package-lock.json Spellcheck documentation (#627) 2022-04-25 10:04:54 -07:00
package.json Spellcheck documentation (#627) 2022-04-25 10:04:54 -07:00
pre-build-events-cpp.bat Forking the DataDog .NET Tracer to seed the OTel .NET Auto-Instrumentation-Agent. 2020-08-20 13:35:02 -07:00
run-example.sh Metric Exporters Prep - Rename ConfigurationKeys Variables (#657) 2022-05-11 06:30:51 +00:00
stylecop.json Add copyright header in C# files and improve Stylecop.Analyzer usage (#415) 2022-03-18 08:25:23 +01:00

docs/README.md

OpenTelemetry .NET Automatic Instrumentation

Slack

This project adds OpenTelemetry instrumentation to .NET applications without having to modify their source code.

OpenTelemetry .NET Automatic Instrumentation is built on top of OpenTelemetry .NET:

To automatically instrument applications, the OpenTelemetry .NET Automatic Instrumentation does the following:

  1. Injects and configures the OpenTelemetry .NET SDK into the application.
  2. Adds OpenTelemetry Instrumentation to key packages and APIs used by the application.

You can enable the OpenTelemetry .NET Automatic Instrumentation as a .NET Profiler to inject additional instrumentations of this project at runtime, using a technique known as monkey-patching. When enabled, the OpenTelemetry .NET Automatic Instrumentation generates traces for libraries that don't already generate traces using the OpenTelemetry .NET SDK.

See the examples for demonstrations of different instrumentation scenarios covered by the OpenTelemetry .NET Automatic Instrumentation.

See design.md for an architectural overview.

Status

This project is in the early stages of development. The project board shows the current work in progress.

Project versioning information and stability guarantees can be found in the versioning documentation.

⚠️ We need you! ⚠️

Please, give us your feedback (in whatever form you like).

You can do this by submitting a GitHub issue.

You may also prefer writing on Slack. If you are new, you can create a CNCF Slack account here.

See CONTRIBUTING.md for more information.

Compatibility

OpenTelemetry .NET Automatic Instrumentation attempts to work with all officially supported operating systems and versions of .NET (Core), and .NET Framework.

Versions lower than .NET Framework 4.6.2 are not supported.

CI tests run against the following operating systems:

  • Microsoft Windows Server 2022
  • macOS Catalina 10.15
  • Ubuntu 20.04 LTS

Instrumented libraries and frameworks

See config.md#instrumented-libraries-and-frameworks.

Get started

Install the instrumentation

Download and extract the appropriate binaries from the latest release.

The path where you put the binaries is referenced as %InstallationLocation%

On Linux, you can optionally create the default log directory after installation by running the following commands:

sudo mkdir -p /var/log/opentelemetry/dotnet
sudo chmod a+rwx /var/log/opentelemetry/dotnet

Instrument a .NET application on Windows

Before running your application, set the following environment variables:

COR_ENABLE_PROFILING=1
COR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
COR_PROFILER_PATH_64=%InstallationLocation%/win-x64/OpenTelemetry.AutoInstrumentation.Native.dll
COR_PROFILER_PATH_32=%InstallationLocation%/win-x86/OpenTelemetry.AutoInstrumentation.Native.dll
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
CORECLR_PROFILER_PATH_64=%InstallationLocation%/win-x64/OpenTelemetry.AutoInstrumentation.Native.dll
CORECLR_PROFILER_PATH_32=%InstallationLocation%/win-x86/OpenTelemetry.AutoInstrumentation.Native.dll
DOTNET_ADDITIONAL_DEPS=%InstallationLocation%/AdditionalDeps
DOTNET_SHARED_STORE=%InstallationLocation%/store
DOTNET_STARTUP_HOOKS=%InstallationLocation%/netcoreapp3.1/OpenTelemetry.AutoInstrumentation.StartupHook.dll
OTEL_DOTNET_AUTO_HOME=%InstallationLocation%
OTEL_DOTNET_AUTO_INTEGRATIONS_FILE=%InstallationLocation%/integrations.json

Instrument a .NET application on Linux

Before running your application, set the following environment variables:

CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
CORECLR_PROFILER_PATH=%InstallationLocation%/OpenTelemetry.AutoInstrumentation.Native.so
DOTNET_ADDITIONAL_DEPS=%InstallationLocation%/AdditionalDeps
DOTNET_SHARED_STORE=%InstallationLocation%/store
DOTNET_STARTUP_HOOKS=%InstallationLocation%/netcoreapp3.1/OpenTelemetry.AutoInstrumentation.StartupHook.dll
OTEL_DOTNET_AUTO_HOME=%InstallationLocation%
OTEL_DOTNET_AUTO_INTEGRATIONS_FILE=%InstallationLocation%/integrations.json

Instrument a .NET application on macOS

Before running your application, set the following environment variables:

CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
CORECLR_PROFILER_PATH=%InstallationLocation%/OpenTelemetry.AutoInstrumentation.Native.dylib
DOTNET_ADDITIONAL_DEPS=%InstallationLocation%/AdditionalDeps
DOTNET_SHARED_STORE=%InstallationLocation%/store
DOTNET_STARTUP_HOOKS=%InstallationLocation%/netcoreapp3.1/OpenTelemetry.AutoInstrumentation.StartupHook.dll
OTEL_DOTNET_AUTO_HOME=%InstallationLocation%
OTEL_DOTNET_AUTO_INTEGRATIONS_FILE=%InstallationLocation%/integrations.json

Configuration

See config.md.

Manual instrumentation

See manual-instrumentation.md.

Troubleshooting

See troubleshooting.md.

Contributing

See CONTRIBUTING.md.

Community Roles

Maintainers (@open-telemetry/dotnet-instrumentation-maintainers):

Approvers (@open-telemetry/dotnet-instrumentation-approvers):

Emeritus Maintainer/Approver/Triager:

Learn more about roles in the community repository.