Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly version filtering #1342

Merged
merged 17 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion FullAgent.sln
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Log4NetLogging", "src\Agent
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NLogLogging", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\NLogLogging\NLogLogging.csproj", "{3D69B4C9-FD16-461F-95AF-6FCA6EAA914E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackExchangeRedis2Plus", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\StackExchangeRedis2Plus\StackExchangeRedis2Plus.csproj", "{EC34F023-223D-432F-9401-9C3ED1B75DE4}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NewRelic.NuGetHelper", "build\NewRelic.NuGetHelper\NewRelic.NuGetHelper.csproj", "{94BF8D27-2122-4573-AA79-90B977B40EF3}"
EndProject
Global
Expand Down Expand Up @@ -428,6 +429,10 @@ Global
{3D69B4C9-FD16-461F-95AF-6FCA6EAA914E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D69B4C9-FD16-461F-95AF-6FCA6EAA914E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D69B4C9-FD16-461F-95AF-6FCA6EAA914E}.Release|Any CPU.Build.0 = Release|Any CPU
{EC34F023-223D-432F-9401-9C3ED1B75DE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC34F023-223D-432F-9401-9C3ED1B75DE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC34F023-223D-432F-9401-9C3ED1B75DE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC34F023-223D-432F-9401-9C3ED1B75DE4}.Release|Any CPU.Build.0 = Release|Any CPU
{94BF8D27-2122-4573-AA79-90B977B40EF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94BF8D27-2122-4573-AA79-90B977B40EF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94BF8D27-2122-4573-AA79-90B977B40EF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -499,11 +504,12 @@ Global
{0C3E92D7-F16C-4575-9CBB-EB7349A4C5E2} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
{2E6CF650-CB50-453D-830A-D00F0540FC2C} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
{3D69B4C9-FD16-461F-95AF-6FCA6EAA914E} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
{EC34F023-223D-432F-9401-9C3ED1B75DE4} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
{94BF8D27-2122-4573-AA79-90B977B40EF3} = {C0BB7A5D-6820-4058-AC47-0111ECC34015}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D8B98070-6B8E-403C-A07F-A3F2E4A3A3D0}
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
SolutionGuid = {D8B98070-6B8E-403C-A07F-A3F2E4A3A3D0}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FullAgent.vsmdi
Expand Down
2 changes: 2 additions & 0 deletions build/ArtifactBuilder/CoreAgentComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.RabbitMq.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Sql.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.NServiceBus.dll",
};

Expand All @@ -69,6 +70,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.RabbitMq.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Sql.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.NServiceBus.Instrumentation.xml",
};

