Skip to content

Commit

Permalink
Updated 7x instrumentation with version ranges
Browse files Browse the repository at this point in the history
Not quite working, integration tests are failing for StartBus with v7.0.0 due to transaction scope oddness
  • Loading branch information
nr-ahemsath committed Oct 27, 2023
1 parent 760f41c commit 561abc1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ SPDX-License-Identifier: Apache-2.0

<tracerFactory name="TransportConfigLegacyWrapper">

<!--This classname works for MassTransit v7.0.0-->
<match assemblyName="MassTransit" className="MassTransit.Registration.TransportRegistrationBusFactory" maxVersion="8.0.0">
<!--See https://github.com/MassTransit/MassTransit/compare/v7.0.7...v7.1 for changes between 7.0.7 and 7.1.0-->

<!--TransportRegistrationBusFactory became a generic type with one type parameter between 7.0.7 and 7.1.0 -->
<match assemblyName="MassTransit" className="MassTransit.Registration.TransportRegistrationBusFactory" minVersion="7.0.0" maxVersion="7.1.0">
<exactMethodMatcher methodName="CreateBus" />
</match>
<!--This classname works for MassTransit v7.3.1-->
<match assemblyName="MassTransit" className="MassTransit.Registration.TransportRegistrationBusFactory`1" maxVersion="8.0.0">
<match assemblyName="MassTransit" className="MassTransit.Registration.TransportRegistrationBusFactory`1" minVersion="7.1.0" maxVersion="8.0.0">
<exactMethodMatcher methodName="CreateBus" />
</match>

<match assemblyName="MassTransit" className="MassTransit.BusFactoryExtensions" maxVersion="8.0.0">
<!--The number and types of parameters to the Build method changed between 7.0.7 and 7.1.0-->
<match assemblyName="MassTransit" className="MassTransit.BusFactoryExtensions" minVersion="7.0.0" maxVersion="7.1.0">
<exactMethodMatcher methodName="Build" parameters="MassTransit.IBusFactory,System.Collections.Generic.IEnumerable`1[GreenPipes.ISpecification]" />
</match>

<match assemblyName="MassTransit" className="MassTransit.BusFactoryExtensions" minVersion="7.1.0" maxVersion="8.0.0">
<exactMethodMatcher methodName="Build" parameters="MassTransit.IBusFactory,MassTransit.Configuration.IBusConfiguration,System.Collections.Generic.IEnumerable`1[GreenPipes.ValidationResult]" />
</match>
</tracerFactory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public void Test()
var massTransitConsumeMetricNameRegex = massTransitMetricNameRegexBase + @"Consume\/" + queueNameRegex;

var metrics = _fixture.AgentLog.GetMetrics().ToList();
//Metric named MessageBroker\/MassTransit\/Queue\/Consume\/Named\/(.{26}) scoped to OtherTransaction\/Message\/MassTransit\/Queue\/Named\/(.{26}) was not found in the metric payload

var expectedMetrics = new List<Assertions.ExpectedMetric>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,22 @@
</ItemGroup>

<!--MassTransit-->
<!--7.0.0 -> 7.0.7 have a different instrumentation point than 7.1.0 -> 7.3.1 (newest 7.x)-->
<ItemGroup>
<PackageReference Include="MassTransit" Version="7.3.1" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit" Version="7.3.1" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit" Version="7.0.0" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit" Version="7.1.0" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit" Version="7.3.1" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="MassTransit" Version="8.1.1" Condition="'$(TargetFramework)' == 'net481'" />
<PackageReference Include="MassTransit" Version="7.3.1" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="MassTransit" Version="8.1.1" Condition="'$(TargetFramework)' == 'net7.0'" />

<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.0.0" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.1.0" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" Condition="'$(TargetFramework)' == 'net6.0'" />

<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.0.0" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.1.0" Condition="'$(TargetFramework)' == 'net471'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" Condition="'$(TargetFramework)' == 'net6.0'" />

Expand Down

0 comments on commit 561abc1

Please sign in to comment.