Skip to content

Commit

Permalink
feat: Add instrumentation for .NET Elasticsearch clients. (#1575)
Browse files Browse the repository at this point in the history
* Port initial poc

* Added elastic search and kibana to unbounded services (#1505)

* Enabled authentication for ElasticSearch and Kibana (#1507)

* Updated docker-compose to enable authentication for ElasticSearch and Kibana. 
* Added a configuration helper for use in integration tests for ElasticSearch.

* Support Elastic.Clients.Elasticsearch (8.x) client (#1512)

* Add new instrumentation files to build artifacts (#1529)

* test: Elasticsearch integration tests framework (#1532)

* Instrument async Elasticsearch methods (#1535)

* Working async instrumentation

* Get NEST async working, fix integration test

* Set URI after datastore segment creation (#1538)

* Initial plumbing, seems to work

* Update integration tests

* Remove stray using

* Clean up comments

* Build bug and review feedback

* Handle https and improve async reliability

Handle https as well as http in Elastic server url
Fix async timing problem with a delay (ugh)

* Incremental Elasticsearch integration test work (#1543)

* Report Elasticsearch.net operations more accurately (#1559)

* Improve Elasticsearch integration tests (#1563)

* Fix solution build problem

* Add search validation to async tests

Also remove comments from wrapper
Also reorder methods in sync tests

* Initial coding of bulk insert and multisearch in exercisers

* Added sync tests for indexmany and multisearch.  Not passing.

* Fix assertions

* Add async operations to sync tests class

* Combine sync and async test files

* Get elastic.clients case to work

* Elasticsearch.Net tests passing

* Test range of versions but only test oldest and newest frameworks

* Add client call success validation to Elasticsearch integration tests (#1566)

* Bubble up the async await

* Add API operation validation

All tests passing locally

* Elasticsearch error reporting (#1568)

* Adding support for Elasticsearch error reporting

* Safer way to set errors

* Fixed unreliable integration tests; fixed potential path parsing crash

* Missed replacing a call to InternalApi

---------

Co-authored-by: Marty Tippin <120425148+tippmar-nr@users.noreply.github.com>
Co-authored-by: Chris Hynes <111462425+chynesNR@users.noreply.github.com>
Co-authored-by: chynesNR <chynes@newrelic.com>
  • Loading branch information
4 people authored Apr 26, 2023
1 parent b65b117 commit 8e49d7b
Show file tree
Hide file tree
Showing 29 changed files with 1,751 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/all_solutions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ jobs:
runs-on: windows-2022
strategy:
matrix:
namespace: [ CosmosDB, Couchbase, MongoDB, Msmq, MsSql, MySql, NServiceBus, NServiceBus5, Oracle, Postgres, RabbitMq, Redis ]
namespace: [ CosmosDB, Couchbase, Elasticsearch, MongoDB, Msmq, MsSql, MySql, NServiceBus, NServiceBus5, Oracle, Postgres, RabbitMq, Redis ]
fail-fast: false # we don't want one test failure in one namespace to kill the other runs

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: |
if [ "${{ github.event.inputs.unbounded-test-namespaces }}" == "ALL" ] ; then
# Use the full list of namespaces
namespaces="[ 'CosmosDB', 'Couchbase', 'MongoDB', 'Msmq', 'MsSql', 'MySql', 'NServiceBus', 'NServiceBus5', 'Oracle', 'Postgres', 'RabbitMq', 'Redis' ]"
namespaces="[ 'CosmosDB', 'Couchbase', 'Elasticsearch', 'MongoDB', 'Msmq', 'MsSql', 'MySql', 'NServiceBus', 'NServiceBus5', 'Oracle', 'Postgres', 'RabbitMq', 'Redis' ]"
else
# Just use the supplied list of namespaces
namespaces="[ ${{ github.event.inputs.unbounded-test-namespaces }} ]"
Expand Down
9 changes: 8 additions & 1 deletion FullAgent.sln
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackExchangeRedis2Plus", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NewRelic.NuGetHelper", "build\NewRelic.NuGetHelper\NewRelic.NuGetHelper.csproj", "{94BF8D27-2122-4573-AA79-90B977B40EF3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elasticsearch", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\Elasticsearch\Elasticsearch.csproj", "{D9428449-3E4B-4723-A8AA-1191315C7AAD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -438,6 +440,10 @@ Global
{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
{94BF8D27-2122-4573-AA79-90B977B40EF3}.Release|Any CPU.Build.0 = Release|Any CPU
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -507,10 +513,11 @@ Global
{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}
{D9428449-3E4B-4723-A8AA-1191315C7AAD} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
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 @@ -43,6 +43,7 @@ protected override void CreateAgentComponents()
{
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.CosmosDb.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Elasticsearch.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.HttpClient.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Log4NetLogging.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.SerilogLogging.dll",
Expand All @@ -60,6 +61,7 @@ protected override void CreateAgentComponents()
{
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.CosmosDb.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.HttpClient.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Log4NetLogging.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.SerilogLogging.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 @@ -37,6 +37,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNet.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.CosmosDb.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Couchbase.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Elasticsearch.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.HttpClient.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.HttpWebRequest.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Log4NetLogging.dll",
Expand Down Expand Up @@ -71,6 +72,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.CosmosDb.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Couchbase.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.HttpClient.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.HttpWebRequest.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Log4NetLogging.Instrumentation.xml",
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 @@ -461,6 +461,9 @@ SPDX-License-Identifier: Apache-2.0
<Component Id="MicrosoftExtensionsLoggingWrapperComponent" Guid="{33598C6C-BF8E-4AFC-A6C1-56310CEE61D7}">
<File Id="MicrosoftExtensionsLoggingWrapperFile" Name="NewRelic.Providers.Wrapper.MicrosoftExtensionsLogging.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.MicrosoftExtensionsLogging.dll"/>
</Component>
<Component Id="ElasticsearchWrapperComponent" Guid="{9C233889-69DD-4B8B-A1A6-ABAC6E27A716}">
<File Id="ElasticsearchWrapperFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Elasticsearch.dll"/>
</Component>

<!-- Reference libraries -->
<Component Id="NewRelicCoreReferenceComponent" Guid="{C196ED1E-0FBA-4D36-9C34-E969B0C9E8C9}">
Expand Down Expand Up @@ -514,6 +517,9 @@ SPDX-License-Identifier: Apache-2.0
<Component Id="CoreNLogLoggingWrapperComponent" Guid="{897C07B8-AF97-4BA3-B6F3-26395A02147E}">
<File Id="CoreNLogLoggingWrapperFile" Name="NewRelic.Providers.Wrapper.NLogLogging.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.NLogLogging.dll"/>
</Component>
<Component Id="CoreElasticsearchWrapperComponent" Guid="{531A713C-B46C-41C8-8B21-49CBD4C0A459}">
<File Id="CoreElasticsearchWrapperFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Elasticsearch.dll"/>
</Component>

<!-- Reference libraries -->
<Component Id="CoreNewRelicCoreReferenceComponent" Guid="{DD2BE979-7D4B-47EA-9FBE-F6B381D70E0B}">
Expand Down Expand Up @@ -616,6 +622,9 @@ SPDX-License-Identifier: Apache-2.0
<Component Id="MicrosoftExtensionsLoggingInstrumentationComponent" Guid="{FE0A1615-93B7-4355-AE20-D5C2E1ABE56C}">
<File Id="MicrosoftExtensionsLoggingFile" Name="NewRelic.Providers.Wrapper.MicrosoftExtensionsLogging.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.MicrosoftExtensionsLogging.Instrumentation.xml"/>
</Component>
<Component Id="ElasticsearchInstrumentationComponent" Guid="{42D85537-D0AB-44EB-8BE5-4B2EEB26DE91}">
<File Id="ElasticsearchInstrumentationFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml"/>
</Component>
</ComponentGroup>

<ComponentGroup Id="CoreNewRelic.Agent.Extensions.Instrumentation" Directory="CoreExtensionsFolder">
Expand Down Expand Up @@ -658,6 +667,9 @@ SPDX-License-Identifier: Apache-2.0
<Component Id="CoreNLogLoggingInstrumentationComponent" Guid="{D9A87E74-C43B-4ACD-BF6C-DC082FEDD777}">
<File Id="CoreNLogLoggingInstrumentationFile" Name="NewRelic.Providers.Wrapper.NLogLogging.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.NLogLogging.Instrumentation.xml"/>
</Component>
<Component Id="CoreElasticsearchInstrumentationComponent" Guid="{02EFBFF6-9DA8-4138-A03F-E9502B631A76}">
<File Id="CoreElasticsearchInstrumentationFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml"/>
</Component>
</ComponentGroup>

<!-- Extensions XSD-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,8 @@ public static IAgentManager Instance
{
get
{
try
{
return Singleton.ExistingInstance;
}
catch (NullReferenceException)
{
// The singleton pointer may be null if we instrument a method that's invoked in the agent constructor.
return DisabledAgentManager;
}
// The singleton pointer may be null if we instrument a method that's invoked in the agent constructor.
return Singleton?.ExistingInstance ?? DisabledAgentManager;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2020 New Relic, Inc. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

using NewRelic.Agent.Api.Experimental;
using NewRelic.Agent.Configuration;
using NewRelic.Agent.Core.Aggregators;
using NewRelic.Agent.Core.Attributes;
Expand All @@ -20,7 +21,7 @@

namespace NewRelic.Agent.Core.Segments
{
public class DatastoreSegmentData : AbstractSegmentData
public class DatastoreSegmentData : AbstractSegmentData, IDatastoreSegmentData
{
private readonly static ConnectionInfo EmptyConnectionInfo = new ConnectionInfo(null, null, null);

Expand Down Expand Up @@ -223,5 +224,10 @@ public override void SetSpanTypeSpecificAttributes(SpanAttributeValueCollection
AttribDefs.PeerHostname.TrySetValue(attribVals, Host);
AttribDefs.SpanKind.TrySetDefault(attribVals);
}

public void SetConnectionInfo(ConnectionInfo connInfo)
{
_connectionInfo = connInfo;
}
}
}
13 changes: 13 additions & 0 deletions src/Agent/NewRelic/Agent/Core/Transactions/NoOpTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NewRelic.Agent.Api;
using NewRelic.Agent.Api.Experimental;
using NewRelic.Agent.Core.Api;
using NewRelic.Agent.Core.Database;
using NewRelic.Agent.Core.Segments;
using NewRelic.Agent.Extensions.Parsing;
using NewRelic.Agent.Extensions.Providers.Wrapper;
Expand All @@ -26,6 +27,7 @@ public class NoOpTransaction : ITransaction, ITransactionExperimental
private object _wrapperToken;

private static readonly IExternalSegmentData _noOpExternalSegmentData = new ExternalSegmentData(new Uri("https://www.newrelic.com/"), string.Empty);
private static readonly IDatastoreSegmentData _noOpDatastoreSegmentData = new DatastoreSegmentData(new DatabaseService(), new ParsedSqlStatement(DatastoreVendor.Other, string.Empty, string.Empty));

public void End(bool captureResponseTime = true)
{
Expand Down Expand Up @@ -119,6 +121,11 @@ public void NoticeError(Exception exception)
Log.Debug($"Ignoring application error because it occurred outside of a transaction: {exception}");
}

public void NoticeError(string message)
{
Log.Debug($"Ignoring application error because it occurred outside of a transaction: {message}");
}

public void SetHttpResponseStatusCode(int statusCode, int? subStatusCode = null)
{

Expand Down Expand Up @@ -255,6 +262,11 @@ public IExternalSegmentData CreateExternalSegmentData(Uri destinationUri, string
return _noOpExternalSegmentData;
}

public IDatastoreSegmentData CreateDatastoreSegmentData(ParsedSqlStatement sqlStatement, ConnectionInfo connectionInfo, string commandText, IDictionary<string, IConvertible> queryParameters)
{
return _noOpDatastoreSegmentData;
}

public ITransaction AddCustomAttribute(string key, object value)
{
return this;
Expand Down Expand Up @@ -285,5 +297,6 @@ public void SetUserId(string userid)
{
return;
}

}
}
2 changes: 1 addition & 1 deletion src/Agent/NewRelic/Agent/Core/Transactions/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public ISegment StartDatastoreSegment(MethodCall methodCall, ParsedSqlStatement
return segment;
}

public AbstractSegmentData CreateDatastoreSegmentData(ParsedSqlStatement parsedSqlStatement, ConnectionInfo connectionInfo, string commandText, IDictionary<string, IConvertible> queryParameters = null)
public IDatastoreSegmentData CreateDatastoreSegmentData(ParsedSqlStatement parsedSqlStatement, ConnectionInfo connectionInfo, string commandText, IDictionary<string, IConvertible> queryParameters = null)
{
if (!Agent.Configuration.DatastoreTracerQueryParametersEnabled)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2020 New Relic, Inc. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

using System;
using NewRelic.Agent.Extensions.Parsing;

namespace NewRelic.Agent.Api.Experimental
{
/// <summary>
/// This interface contains methods we may eventually move out of the experimental namespace once they have been sufficiently vetted.
/// Methods on this interface are subject to refactoring or removal in future versions of the API.
/// </summary>
public interface IDatastoreSegmentData : ISegmentData
{
void SetConnectionInfo(ConnectionInfo connectionInfo);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NewRelic.Agent.Extensions.Parsing;
using NewRelic.Agent.Extensions.Providers.Wrapper;
using System;
using System.Collections.Generic;

namespace NewRelic.Agent.Api.Experimental
{
Expand Down Expand Up @@ -41,6 +42,17 @@ public interface ITransactionExperimental
/// <returns>An object that can be used to manage all of the data we support for external requests.</returns>
IExternalSegmentData CreateExternalSegmentData(Uri destinationUri, string method);

/// <summary>
/// Creates an object that holds the data that represents a datastore request. This data can be added to a
/// segment so that a segment can represent a datastore request.
/// </summary>
/// <param name="sqlStatement">An object containing information about the request being made.</param>
/// <param name="connectionInfo">An object containing information about the service the request is being made to.</param>
/// <param name="commandText">An string with the raw datastore statement text. Can be an empty string.</param>
/// <param name="queryParameters">A dictionary of query parameter names and values. Can be null.</param>
/// <returns>An object that can be used to manage all of the data we support for datastore requests.</returns>
IDatastoreSegmentData CreateDatastoreSegmentData(ParsedSqlStatement sqlStatement, ConnectionInfo connectionInfo, string commandText, IDictionary<string, IConvertible> queryParameters);

DateTime StartTime { get; }

ISegment StartStackExchangeRedisSegment(int invocationTargetHashCode, ParsedSqlStatement parsedSqlStatement, ConnectionInfo connectionInfo, TimeSpan relativeStartTime, TimeSpan relativeEndTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public enum DatastoreVendor
Redis,
//SQLite,
CosmosDB,
Elasticsearch,
Other
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<AssemblyName>NewRelic.Providers.Wrapper.Elasticsearch</AssemblyName>
<RootNamespace>NewRelic.Providers.Wrapper.Elasticsearch</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Content Include="Instrumentation.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(RootProjectDirectory)\src\NewRelic.Core\NewRelic.Core.csproj" />
<ProjectReference Include="..\..\..\NewRelic.Agent.Extensions\NewRelic.Agent.Extensions.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2020 New Relic, Inc. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

using System;

namespace NewRelic.Providers.Wrapper.Elasticsearch
{
public class ElasticsearchRequestException : Exception
{
public ElasticsearchRequestException(string message)
: base(message) { }

public ElasticsearchRequestException()
: base() { }

public ElasticsearchRequestException(string message, Exception innerException)
: base(message, innerException) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2020 New Relic Corporation. All rights reserved.
SPDX-License-Identifier: Apache-2.0
-->
<extension xmlns="urn:newrelic-extension">
<instrumentation>

<!--7.x NEST/Elasticsearch.Net -->
<tracerFactory name="RequestWrapper">
<match assemblyName="Elasticsearch.Net" className="Elasticsearch.Net.Transport`1">
<exactMethodMatcher methodName="Request" parameters="Elasticsearch.Net.HttpMethod,System.String,Elasticsearch.Net.PostData,Elasticsearch.Net.IRequestParameters" />
</match>
</tracerFactory>

<tracerFactory name="RequestWrapper">
<match assemblyName="Elasticsearch.Net" className="Elasticsearch.Net.Transport`1">
<exactMethodMatcher methodName="RequestAsync" parameters="Elasticsearch.Net.HttpMethod,System.String,System.Threading.CancellationToken,Elasticsearch.Net.PostData,Elasticsearch.Net.IRequestParameters" />
</match>
</tracerFactory>

<!--8.x Elastic.Clients.Elasticsearch -->
<tracerFactory name="RequestWrapper">
<match assemblyName="Elastic.Transport" className="Elastic.Transport.DefaultHttpTransport`1">
<exactMethodMatcher methodName="Request" parameters="Elastic.Transport.HttpMethod,System.String,Elastic.Transport.PostData,Elastic.Transport.RequestParameters" />
</match>
</tracerFactory>

<tracerFactory name="RequestWrapper">
<match assemblyName="Elastic.Transport" className="Elastic.Transport.DefaultHttpTransport`1">
<exactMethodMatcher methodName="RequestAsync" parameters="Elastic.Transport.HttpMethod,System.String,Elastic.Transport.PostData,Elastic.Transport.RequestParameters,System.Threading.CancellationToken" />
</match>
</tracerFactory>

</instrumentation>
</extension>
Loading

0 comments on commit 8e49d7b

Please sign in to comment.