Skip to content

Commit 3b79002

Browse files
nr-ahemsathjaffinitochynesNR
authored
feat: Add automatic instrumentation of MassTransit clients v7 and v8. (#1972)
* Add auto-instrumentation for MassTransit v7 and v8. * Update RabbitMQ HandleBasicDeliver instrumentation * Clean up POC branch (#1970) * Add integration tests for MassTransit (#2014) * Initial exerciser implementation * Cleanup * Build works for all TFMS * Add legacy (7.x) exerciser Also cleanup, and rename start/stop methods * Unify v7/v8 exercisers Also pass in queue name as a parameter to StartBus to help with test assertions * Implement send * Adding alternate instrumentation point and first pass at tests (#2001) * Checkpoint trying to get hosted service model working for v7 * Message consume is working in v7! * Add instrumentation project readmes * Added regex scope, tests are passing * Test send as well as publish; cleanup * Expanded tests, updated instrumentation for v7 * Make regex metric name assertions more specific --------- Co-authored-by: Chris Hynes <[email protected]> * Limit MassTransit v7 support to 7.1.0 and higher (#2024) * Updated 7x instrumentation with version ranges Not quite working, integration tests are failing for StartBus with v7.0.0 due to transaction scope oddness * Tweak names * Better ConsoleMF logging Added millisecond-level timestamps and thread id * Only support 7.1.0 -> 7.3.1 * Actually make Tid a property * Enable MassTransit integration tests * Fix bug with transaction leakage * Also detach from primary in 8.x filter * Update project dependencies * Fix merge issues * Fix more merge mistakes --------- Co-authored-by: Jacob Affinito <[email protected]> Co-authored-by: Chris Hynes <[email protected]>
1 parent 14c6bb1 commit 3b79002

File tree

29 files changed

+1006
-17
lines changed

29 files changed

+1006
-17
lines changed

.github/workflows/all_solutions.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ jobs:
254254
Logging.MaxSamplesStored,
255255
Logging.MetricsAndForwarding,
256256
Logging.ZeroMaxSamplesStored,
257-
Owin,
257+
Owin,
258+
MassTransit,
258259
ReJit.NetCore,
259260
ReJit.NetFramework,
260261
RequestHandling,

.github/workflows/run_integration_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
namespaces="[ 'AgentFeatures', 'AgentLogs', 'AgentMetrics', 'Api', 'AppDomainCaching', 'AspNetCore', 'BasicInstrumentation', 'CatInbound', 'CatOutbound', 'CodeLevelMetrics', 'Configuration', \
5656
'CSP', 'CustomAttributes', 'CustomInstrumentation', 'DataTransmission', 'DistributedTracing', 'Errors', 'HttpClientInstrumentation', 'InfiniteTracing', 'Logging.ContextData', \
5757
'Logging.HsmAndCsp', 'Logging.LocalDecoration', 'Logging.LogLevelDetection', 'Logging.MaxSamplesStored', 'Logging.MetricsAndForwarding', 'Logging.ZeroMaxSamplesStored', \
58-
'Owin', 'ReJit.NetCore', 'ReJit.NetFramework', 'RequestHandling', 'RequestHeadersCapture.AspNet', 'RequestHeadersCapture.AspNetCore', 'RequestHeadersCapture.EnvironmentVariables', \
58+
'Owin', 'MassTransit', 'ReJit.NetCore', 'ReJit.NetFramework', 'RequestHandling', 'RequestHeadersCapture.AspNet', 'RequestHeadersCapture.AspNetCore', 'RequestHeadersCapture.EnvironmentVariables', \
5959
'RequestHeadersCapture.Owin', 'RequestHeadersCapture.WCF', 'RestSharp', 'WCF.Client.IIS.ASPDisabled', 'WCF.Client.IIS.ASPEnabled', 'WCF.Client.Self', \
6060
'WCF.Service.IIS.ASPDisabled', 'WCF.Service.IIS.ASPEnabled', 'WCF.Service.Self' ]"
6161
else

FullAgent.sln

+16-1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Home", "src\Agent\NewRelic\
162162
{00B0CD4C-D7DE-4243-8185-79A912E48291} = {00B0CD4C-D7DE-4243-8185-79A912E48291}
163163
{0962EF35-B457-479E-9A7A-EC43F9EC7180} = {0962EF35-B457-479E-9A7A-EC43F9EC7180}
164164
{0C3E92D7-F16C-4575-9CBB-EB7349A4C5E2} = {0C3E92D7-F16C-4575-9CBB-EB7349A4C5E2}
165+
{0DC126D1-E782-4A41-BA3E-393083F08627} = {0DC126D1-E782-4A41-BA3E-393083F08627}
165166
{10B2665A-B898-49F7-8BCA-2511872B0902} = {10B2665A-B898-49F7-8BCA-2511872B0902}
166167
{1593CA23-F7EC-42F2-A915-F5D5B18F8C6B} = {1593CA23-F7EC-42F2-A915-F5D5B18F8C6B}
167168
{203A8EA4-A0F2-4139-B02E-9B0F2B39C107} = {203A8EA4-A0F2-4139-B02E-9B0F2B39C107}
@@ -200,6 +201,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Home", "src\Agent\NewRelic\
200201
{EC34F023-223D-432F-9401-9C3ED1B75DE4} = {EC34F023-223D-432F-9401-9C3ED1B75DE4}
201202
{EFFD9051-E3AC-4266-9AF6-7ECC74C032BD} = {EFFD9051-E3AC-4266-9AF6-7ECC74C032BD}
202203
{F889CE37-934F-48F2-A105-6C19CE292D37} = {F889CE37-934F-48F2-A105-6C19CE292D37}
204+
{F921A316-A8D2-4992-B894-69A3B5CA34E3} = {F921A316-A8D2-4992-B894-69A3B5CA34E3}
203205
{FA3ABF45-6DAB-47DC-B886-06BBEFE4292F} = {FA3ABF45-6DAB-47DC-B886-06BBEFE4292F}
204206
EndProjectSection
205207
EndProject
@@ -217,6 +219,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackExchangeRedis2Plus", "
217219
EndProject
218220
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elasticsearch", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\Elasticsearch\Elasticsearch.csproj", "{D9428449-3E4B-4723-A8AA-1191315C7AAD}"
219221
EndProject
222+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MassTransit", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\MassTransit\MassTransit.csproj", "{0DC126D1-E782-4A41-BA3E-393083F08627}"
223+
EndProject
224+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MassTransitLegacy", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\MassTransitLegacy\MassTransitLegacy.csproj", "{F921A316-A8D2-4992-B894-69A3B5CA34E3}"
220225
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kafka", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\Kafka\Kafka.csproj", "{270A9CC8-8031-49F4-A380-1389E7517DB7}"
221226
EndProject
222227
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore6Plus", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\AspNetCore6Plus\AspNetCore6Plus.csproj", "{D4F48A7F-F3D3-4303-921D-BF7FE34B7118}"
@@ -451,6 +456,14 @@ Global
451456
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
452457
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
453458
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Release|Any CPU.Build.0 = Release|Any CPU
459+
{0DC126D1-E782-4A41-BA3E-393083F08627}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
460+
{0DC126D1-E782-4A41-BA3E-393083F08627}.Debug|Any CPU.Build.0 = Debug|Any CPU
461+
{0DC126D1-E782-4A41-BA3E-393083F08627}.Release|Any CPU.ActiveCfg = Release|Any CPU
462+
{0DC126D1-E782-4A41-BA3E-393083F08627}.Release|Any CPU.Build.0 = Release|Any CPU
463+
{F921A316-A8D2-4992-B894-69A3B5CA34E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
464+
{F921A316-A8D2-4992-B894-69A3B5CA34E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
465+
{F921A316-A8D2-4992-B894-69A3B5CA34E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
466+
{F921A316-A8D2-4992-B894-69A3B5CA34E3}.Release|Any CPU.Build.0 = Release|Any CPU
454467
{270A9CC8-8031-49F4-A380-1389E7517DB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
455468
{270A9CC8-8031-49F4-A380-1389E7517DB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
456469
{270A9CC8-8031-49F4-A380-1389E7517DB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -528,12 +541,14 @@ Global
528541
{3D69B4C9-FD16-461F-95AF-6FCA6EAA914E} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
529542
{EC34F023-223D-432F-9401-9C3ED1B75DE4} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
530543
{D9428449-3E4B-4723-A8AA-1191315C7AAD} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
544+
{0DC126D1-E782-4A41-BA3E-393083F08627} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
545+
{F921A316-A8D2-4992-B894-69A3B5CA34E3} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
531546
{270A9CC8-8031-49F4-A380-1389E7517DB7} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
532547
{D4F48A7F-F3D3-4303-921D-BF7FE34B7118} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
533548
EndGlobalSection
534549
GlobalSection(ExtensibilityGlobals) = postSolution
535-
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
536550
SolutionGuid = {D8B98070-6B8E-403C-A07F-A3F2E4A3A3D0}
551+
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
537552
EndGlobalSection
538553
GlobalSection(TestCaseManagementSettings) = postSolution
539554
CategoryFile = FullAgent.vsmdi

build/ArtifactBuilder/CoreAgentComponents.cs

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ protected override void CreateAgentComponents()
5555
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.dll",
5656
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.dll",
5757
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.NServiceBus.dll",
58+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransit.dll",
59+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.dll",
5860
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.dll",
5961
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore6Plus.dll",
6062
};
@@ -76,6 +78,8 @@ protected override void CreateAgentComponents()
7678
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.Instrumentation.xml",
7779
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.Instrumentation.xml",
7880
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.NServiceBus.Instrumentation.xml",
81+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransit.Instrumentation.xml",
82+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.Instrumentation.xml",
7983
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml",
8084
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore6Plus.Instrumentation.xml",
8185
};

build/ArtifactBuilder/FrameworkAgentComponents.cs

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ protected override void CreateAgentComponents()
6464
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebServices.dll",
6565
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore.dll",
6666
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Owin.dll",
67+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransit.dll",
68+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.dll",
6769
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.dll",
6870
};
6971

@@ -100,6 +102,8 @@ protected override void CreateAgentComponents()
100102
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebOptimization.Instrumentation.xml",
101103
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebServices.Instrumentation.xml",
102104
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Misc.Instrumentation.xml",
105+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransit.Instrumentation.xml",
106+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.Instrumentation.xml",
103107
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml",
104108
};
105109

src/Agent/MsiInstaller/Installer/Product.wxs

+25-2
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,16 @@ SPDX-License-Identifier: Apache-2.0
465465
<Component Id="ElasticsearchWrapperComponent" Guid="{9C233889-69DD-4B8B-A1A6-ABAC6E27A716}">
466466
<File Id="ElasticsearchWrapperFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Elasticsearch.dll"/>
467467
</Component>
468+
<Component Id="MassTransitWrapperComponent" Guid="{E133AC42-B96B-46E5-BB9B-0E001AB6EC73}">
469+
<File Id="MassTransitWrapperFile" Name="NewRelic.Providers.Wrapper.MassTransit.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.MassTransit.dll"/>
470+
</Component>
471+
<Component Id="MassTransitLegacyWrapperComponent" Guid="{E44779CC-4C76-4AB1-9CE3-5C225A7202FB}">
472+
<File Id="MassTransitLegacyWrapperFile" Name="NewRelic.Providers.Wrapper.MassTransitLegacy.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.dll"/>
473+
</Component>
468474
<Component Id="KafkaWrapperComponent" Guid="{BE97F5F5-A392-48A0-8888-B2973EA09490}">
469475
<File Id="KafkaWrapperFile" Name="NewRelic.Providers.Wrapper.Kafka.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Kafka.dll"/>
470476
</Component>
471477

472-
473478
<!-- Reference libraries -->
474479
<Component Id="NewRelicCoreReferenceComponent" Guid="{C196ED1E-0FBA-4D36-9C34-E969B0C9E8C9}">
475480
<File Id="NewRelicCoreReferenceFile" Name="NewRelic.Core.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Core.dll"/>
@@ -524,10 +529,16 @@ SPDX-License-Identifier: Apache-2.0
524529
</Component>
525530
<Component Id="CoreNServiceBusWrapperComponent" Guid="{E315AE98-119D-4E46-BACB-C28CF6016C19}">
526531
<File Id="CoreNServiceBusWrapperFile" Name="NewRelic.Providers.Wrapper.NServiceBus.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.NServiceBus.dll"/>
527-
</Component>
532+
</Component>
528533
<Component Id="CoreElasticsearchWrapperComponent" Guid="{531A713C-B46C-41C8-8B21-49CBD4C0A459}">
529534
<File Id="CoreElasticsearchWrapperFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Elasticsearch.dll"/>
530535
</Component>
536+
<Component Id="CoreMassTransitWrapperComponent" Guid="{9E905BC4-D844-4E9C-AC2E-560C837CDDB8}">
537+
<File Id="CoreMassTransitWrapperFile" Name="NewRelic.Providers.Wrapper.MassTransit.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.MassTransit.dll"/>
538+
</Component>
539+
<Component Id="CoreMassTransitLegacyWrapperComponent" Guid="{8E94ECF6-B1A8-4D83-BDE8-71055FA33C34}">
540+
<File Id="CoreMassTransitLegacyWrapperFile" Name="NewRelic.Providers.Wrapper.MassTransitLegacy.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.dll"/>
541+
</Component>
531542
<Component Id="CoreKafkaWrapperComponent" Guid="{6CA6D5A4-A204-4B04-A6B5-13D8B3E736C2}">
532543
<File Id="CoreKafkaWrapperFile" Name="NewRelic.Providers.Wrapper.Kafka.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Kafka.dll"/>
533544
</Component>
@@ -639,6 +650,12 @@ SPDX-License-Identifier: Apache-2.0
639650
<Component Id="ElasticsearchInstrumentationComponent" Guid="{42D85537-D0AB-44EB-8BE5-4B2EEB26DE91}">
640651
<File Id="ElasticsearchInstrumentationFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml"/>
641652
</Component>
653+
<Component Id="MassTransitInstrumentationComponent" Guid="{D8DBC7D6-0337-4441-A5BB-C6670300144A}">
654+
<File Id="MassTransitInstrumentationFile" Name="NewRelic.Providers.Wrapper.MassTransit.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.MassTransit.Instrumentation.xml"/>
655+
</Component>
656+
<Component Id="MassTransitLegacyInstrumentationComponent" Guid="{FAD302C1-07BE-4770-85E4-F6EE25E287F3}">
657+
<File Id="MassTransitLegacyInstrumentationFile" Name="NewRelic.Providers.Wrapper.MassTransitLegacy.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.Instrumentation.xml"/>
658+
</Component>
642659
<Component Id="KafkaInstrumentationComponent" Guid="{9FC86A0E-CACD-4DA8-84F8-20997C904913}">
643660
<File Id="KafkaInstrumentationFile" Name="NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml"/>
644661
</Component>
@@ -690,6 +707,12 @@ SPDX-License-Identifier: Apache-2.0
690707
<Component Id="CoreElasticsearchInstrumentationComponent" Guid="{02EFBFF6-9DA8-4138-A03F-E9502B631A76}">
691708
<File Id="CoreElasticsearchInstrumentationFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml"/>
692709
</Component>
710+
<Component Id="CoreMassTransitInstrumentationComponent" Guid="{7420F63A-BEC7-47E4-A8B3-B81A270DBEB9}">
711+
<File Id="CoreMassTransitInstrumentationFile" Name="NewRelic.Providers.Wrapper.MassTransit.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.MassTransit.Instrumentation.xml"/>
712+
</Component>
713+
<Component Id="CoreMassTransitLegacyInstrumentationComponent" Guid="{A55ED281-B7FA-4BBC-B760-47495EB19BC1}">
714+
<File Id="CoreMassTransitLegacyInstrumentationFile" Name="NewRelic.Providers.Wrapper.MassTransitLegacy.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.Instrumentation.xml"/>
715+
</Component>
693716
<Component Id="CoreKafkaInstrumentationComponent" Guid="{B2C4F83B-A339-4DBD-B8C4-760C8F72F9FC}">
694717
<File Id="CoreKafkaInstrumentationFile" Name="NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml"/>
695718
</Component>

src/Agent/NewRelic/Agent/Core/Utilities/ExtensionsLoader.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,18 @@ public static void Initialize(string installPathExtensionsDirectory)
7373
{ "OpenConnectionWrapperAsync", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.Sql.dll") },
7474

7575
//The NewRelic.Providers.Wrapper.SerilogLogging.dll depends on the Serilog.dll; therefore, it should
76-
//only be loaded by the agent when Serilog is used otherwise assembly load exception will occur.
77-
{ "SerilogCreateLoggerWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.SerilogLogging.dll") },
76+
//only be loaded by the agent when Serilog is used otherwise an assembly load exception will occur.
77+
{ "SerilogCreateLoggerWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.SerilogLogging.dll") },
7878
{ "SerilogDispatchWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.SerilogLogging.dll") },
7979

80-
// Kafka
80+
// Both NewRelic.Providers.Wrapper.MassTransit.dll and NewRelic.Providers.Wrapper.MassTransitLegacy.dll depend on MassTransit assemblies;
81+
// therefore, they should only be loaded by the agent when MassTransit is used, otherwise assembly load exceptions will occur.
82+
{ "TransportConfigWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.MassTransit.dll") },
83+
{ "TransportConfigLegacyWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.MassTransitLegacy.dll") },
84+
85+
// Kafka
8186
{ "KafkaProducerWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.Kafka.dll") },
82-
{ "KafkaSerializerWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.Kafka.dll") },
87+
{ "KafkaSerializerWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.Kafka.dll") },
8388
{ "KafkaConsumerWrapper", Path.Combine(_installPathExtensionsDirectory, "NewRelic.Providers.Wrapper.Kafka.dll") }
8489
};
8590

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!--
3+
Copyright 2020 New Relic Corporation. All rights reserved.
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
<extension xmlns="urn:newrelic-extension">
7+
8+
<instrumentation>
9+
10+
<tracerFactory name="TransportConfigWrapper">
11+
12+
<match assemblyName="MassTransit" className="MassTransit.Configuration.TransportRegistrationBusFactory`1" minVersion="8.0.0">
13+
<exactMethodMatcher methodName="CreateBus" />
14+
</match>
15+
<match assemblyName="MassTransit" className="MassTransit.BusFactoryExtensions" minVersion="8.0.0">
16+
<exactMethodMatcher methodName="Build" parameters="MassTransit.IBusFactory,MassTransit.Configuration.IBusConfiguration,System.Collections.Generic.IEnumerable`1[MassTransit.ValidationResult]" />
17+
</match>
18+
</tracerFactory>
19+
20+
</instrumentation>
21+
</extension>

0 commit comments

Comments
 (0)