From ec118d4fde4b33279d754a3ea9514c0b9d1246e3 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 6 Aug 2021 22:01:58 -0700 Subject: [PATCH] Rename Microsoft.AspNet.TelemetryCorrelation -> OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule. Added project to the solution + updated references & namespaces. (#2238) --- OpenTelemetry.sln | 14 ++++- build/Common.props | 1 - examples/AspNet/Web.config | 2 +- .../ActivityExtensions.cs | 2 +- .../ActivityHelper.cs | 2 +- .../AspNetTelemetryCorrelationEventSource.cs | 2 +- .../AssemblyInfo.cs | 12 +---- .../Internal/BaseHeaderParser.cs | 2 +- .../Internal/GenericHeaderParser.cs | 2 +- .../Internal/HeaderUtilities.cs | 2 +- .../Internal/HttpHeaderParser.cs | 2 +- .../Internal/HttpParseResult.cs | 2 +- .../Internal/HttpRuleParser.cs | 2 +- .../Internal/NameValueHeaderValue.cs | 2 +- ...ntation.AspNet.TelemetryHttpModule.csproj} | 1 + .../README.md | 0 .../TelemetryCorrelationHttpModule.cs | 2 +- .../web.config.install.xdt | 0 .../web.config.uninstall.xdt | 0 ...penTelemetry.Instrumentation.AspNet.csproj | 5 +- .../README.md | 54 ++++++++++--------- .../ActivityExtensionsTest.cs | 2 +- .../ActivityHelperTest.cs | 2 +- .../HttpContextHelper.cs | 2 +- ...n.AspNet.TelemetryHttpModule.Tests.csproj} | 6 +-- .../PropertyExtensions.cs | 2 +- .../TestDiagnosticListener.cs | 2 +- .../WebConfigTransformTest.cs | 2 +- .../WebConfigWithLocationTagTransformTest.cs | 2 +- 29 files changed, 67 insertions(+), 64 deletions(-) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/ActivityExtensions.cs (99%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/ActivityHelper.cs (99%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/AspNetTelemetryCorrelationEventSource.cs (98%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/AssemblyInfo.cs (57%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/Internal/BaseHeaderParser.cs (98%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/Internal/GenericHeaderParser.cs (97%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/Internal/HeaderUtilities.cs (97%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/Internal/HttpHeaderParser.cs (97%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/Internal/HttpParseResult.cs (96%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/Internal/HttpRuleParser.cs (99%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/Internal/NameValueHeaderValue.cs (99%) rename src/{Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.csproj} (90%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/README.md (100%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/TelemetryCorrelationHttpModule.cs (99%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/web.config.install.xdt (100%) rename src/{Microsoft.AspNet.TelemetryCorrelation => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule}/web.config.uninstall.xdt (100%) rename test/{Microsoft.AspNet.TelemetryCorrelation.Tests => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests}/ActivityExtensionsTest.cs (99%) rename test/{Microsoft.AspNet.TelemetryCorrelation.Tests => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests}/ActivityHelperTest.cs (99%) rename test/{Microsoft.AspNet.TelemetryCorrelation.Tests => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests}/HttpContextHelper.cs (98%) rename test/{Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests.csproj} (72%) rename test/{Microsoft.AspNet.TelemetryCorrelation.Tests => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests}/PropertyExtensions.cs (94%) rename test/{Microsoft.AspNet.TelemetryCorrelation.Tests => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests}/TestDiagnosticListener.cs (96%) rename test/{Microsoft.AspNet.TelemetryCorrelation.Tests => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests}/WebConfigTransformTest.cs (99%) rename test/{Microsoft.AspNet.TelemetryCorrelation.Tests => OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests}/WebConfigWithLocationTagTransformTest.cs (99%) diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln index 9669f7b6c17..63bf9532f5a 100644 --- a/OpenTelemetry.sln +++ b/OpenTelemetry.sln @@ -207,7 +207,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "customizing-the-sdk", "docs EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "getting-started", "docs\metrics\getting-started\getting-started.csproj", "{DFB0AD2F-11BE-4BCD-A77B-1018C3344FA8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTelemetry.Exporter.Prometheus", "src\OpenTelemetry.Exporter.Prometheus\OpenTelemetry.Exporter.Prometheus.csproj", "{52158A12-E7EF-45A1-859F-06F9B17410CB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Prometheus", "src\OpenTelemetry.Exporter.Prometheus\OpenTelemetry.Exporter.Prometheus.csproj", "{52158A12-E7EF-45A1-859F-06F9B17410CB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule", "src\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.csproj", "{F38E511B-1877-4E8A-8051-7879FC7DF8A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests", "test\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests.csproj", "{4D7201BC-7124-4401-AD65-FAB58A053D45}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -411,6 +415,14 @@ Global {52158A12-E7EF-45A1-859F-06F9B17410CB}.Debug|Any CPU.Build.0 = Debug|Any CPU {52158A12-E7EF-45A1-859F-06F9B17410CB}.Release|Any CPU.ActiveCfg = Release|Any CPU {52158A12-E7EF-45A1-859F-06F9B17410CB}.Release|Any CPU.Build.0 = Release|Any CPU + {F38E511B-1877-4E8A-8051-7879FC7DF8A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F38E511B-1877-4E8A-8051-7879FC7DF8A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F38E511B-1877-4E8A-8051-7879FC7DF8A4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F38E511B-1877-4E8A-8051-7879FC7DF8A4}.Release|Any CPU.Build.0 = Release|Any CPU + {4D7201BC-7124-4401-AD65-FAB58A053D45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4D7201BC-7124-4401-AD65-FAB58A053D45}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4D7201BC-7124-4401-AD65-FAB58A053D45}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4D7201BC-7124-4401-AD65-FAB58A053D45}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/Common.props b/build/Common.props index 600f86dcbf6..014f6bcead3 100644 --- a/build/Common.props +++ b/build/Common.props @@ -28,7 +28,6 @@ [2.25.0,3.0) [2.1.1,6.0) [2.1.1,6.0) - [1.0.7,2.0) [3.3.1] [16.10.0] [2.1.0,) diff --git a/examples/AspNet/Web.config b/examples/AspNet/Web.config index 06568322cee..7d1202545e9 100644 --- a/examples/AspNet/Web.config +++ b/examples/AspNet/Web.config @@ -23,7 +23,7 @@ - + diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/ActivityExtensions.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/ActivityExtensions.cs similarity index 99% rename from src/Microsoft.AspNet.TelemetryCorrelation/ActivityExtensions.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/ActivityExtensions.cs index 1daa409120e..5b5cc20c143 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/ActivityExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/ActivityExtensions.cs @@ -19,7 +19,7 @@ using System.ComponentModel; using System.Diagnostics; -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { /// /// Extensions of Activity class. diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/ActivityHelper.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/ActivityHelper.cs similarity index 99% rename from src/Microsoft.AspNet.TelemetryCorrelation/ActivityHelper.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/ActivityHelper.cs index 0bf0a3bd508..cca48f03c43 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/ActivityHelper.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/ActivityHelper.cs @@ -19,7 +19,7 @@ using System.Diagnostics; using System.Web; -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { /// /// Activity helper class. diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/AspNetTelemetryCorrelationEventSource.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/AspNetTelemetryCorrelationEventSource.cs similarity index 98% rename from src/Microsoft.AspNet.TelemetryCorrelation/AspNetTelemetryCorrelationEventSource.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/AspNetTelemetryCorrelationEventSource.cs index 79711d74833..f6c72b403d6 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/AspNetTelemetryCorrelationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/AspNetTelemetryCorrelationEventSource.cs @@ -18,7 +18,7 @@ using System.Diagnostics.Tracing; #pragma warning disable SA1600 // Elements must be documented -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { /// /// ETW EventSource tracing class. diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/AssemblyInfo.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/AssemblyInfo.cs similarity index 57% rename from src/Microsoft.AspNet.TelemetryCorrelation/AssemblyInfo.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/AssemblyInfo.cs index 514e712d184..3d679575e65 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/AssemblyInfo.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/AssemblyInfo.cs @@ -19,16 +19,8 @@ [assembly: ComVisible(false)] -[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests" + AssemblyInfo.PublicKey)] - #if SIGNED -internal static class AssemblyInfo -{ - public const string PublicKey = ", PublicKey=002400000480000094000000060200000024000052534131000400000100010051C1562A090FB0C9F391012A32198B5E5D9A60E9B80FA2D7B434C9E5CCB7259BD606E66F9660676AFC6692B8CDC6793D190904551D2103B7B22FA636DCBB8208839785BA402EA08FC00C8F1500CCEF28BBF599AA64FFB1E1D5DC1BF3420A3777BADFE697856E9D52070A50C3EA5821C80BEF17CA3ACFFA28F89DD413F096F898"; -} +[assembly: InternalsVisibleTo("OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010051c1562a090fb0c9f391012a32198b5e5d9a60e9b80fa2d7b434c9e5ccb7259bd606e66f9660676afc6692b8cdc6793d190904551d2103b7b22fa636dcbb8208839785ba402ea08fc00c8f1500ccef28bbf599aa64ffb1e1d5dc1bf3420a3777badfe697856e9d52070a50c3ea5821c80bef17ca3acffa28f89dd413f096f898")] #else -internal static class AssemblyInfo -{ - public const string PublicKey = ""; -} +[assembly: InternalsVisibleTo("OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests")] #endif diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/BaseHeaderParser.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/BaseHeaderParser.cs similarity index 98% rename from src/Microsoft.AspNet.TelemetryCorrelation/Internal/BaseHeaderParser.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/BaseHeaderParser.cs index 2aed3ec446a..072a8c3f50a 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/BaseHeaderParser.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/BaseHeaderParser.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { // Adoptation of code from https://github.com/aspnet/HttpAbstractions/blob/07d115400e4f8c7a66ba239f230805f03a14ee3d/src/Microsoft.Net.Http.Headers/BaseHeaderParser.cs internal abstract class BaseHeaderParser : HttpHeaderParser diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/GenericHeaderParser.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/GenericHeaderParser.cs similarity index 97% rename from src/Microsoft.AspNet.TelemetryCorrelation/Internal/GenericHeaderParser.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/GenericHeaderParser.cs index d966b9ea4be..448837e5f0f 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/GenericHeaderParser.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/GenericHeaderParser.cs @@ -16,7 +16,7 @@ using System; -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { // Adoptation of code from https://github.com/aspnet/HttpAbstractions/blob/07d115400e4f8c7a66ba239f230805f03a14ee3d/src/Microsoft.Net.Http.Headers/GenericHeaderParser.cs internal sealed class GenericHeaderParser : BaseHeaderParser diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/HeaderUtilities.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HeaderUtilities.cs similarity index 97% rename from src/Microsoft.AspNet.TelemetryCorrelation/Internal/HeaderUtilities.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HeaderUtilities.cs index 0967da7fb54..ab41f1c58cf 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/HeaderUtilities.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HeaderUtilities.cs @@ -16,7 +16,7 @@ using System.Diagnostics.Contracts; -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { // Adoption of the code from https://github.com/aspnet/HttpAbstractions/blob/07d115400e4f8c7a66ba239f230805f03a14ee3d/src/Microsoft.Net.Http.Headers/HeaderUtilities.cs internal static class HeaderUtilities diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpHeaderParser.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpHeaderParser.cs similarity index 97% rename from src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpHeaderParser.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpHeaderParser.cs index 9bdbd31d174..05584edcd8d 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpHeaderParser.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpHeaderParser.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { // Adoptation of code from https://github.com/aspnet/HttpAbstractions/blob/07d115400e4f8c7a66ba239f230805f03a14ee3d/src/Microsoft.Net.Http.Headers/HttpHeaderParser.cs internal abstract class HttpHeaderParser diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpParseResult.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpParseResult.cs similarity index 96% rename from src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpParseResult.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpParseResult.cs index 0a8cabfb498..288e1faa070 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpParseResult.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpParseResult.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { // Adoptation of code from https://github.com/aspnet/HttpAbstractions/blob/07d115400e4f8c7a66ba239f230805f03a14ee3d/src/Microsoft.Net.Http.Headers/HttpParseResult.cs internal enum HttpParseResult diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpRuleParser.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpRuleParser.cs similarity index 99% rename from src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpRuleParser.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpRuleParser.cs index 68cdbbada8c..c99e4675b2c 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/HttpRuleParser.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/HttpRuleParser.cs @@ -16,7 +16,7 @@ using System.Diagnostics.Contracts; -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { // Adoptation of code from https://github.com/aspnet/HttpAbstractions/blob/07d115400e4f8c7a66ba239f230805f03a14ee3d/src/Microsoft.Net.Http.Headers/HttpRuleParser.cs internal static class HttpRuleParser diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/NameValueHeaderValue.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/NameValueHeaderValue.cs similarity index 99% rename from src/Microsoft.AspNet.TelemetryCorrelation/Internal/NameValueHeaderValue.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/NameValueHeaderValue.cs index b42d019e324..7f5c2363e28 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Internal/NameValueHeaderValue.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/Internal/NameValueHeaderValue.cs @@ -16,7 +16,7 @@ using System.Diagnostics.Contracts; -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { // Adoptation of code from https://github.com/aspnet/HttpAbstractions/blob/07d115400e4f8c7a66ba239f230805f03a14ee3d/src/Microsoft.Net.Http.Headers/NameValueHeaderValue.cs diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.csproj similarity index 90% rename from src/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.csproj index 4c8fc26a8be..576e5b3c782 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.csproj @@ -2,6 +2,7 @@ net461 A module that instruments incoming request with System.Diagnostics.Activity and notifies listeners with DiagnosticsSource. + $(PackageTags);distributed-tracing;AspNet;MVC;WebAPI diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/README.md b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/README.md similarity index 100% rename from src/Microsoft.AspNet.TelemetryCorrelation/README.md rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/README.md diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/TelemetryCorrelationHttpModule.cs b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/TelemetryCorrelationHttpModule.cs similarity index 99% rename from src/Microsoft.AspNet.TelemetryCorrelation/TelemetryCorrelationHttpModule.cs rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/TelemetryCorrelationHttpModule.cs index 721c0072a0b..8cbee9bf7d9 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/TelemetryCorrelationHttpModule.cs +++ b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/TelemetryCorrelationHttpModule.cs @@ -20,7 +20,7 @@ using System.Reflection; using System.Web; -namespace Microsoft.AspNet.TelemetryCorrelation +namespace OpenTelemetry.Instrumentation.AspNet { /// /// Http Module sets ambient state using Activity API from DiagnosticsSource package. diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/web.config.install.xdt b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/web.config.install.xdt similarity index 100% rename from src/Microsoft.AspNet.TelemetryCorrelation/web.config.install.xdt rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/web.config.install.xdt diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/web.config.uninstall.xdt b/src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/web.config.uninstall.xdt similarity index 100% rename from src/Microsoft.AspNet.TelemetryCorrelation/web.config.uninstall.xdt rename to src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/web.config.uninstall.xdt diff --git a/src/OpenTelemetry.Instrumentation.AspNet/OpenTelemetry.Instrumentation.AspNet.csproj b/src/OpenTelemetry.Instrumentation.AspNet/OpenTelemetry.Instrumentation.AspNet.csproj index 71a98d5cc51..46790741b95 100644 --- a/src/OpenTelemetry.Instrumentation.AspNet/OpenTelemetry.Instrumentation.AspNet.csproj +++ b/src/OpenTelemetry.Instrumentation.AspNet/OpenTelemetry.Instrumentation.AspNet.csproj @@ -10,12 +10,9 @@ - - - - + diff --git a/src/OpenTelemetry.Instrumentation.AspNet/README.md b/src/OpenTelemetry.Instrumentation.AspNet/README.md index 56098a55f52..eb342b2d7d6 100644 --- a/src/OpenTelemetry.Instrumentation.AspNet/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNet/README.md @@ -24,17 +24,18 @@ dotnet add package OpenTelemetry.Instrumentation.AspNet `OpenTelemetry.Instrumentation.AspNet` requires adding an additional HttpModule to your web server. This additional HttpModule is shipped as part of -[`Microsoft.AspNet.TelemetryCorrelation`](https://www.nuget.org/packages/Microsoft.AspNet.TelemetryCorrelation/) +[`OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule`](https://www.nuget.org/packages/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/) which is implicitly brought by `OpenTelemetry.Instrumentation.AspNet`. The following shows changes required to your `Web.config` when using IIS web server. ```xml - + ``` @@ -44,8 +45,8 @@ following shows changes required to your `Web.config` when using IIS web server. ASP.NET instrumentation must be enabled at application startup. This is typically done in the `Global.asax.cs` as shown below. This example also sets up the OpenTelemetry Jaeger exporter, which requires adding the package -[`OpenTelemetry.Exporter.Jaeger`](../OpenTelemetry.Exporter.Jaeger/README.md) -to the application. +[`OpenTelemetry.Exporter.Jaeger`](../OpenTelemetry.Exporter.Jaeger/README.md) to +the application. ```csharp using OpenTelemetry; @@ -71,18 +72,19 @@ public class WebApiApplication : HttpApplication ## Advanced configuration This instrumentation can be configured to change the default behavior by using -`AspNetInstrumentationOptions`, which allows configuring `Filter` as explained below. +`AspNetInstrumentationOptions`, which allows configuring `Filter` as explained +below. ### Filter -This instrumentation by default collects all the incoming http requests. It allows -filtering of requests by using the `Filter` function in `AspNetInstrumentationOptions`. -This defines the condition for allowable requests. The Filter -receives the `HttpContext` of the incoming request, and does not collect telemetry - about the request if the Filter returns false or throws exception. +This instrumentation by default collects all the incoming http requests. It +allows filtering of requests by using the `Filter` function in +`AspNetInstrumentationOptions`. This defines the condition for allowable +requests. The Filter receives the `HttpContext` of the incoming request, and +does not collect telemetry about the request if the Filter returns false or +throws exception. -The following code snippet shows how to use `Filter` to only allow GET -requests. +The following code snippet shows how to use `Filter` to only allow GET requests. ```csharp this.tracerProvider = Sdk.CreateTracerProviderBuilder() @@ -103,13 +105,13 @@ and the `Filter` option does the filtering *before* the Sampler is invoked. ### Enrich -This option allows one to enrich the activity with additional information -from the raw `HttpRequest`, `HttpResponse` objects. The `Enrich` action is -called only when `activity.IsAllDataRequested` is `true`. It contains the -activity itself (which can be enriched), the name of the event, and the -actual raw object. -For event name "OnStartActivity", the actual object will be `HttpRequest`. -For event name "OnStopActivity", the actual object will be `HttpResponse` +This option allows one to enrich the activity with additional information from +the raw `HttpRequest`, `HttpResponse` objects. The `Enrich` action is called +only when `activity.IsAllDataRequested` is `true`. It contains the activity +itself (which can be enriched), the name of the event, and the actual raw +object. For event name "OnStartActivity", the actual object will be +`HttpRequest`. For event name "OnStopActivity", the actual object will be +`HttpResponse` The following code snippet shows how to add additional tags using `Enrich`. @@ -136,10 +138,10 @@ this.tracerProvider = Sdk.CreateTracerProviderBuilder() .Build(); ``` -[Processor](../../docs/trace/extending-the-sdk/README.md#processor), -is the general extensibility point to add additional properties to any activity. -The `Enrich` option is specific to this instrumentation, and is provided to -get access to `HttpRequest` and `HttpResponse`. +[Processor](../../docs/trace/extending-the-sdk/README.md#processor), is the +general extensibility point to add additional properties to any activity. The +`Enrich` option is specific to this instrumentation, and is provided to get +access to `HttpRequest` and `HttpResponse`. ## References diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityExtensionsTest.cs b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityExtensionsTest.cs similarity index 99% rename from test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityExtensionsTest.cs rename to test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityExtensionsTest.cs index 70f00409a7f..8bb6505ca48 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityExtensionsTest.cs +++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityExtensionsTest.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation.Tests +namespace OpenTelemetry.Instrumentation.AspNet.Tests { using System.Collections.Generic; using System.Collections.Specialized; diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityHelperTest.cs b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityHelperTest.cs similarity index 99% rename from test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityHelperTest.cs rename to test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityHelperTest.cs index 8e8d5f210ac..12dfc5d2a40 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityHelperTest.cs +++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityHelperTest.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation.Tests +namespace OpenTelemetry.Instrumentation.AspNet.Tests { using System; using System.Collections; diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/HttpContextHelper.cs b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/HttpContextHelper.cs similarity index 98% rename from test/Microsoft.AspNet.TelemetryCorrelation.Tests/HttpContextHelper.cs rename to test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/HttpContextHelper.cs index 135bdd57b07..0c0e2827803 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/HttpContextHelper.cs +++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/HttpContextHelper.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation.Tests +namespace OpenTelemetry.Instrumentation.AspNet.Tests { using System.Collections.Generic; using System.Globalization; diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests.csproj similarity index 72% rename from test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj rename to test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests.csproj index d8d179c4587..951aef42891 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj +++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests.csproj @@ -19,14 +19,14 @@ - + - + Resources\web.config.install.xdt - + Resources\web.config.uninstall.xdt diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/PropertyExtensions.cs b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/PropertyExtensions.cs similarity index 94% rename from test/Microsoft.AspNet.TelemetryCorrelation.Tests/PropertyExtensions.cs rename to test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/PropertyExtensions.cs index cfb7c8527ca..135a4a97236 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/PropertyExtensions.cs +++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/PropertyExtensions.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation.Tests +namespace OpenTelemetry.Instrumentation.AspNet.Tests { using System.Reflection; diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/TestDiagnosticListener.cs b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/TestDiagnosticListener.cs similarity index 96% rename from test/Microsoft.AspNet.TelemetryCorrelation.Tests/TestDiagnosticListener.cs rename to test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/TestDiagnosticListener.cs index 206f92c745f..4b29e2ab9f2 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/TestDiagnosticListener.cs +++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/TestDiagnosticListener.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation.Tests +namespace OpenTelemetry.Instrumentation.AspNet.Tests { using System; using System.Collections.Generic; diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/WebConfigTransformTest.cs b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/WebConfigTransformTest.cs similarity index 99% rename from test/Microsoft.AspNet.TelemetryCorrelation.Tests/WebConfigTransformTest.cs rename to test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/WebConfigTransformTest.cs index e6928f91b10..0e393a48735 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/WebConfigTransformTest.cs +++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/WebConfigTransformTest.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation.Tests +namespace OpenTelemetry.Instrumentation.AspNet.Tests { using System.IO; using System.Xml.Linq; diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/WebConfigWithLocationTagTransformTest.cs b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/WebConfigWithLocationTagTransformTest.cs similarity index 99% rename from test/Microsoft.AspNet.TelemetryCorrelation.Tests/WebConfigWithLocationTagTransformTest.cs rename to test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/WebConfigWithLocationTagTransformTest.cs index 3c309cfd638..52ec038637a 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/WebConfigWithLocationTagTransformTest.cs +++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/WebConfigWithLocationTagTransformTest.cs @@ -14,7 +14,7 @@ // limitations under the License. // -namespace Microsoft.AspNet.TelemetryCorrelation.Tests +namespace OpenTelemetry.Instrumentation.AspNet.Tests { using System.IO; using System.Xml.Linq;