Skip to content

Commit 7b8b263

Browse files
authored
CoreWCF.Primitives traces instrumentation (#4740)
1 parent dee34d4 commit 7b8b263

29 files changed

+343
-20
lines changed

.cspell/dot-net.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ stdlibc
4141
struct
4242
TRACEFILE
4343
typeof
44+
WCFCORE
4445
Xunit

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ This component adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.h
1818
SqlClient instrumentation setting
1919
- Add support for `StackExchange.Redis` for applications targeting .NET Framework.
2020
- Automatically set the `service.instance.id` resource attribute if not provided.
21+
- Support for [CoreWCF.Primitives](https://www.nuget.org/packages/CoreWCF.Primitives/)
22+
traces instrumentation for versions `1.8.0`+.
2123

2224
### Changed
2325

OpenTelemetry.AutoInstrumentation.sln

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication.NoCode", "t
256256
EndProject
257257
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework", "src\OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework\OpenTelemetry.AutoInstrumentation.Assemblies.NetFramework.csproj", "{B69564D4-7D5B-7147-6CBA-233BB8A33C50}"
258258
EndProject
259+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication.Wcf.Core", "test\test-applications\integrations\TestApplication.Wcf.Core\TestApplication.Wcf.Core.csproj", "{0F864722-CE44-4D99-9B67-CF0ED1893FF1}"
260+
EndProject
259261
Global
260262
GlobalSection(SolutionConfigurationPlatforms) = preSolution
261263
Debug|Any CPU = Debug|Any CPU
@@ -1620,6 +1622,22 @@ Global
16201622
{B69564D4-7D5B-7147-6CBA-233BB8A33C50}.Release|x64.Build.0 = Release|Any CPU
16211623
{B69564D4-7D5B-7147-6CBA-233BB8A33C50}.Release|x86.ActiveCfg = Release|Any CPU
16221624
{B69564D4-7D5B-7147-6CBA-233BB8A33C50}.Release|x86.Build.0 = Release|Any CPU
1625+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Debug|Any CPU.ActiveCfg = Debug|x64
1626+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Debug|Any CPU.Build.0 = Debug|x64
1627+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Debug|ARM64.ActiveCfg = Debug|Any CPU
1628+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Debug|ARM64.Build.0 = Debug|Any CPU
1629+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Debug|x64.ActiveCfg = Debug|Any CPU
1630+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Debug|x64.Build.0 = Debug|Any CPU
1631+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Debug|x86.ActiveCfg = Debug|Any CPU
1632+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Debug|x86.Build.0 = Debug|Any CPU
1633+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Release|Any CPU.ActiveCfg = Release|x64
1634+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Release|Any CPU.Build.0 = Release|x64
1635+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Release|ARM64.ActiveCfg = Release|Any CPU
1636+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Release|ARM64.Build.0 = Release|Any CPU
1637+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Release|x64.ActiveCfg = Release|Any CPU
1638+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Release|x64.Build.0 = Release|Any CPU
1639+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Release|x86.ActiveCfg = Release|Any CPU
1640+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1}.Release|x86.Build.0 = Release|Any CPU
16231641
EndGlobalSection
16241642
GlobalSection(SolutionProperties) = preSolution
16251643
HideSolutionNode = FALSE
@@ -1715,6 +1733,7 @@ Global
17151733
{665280EB-F428-4C04-A293-33228C73BF8A} = {E409ADD3-9574-465C-AB09-4324D205CC7C}
17161734
{500BF40F-EECB-4F6A-377B-EDBDFFDE09BE} = {E409ADD3-9574-465C-AB09-4324D205CC7C}
17171735
{B69564D4-7D5B-7147-6CBA-233BB8A33C50} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
1736+
{0F864722-CE44-4D99-9B67-CF0ED1893FF1} = {E409ADD3-9574-465C-AB09-4324D205CC7C}
17181737
EndGlobalSection
17191738
GlobalSection(ExtensibilityGlobals) = postSolution
17201739
SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F}