Expand Down
2 changes: 2 additions & 0 deletions build/ArtifactBuilder/FrameworkAgentComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.ServiceStackRedis.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Sql.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Wcf3.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebApi1.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebApi2.dll",
Expand Down Expand Up @@ -89,6 +90,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.ServiceStackRedis.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Sql.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Wcf3.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebApi1.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebApi2.Instrumentation.xml",
Expand Down
4 changes: 4 additions & 0 deletions src/Agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### New Features
* Custom instrumentation now supports targeting specific assembly versions. See [the documentation](https://docs.newrelic.com/docs/apm/agents/net-agent/custom-instrumentation/add-detail-transactions-xml-net/#procedures) for more details. [#1342](https://github.com/newrelic/newrelic-dotnet-agent/pull/1342)
* RestSharp client instrumentation support has been extended to include the following versions: 106.11.x, 106.12.0, 106.13.0, and 106.15.0. [#1352](https://github.com/newrelic/newrelic-dotnet-agent/pull/1352)
* RestSharp client instrumentation has been verified for versions 107.x and 108.x. For newer versions of RestSharp, external segments/spans are actually generated via our instrumentation of HttpClient. [#1356](https://github.com/newrelic/newrelic-dotnet-agent/pull/1356)

### Fixes

## [10.5.1]
Expand Down
12 changes: 12 additions & 0 deletions src/Agent/MsiInstaller/Installer/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ SPDX-License-Identifier: Apache-2.0
<Component Id="StackExchangeRedisWrapperComponent" Guid="{2DF28617-AB59-4D76-BFAB-B2A75640B265}">
<File Id="StackExchangeRedisWrapperFile" Name="NewRelic.Providers.Wrapper.StackExchangeRedis.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.dll"/>
</Component>
<Component Id="StackExchangeRedis2PlusWrapperComponent" Guid="{890A7E03-698C-44BC-81D5-A6AE031A56CE}">
<File Id="StackExchangeRedis2PlusWrapperFile" Name="NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.dll"/>
</Component>
<Component Id="WebServicesWrapperComponent" Guid="{3778316D-4C6C-4623-9E6F-F9976581D077}">
<File Id="WebServicesWrapperFile" Name="NewRelic.Providers.Wrapper.WebServices.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.WebServices.dll"/>
</Component>
Expand Down Expand Up @@ -495,6 +498,9 @@ SPDX-License-Identifier: Apache-2.0
<Component Id="CoreStackExchangeRedisWrapperComponent" Guid="{9278332C-3059-48F3-BD18-84C4323583DA}">
<File Id="CoreStackExchangeRedisWrapperFile" Name="NewRelic.Providers.Wrapper.StackExchangeRedis.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.dll"/>
</Component>
<Component Id="CoreStackExchangeRedis2PlusWrapperComponent" Guid="{F6457A9C-756F-4901-ACD4-E7F7714065F3}">
<File Id="CoreStackExchangeRedis2PlusWrapperFile" Name="NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.dll"/>
</Component>
<Component Id="CoreRabbitMqWrapperComponent" Guid="{758394DD-AB71-4E58-8E18-BF1135F8B2C2}">
<File Id="CoreRabbitMqWrapperFile" Name="NewRelic.Providers.Wrapper.RabbitMq.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.RabbitMq.dll"/>
</Component>
Expand Down Expand Up @@ -555,6 +561,9 @@ SPDX-License-Identifier: Apache-2.0
<Component Id="StackExchangeRedisInstrumentationComponent" Guid="{3702D3F8-7056-4987-BFC5-418BC13E9CDE}">
<File Id="StackExchangeRedisInstrumentationFile" Name="NewRelic.Providers.Wrapper.StackExchangeRedis.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.Instrumentation.xml"/>
</Component>
<Component Id="StackExchangeRedis2PlusInstrumentationComponent" Guid="{1B40C798-D522-4705-8D3C-C5AF7EDDC3A7}">
<File Id="StackExchangeRedis2PlusInstrumentationFile" Name="NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.Instrumentation.xml"/>
</Component>
<Component Id="WebOptimizationInstrumentationComponent" Guid="{3DFA9833-C841-4752-ACDA-5BF5A251C6C7}">
<File Id="WebOptimizationInstrumentationFile" Name="NewRelic.Providers.Wrapper.WebOptimization.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.WebOptimization.Instrumentation.xml"/>
</Component>
Expand Down Expand Up @@ -627,6 +636,9 @@ SPDX-License-Identifier: Apache-2.0
<Component Id="CoreStackExchangeRedisInstrumentationComponent" Guid="{D7D3D2F7-1001-405A-9844-8640A39C5B9F}">
<File Id="CoreStackExchangeRedisInstrumentationFile" Name="NewRelic.Providers.Wrapper.StackExchangeRedis.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.Instrumentation.xml"/>
</Component>
<Component Id="CoreStackExchangeRedis2PlusInstrumentationComponent" Guid="{DF257CD8-40E1-42B1-85D6-9CDF05908F1D}">
<File Id="CoreStackExchangeRedis2PlusInstrumentationFile" Name="NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.Instrumentation.xml"/>
</Component>
<Component Id="CoreRabbitMqInstrumentationComponent" Guid="{1CDC18CC-992A-4386-BC4D-DE87A85D9568}">
<File Id="CoreRabbitMqInstrumentationFile" Name="NewRelic.Providers.Wrapper.RabbitMq.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.RabbitMq.Instrumentation.xml"/>
</Component>
Expand Down
8 changes: 8 additions & 0 deletions src/Agent/NewRelic/Agent/Core/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using NewRelic.Agent.Core.Wrapper.AgentWrapperApi.Builders;
using NewRelic.Agent.Core.Wrapper.AgentWrapperApi.CrossApplicationTracing;
using NewRelic.Agent.Core.Wrapper.AgentWrapperApi.Synthetics;
using NewRelic.Agent.Extensions.Helpers;
using NewRelic.Agent.Extensions.Providers.Wrapper;
using NewRelic.Core;
using NewRelic.Core.Logging;
Expand Down Expand Up @@ -62,6 +63,7 @@ public class Agent : IAgent // any changes to api, update the interface in exten
private readonly ILogEventAggregator _logEventAggregator;
private readonly ILogContextDataFilter _logContextDataFilter;
private Extensions.Logging.ILogger _logger;
private IStackExchangeRedisCache _stackExchangeRedisCache;

public Agent(ITransactionService transactionService, ITransactionTransformer transactionTransformer,
IThreadPoolStatic threadPoolStatic, ITransactionMetricNameMaker transactionMetricNameMaker, IPathHashMaker pathHashMaker,
Expand Down Expand Up @@ -405,6 +407,12 @@ public Dictionary<string, string> GetLinkingMetadata()

#region ExperimentalApi

public IStackExchangeRedisCache StackExchangeRedisCache
{
get { return _stackExchangeRedisCache; }
set { _stackExchangeRedisCache = value; }
}

public void RecordSupportabilityMetric(string metricName, int count)
{
_agentHealthReporter.ReportSupportabilityCountMetric(metricName, count);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Copyright 2020 New Relic, Inc. All rights reserved.
// SPDX-License-Identifier: Apache-2.0


// ------------------------------------------------------------------------------
// <auto-generated>
// Generated by Xsd2Code. Version 3.6.0.0
Expand Down Expand Up @@ -305,6 +301,10 @@ public partial class extensionTracerFactoryMatch

private string assemblyNameField;

private string minVersionField;

private string maxVersionField;

private string classNameField;

/// <summary>
Expand Down Expand Up @@ -344,6 +344,38 @@ public string assemblyName
}
}

/// <summary>
/// The minimum version (inclusive) for this assembly to match. e.g. "1.2.3.4"
/// </summary>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string minVersion
{
get
{
return this.minVersionField;
}
set
{
this.minVersionField = value;
}
}

/// <summary>
/// The maximum version (inclusive) for this assembly to mach. e.g. "1.2.3.4"
/// </summary>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string maxVersion
{
get
{
return this.maxVersionField;
}
set
{
this.maxVersionField = value;
}
}

/// <summary>
/// The full class name to match. This is case sensitive - use the correct mixed case.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,30 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="minVersion" use="optional">
<xs:annotation>
<xs:documentation>
The minimum version (inclusive) for this assembly to match. e.g. "1.2.3.4"
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]+(\.[0-9]+)?(\.[0-9]+)?(\.[0-9]+)?"></xs:pattern>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="maxVersion" use="optional">
<xs:annotation>
<xs:documentation>
The maximum version (exclusive) for this assembly to mach. e.g. "1.2.3.4"
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]+(\.[0-9]+)?(\.[0-9]+)?(\.[0-9]+)?"></xs:pattern>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="className" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
Expand Down
1 change: 1 addition & 0 deletions src/Agent/NewRelic/Agent/Core/Segments/NoOpSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class NoOpSegment : ISegment, ISegmentExperimental, ISegmentDataState

public void End() { }
public void End(Exception ex) { }
public void EndStackExchangeRedis() { }
public void MakeCombinable() { }

public ISegmentExperimental MakeLeaf()
Expand Down
Loading