build/LibraryVersions.g.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,11 @@ public static partial class LibraryVersion
190190
new("2.12.0"),
191191
]
192192
},
193+
{
194+
"TestApplication.Wcf.Core",
195+
[
196+
new("1.8.0", supportedFrameworks: [ "net10.0", "net9.0", "net8.0" ]),
197+
]
198+
},
193199
};
194200
}

docs/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ due to lack of stable semantic convention.
152152
| `SQLCLIENT` | [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient), [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient) \[7\] and `System.Data` (shipped with .NET Framework) | * \[8\] | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
153153
| `STACKEXCHANGEREDIS` | [StackExchange.Redis](https://www.nuget.org/packages/StackExchange.Redis) | ≥2.6.122 & < 3.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
154154
| `WCFCLIENT` | WCF | * | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
155+
| `WCFCORE` | [CoreWCF.Primitives](https://www.nuget.org/packages/CoreWCF.Primitives) **Not supported on .NET Framework** | ≥1.8.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
155156
| `WCFSERVICE` | WCF **Not supported on .NET**. | * | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
156157

157158
\[1\]: Only integrated pipeline mode is supported.

docs/file-based-configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ instrumentation/development:
513513
sqlclient: # Microsoft.Data.SqlClient & System.Data.SqlClient
514514
stackexchangeredis: # StackExchange.Redis
515515
wcfclient: # WCF Client
516+
wcfcore: # CoreWCF.Primitives
516517
wcfservice: # WCF Service
517518
metrics:
518519
aspnet: # ASP.NET metrics

src/OpenTelemetry.AutoInstrumentation/Configurations/EnvironmentConfigurationTracerHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public static TracerProviderBuilder UseEnvironmentVariables(
5252
TracerInstrumentation.MySqlData => builder.AddSource("connector-net"),
5353
TracerInstrumentation.EntityFrameworkCore => Wrappers.AddEntityFrameworkCoreInstrumentation(builder, pluginManager, lazyInstrumentationLoader, settings),
5454
TracerInstrumentation.GraphQL => Wrappers.AddGraphQLInstrumentation(builder, pluginManager, lazyInstrumentationLoader, settings),
55+
TracerInstrumentation.WcfCore => builder.AddSource("CoreWCF.Primitives"),
5556
#endif
5657
_ => null
5758
};

src/OpenTelemetry.AutoInstrumentation/Configurations/FileBasedConfiguration/DotNetTraces.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ internal class DotNetTraces
176176
[YamlMember(Alias = "wcfclient")]
177177
public object? WcfClient { get; set; }
178178

179+
#if NET
180+
/// <summary>
181+
/// Gets or sets the CoreWCF traces instrumentation configuration.
182+
/// </summary>
183+
[YamlMember(Alias = "wcfcore")]
184+
public object? WcfCore { get; set; }
185+
#endif
186+
179187
/// <summary>
180188
/// Returns the list of enabled traces instrumentations.
181189
/// </summary>

src/OpenTelemetry.AutoInstrumentation/Configurations/TracerInstrumentation.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,12 @@ internal enum TracerInstrumentation
133133
/// <summary>
134134
/// RabbitMQ client instrumentation
135135
/// </summary>
136-
RabbitMq = 22
136+
RabbitMq = 22,
137+
138+
#if NET
139+
/// <summary>
140+
/// CoreWCF instrumentation.
141+
/// </summary>
142+
WcfCore = 23
143+
#endif
137144
}

src/OpenTelemetry.AutoInstrumentation/Instrumentation.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ private static void AddLazilyLoadedTraceInstrumentations(LazyInstrumentationLoad
534534
case TracerInstrumentation.GraphQL:
535535
DelayedInitialization.Traces.AddGraphQL(LazyInstrumentationLoader, pluginManager, tracerSettings);
536536
break;
537+
case TracerInstrumentation.WcfCore:
538+
break;
537539
#endif
538540
case TracerInstrumentation.Azure:
539541
break;

0 commit comments

Comments
 (0)