Skip to content

Commit 9f8d22f

Browse files
authored
feat: Enable auto-instrumentation for Confluent.Kafka versions 1.4.0 to 2.x.x. (#1990)
1 parent bf4102b commit 9f8d22f

File tree

51 files changed

+1474
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1474
-28
lines changed

FullAgent.sln

+9-1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Home", "src\Agent\NewRelic\
167167
{203A8EA4-A0F2-4139-B02E-9B0F2B39C107} = {203A8EA4-A0F2-4139-B02E-9B0F2B39C107}
168168
{22274460-3222-4474-B679-19E1F27A2CC3} = {22274460-3222-4474-B679-19E1F27A2CC3}
169169
{230CDE78-9D21-4D10-9C4B-E00C88B8B021} = {230CDE78-9D21-4D10-9C4B-E00C88B8B021}
170+
{270A9CC8-8031-49F4-A380-1389E7517DB7} = {270A9CC8-8031-49F4-A380-1389E7517DB7}
170171
{279F8AD0-C959-476F-BD58-3581D9A33238} = {279F8AD0-C959-476F-BD58-3581D9A33238}
171172
{2E6CF650-CB50-453D-830A-D00F0540FC2C} = {2E6CF650-CB50-453D-830A-D00F0540FC2C}
172173
{2FB30555-65A4-43D7-82AA-56BF203D3A96} = {2FB30555-65A4-43D7-82AA-56BF203D3A96}
@@ -215,6 +216,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackExchangeRedis2Plus", "
215216
EndProject
216217
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elasticsearch", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\Elasticsearch\Elasticsearch.csproj", "{D9428449-3E4B-4723-A8AA-1191315C7AAD}"
217218
EndProject
219+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kafka", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\Kafka\Kafka.csproj", "{270A9CC8-8031-49F4-A380-1389E7517DB7}"
220+
EndProject
218221
Global
219222
GlobalSection(SolutionConfigurationPlatforms) = preSolution
220223
Debug|Any CPU = Debug|Any CPU
@@ -445,6 +448,10 @@ Global
445448
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
446449
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
447450
{D9428449-3E4B-4723-A8AA-1191315C7AAD}.Release|Any CPU.Build.0 = Release|Any CPU
451+
{270A9CC8-8031-49F4-A380-1389E7517DB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
452+
{270A9CC8-8031-49F4-A380-1389E7517DB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
453+
{270A9CC8-8031-49F4-A380-1389E7517DB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
454+
{270A9CC8-8031-49F4-A380-1389E7517DB7}.Release|Any CPU.Build.0 = Release|Any CPU
448455
EndGlobalSection
449456
GlobalSection(SolutionProperties) = preSolution
450457
HideSolutionNode = FALSE
@@ -514,10 +521,11 @@ Global
514521
{3D69B4C9-FD16-461F-95AF-6FCA6EAA914E} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
515522
{EC34F023-223D-432F-9401-9C3ED1B75DE4} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
516523
{D9428449-3E4B-4723-A8AA-1191315C7AAD} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
524+
{270A9CC8-8031-49F4-A380-1389E7517DB7} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
517525
EndGlobalSection
518526
GlobalSection(ExtensibilityGlobals) = postSolution
519-
SolutionGuid = {D8B98070-6B8E-403C-A07F-A3F2E4A3A3D0}
520527
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
528+
SolutionGuid = {D8B98070-6B8E-403C-A07F-A3F2E4A3A3D0}
521529
EndGlobalSection
522530
GlobalSection(TestCaseManagementSettings) = postSolution
523531
CategoryFile = FullAgent.vsmdi

build/ArtifactBuilder/CoreAgentComponents.cs

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ 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.Kafka.dll",
5859
};
5960

6061
var wrapperXmls = new[]
@@ -74,6 +75,7 @@ protected override void CreateAgentComponents()
7475
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis.Instrumentation.xml",
7576
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.StackExchangeRedis2Plus.Instrumentation.xml",
7677
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.NServiceBus.Instrumentation.xml",
78+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml",
7779
};
7880

7981
ExtensionXsd = $@"{SourceHomeBuilderPath}\extensions\extension.xsd";

build/ArtifactBuilder/FrameworkAgentComponents.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ protected override void CreateAgentComponents()
6363
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebOptimization.dll",
6464
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebServices.dll",
6565
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore.dll",
66-
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Owin.dll"
66+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Owin.dll",
67+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.dll",
6768
};
6869

6970
var wrapperXmls = new[]
@@ -99,6 +100,7 @@ protected override void CreateAgentComponents()
99100
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebOptimization.Instrumentation.xml",
100101
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.WebServices.Instrumentation.xml",
101102
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Misc.Instrumentation.xml",
103+
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml",
102104
};
103105

104106
ExtensionXsd = $@"{SourceHomeBuilderPath}\extensions\extension.xsd";

src/Agent/MsiInstaller/Installer/Product.wxs

+13
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ 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="KafkaWrapperComponent" Guid="{BE97F5F5-A392-48A0-8888-B2973EA09490}">
469+
<File Id="KafkaWrapperFile" Name="NewRelic.Providers.Wrapper.Kafka.dll" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Kafka.dll"/>
470+
</Component>
471+
468472

469473
<!-- Reference libraries -->
470474
<Component Id="NewRelicCoreReferenceComponent" Guid="{C196ED1E-0FBA-4D36-9C34-E969B0C9E8C9}">
@@ -524,6 +528,9 @@ SPDX-License-Identifier: Apache-2.0
524528
<Component Id="CoreElasticsearchWrapperComponent" Guid="{531A713C-B46C-41C8-8B21-49CBD4C0A459}">
525529
<File Id="CoreElasticsearchWrapperFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Elasticsearch.dll"/>
526530
</Component>
531+
<Component Id="CoreKafkaWrapperComponent" Guid="{6CA6D5A4-A204-4B04-A6B5-13D8B3E736C2}">
532+
<File Id="CoreKafkaWrapperFile" Name="NewRelic.Providers.Wrapper.Kafka.dll" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Kafka.dll"/>
533+
</Component>
527534

528535
<!-- Reference libraries -->
529536
<Component Id="CoreNewRelicCoreReferenceComponent" Guid="{DD2BE979-7D4B-47EA-9FBE-F6B381D70E0B}">
@@ -629,6 +636,9 @@ SPDX-License-Identifier: Apache-2.0
629636
<Component Id="ElasticsearchInstrumentationComponent" Guid="{42D85537-D0AB-44EB-8BE5-4B2EEB26DE91}">
630637
<File Id="ElasticsearchInstrumentationFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml"/>
631638
</Component>
639+
<Component Id="KafkaInstrumentationComponent" Guid="{9FC86A0E-CACD-4DA8-84F8-20997C904913}">
640+
<File Id="KafkaInstrumentationFile" Name="NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml"/>
641+
</Component>
632642
</ComponentGroup>
633643

634644
<ComponentGroup Id="CoreNewRelic.Agent.Extensions.Instrumentation" Directory="CoreExtensionsFolder">
@@ -677,6 +687,9 @@ SPDX-License-Identifier: Apache-2.0
677687
<Component Id="CoreElasticsearchInstrumentationComponent" Guid="{02EFBFF6-9DA8-4138-A03F-E9502B631A76}">
678688
<File Id="CoreElasticsearchInstrumentationFile" Name="NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Elasticsearch.Instrumentation.xml"/>
679689
</Component>
690+
<Component Id="CoreKafkaInstrumentationComponent" Guid="{B2C4F83B-A339-4DBD-B8C4-760C8F72F9FC}">
691+
<File Id="CoreKafkaInstrumentationFile" Name="NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml" KeyPath="yes" Source="$(var.HomeFolderPath)_coreclr\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml"/>
692+
</Component>
680693
</ComponentGroup>
681694

682695
<!-- Extensions XSD-->

src/Agent/NewRelic/Agent/Core/Agent.cs

+16-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ public ITransaction CreateTransaction(MessageBrokerDestinationType destinationTy
118118
return CreateTransaction(TransactionName.ForBrokerTransaction(destinationType, brokerVendorName, destination), true, wrapperOnCreate ?? NoOpWrapperOnCreate);
119119
}
120120

121+
public ITransaction CreateKafkaTransaction(MessageBrokerDestinationType destinationType, string brokerVendorName, string destination, Action wrapperOnCreate)
122+
{
123+
return CreateTransaction(TransactionName.ForKafkaBrokerTransaction(destinationType, brokerVendorName, destination), true, wrapperOnCreate ?? NoOpWrapperOnCreate);
124+
}
125+
121126
public ITransaction CreateTransaction(bool isWeb, string category, string transactionDisplayName, bool doNotTrackAsUnitOfWork, Action wrapperOnCreate)
122127
{
123128
if (transactionDisplayName == null)
@@ -401,11 +406,21 @@ public IStackExchangeRedisCache StackExchangeRedisCache
401406
set { _stackExchangeRedisCache = value; }
402407
}
403408

404-
public void RecordSupportabilityMetric(string metricName, int count)
409+
public void RecordSupportabilityMetric(string metricName, long count = 1)
405410
{
406411
_agentHealthReporter.ReportSupportabilityCountMetric(metricName, count);
407412
}
408413

414+
public void RecordCountMetric(string metricName, long count = 1)
415+
{
416+
_agentHealthReporter.ReportCountMetric(metricName, count);
417+
}
418+
419+
public void RecordByteMetric(string metricName, long totalBytes, long? exclusiveBytes = null)
420+
{
421+
_agentHealthReporter.ReportByteMetric(metricName, totalBytes, exclusiveBytes);
422+
}
423+
409424
public void RecordLogMessage(string frameworkName, object logEvent, Func<object, DateTime> getTimestamp, Func<object, object> getLevel, Func<object, string> getLogMessage, Func<object, Exception> getLogException, Func<object, Dictionary<string, object>> getContextData, string spanId, string traceId)
410425
{
411426
_agentHealthReporter.ReportLogForwardingFramework(frameworkName);

src/Agent/NewRelic/Agent/Core/AgentHealth/AgentHealthReporter.cs

+13
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ private void ReportSupportabilityGaugeMetric(string metricName, float value)
107107
TrySend(metric);
108108
}
109109

110+
public void ReportCountMetric(string metricName, long count)
111+
{
112+
var metric = _metricBuilder.TryBuildCountMetric(metricName, count);
113+
TrySend(metric);
114+
}
115+
public void ReportByteMetric(string metricName, long totalBytes, long? exclusiveBytes = null)
116+
{
117+
var metric = _metricBuilder.TryBuildByteMetric(metricName, totalBytes, exclusiveBytes);
118+
TrySend(metric);
119+
}
120+
121+
122+
110123
public void ReportDotnetVersion()
111124
{
112125
#if NETFRAMEWORK

src/Agent/NewRelic/Agent/Core/AgentHealth/IAgentHealthReporter.cs

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public interface IAgentHealthReporter : IOutOfBandMetricSource
129129
void ReportAgentInfo();
130130

131131
void ReportSupportabilityCountMetric(string metricName, long count = 1);
132+
void ReportCountMetric(string metricName, long count = 1);
132133

133134
void ReportInfiniteTracingSpanResponseError();
134135
void ReportInfiniteTracingSpanEventsSeen(long count = 1);
@@ -148,6 +149,7 @@ public interface IAgentHealthReporter : IOutOfBandMetricSource
148149
void ReportLoggingEventsDropped(int droppedCount);
149150
void ReportLogForwardingFramework(string logFramework);
150151
void ReportLogForwardingEnabledWithFramework(string logFramework);
152+
void ReportByteMetric(string metricName, long totalBytes, long? exclusiveBytes = null);
151153
void ReportLoggingEventsEmpty(int count = 1);
152154
}
153155
}

src/Agent/NewRelic/Agent/Core/Metrics/MetricNames.cs

+18
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ public static class MetricNames
160160
public const string OtherTransactionPrefix = "OtherTransaction";
161161
public const string WebTransactionPrefix = "WebTransaction";
162162
public const string SupportabilityPayloadsDroppedDueToMaxPayloadLimitPrefix = Supportability + PathSeparator + "DotNet/Collector" + PathSeparator + "MaxPayloadSizeLimit";
163+
public const string KafkaMessageBrokerConsume = "Consume";
163164

164165
public static readonly char PathSeparatorChar = PathSeparator[0];
165166
public static readonly char[] PathSeparatorCharArray = { PathSeparatorChar };
@@ -358,6 +359,7 @@ public enum MessageBrokerAction
358359
public const string MessageBrokerNamed = "Named";
359360
public const string MessageBrokerTemp = "Temp";
360361
public const string Msmq = "MSMQ";
362+
public const string Serialization = "Serialization";
361363

362364
public static MetricName GetMessageBroker(MessageBrokerDestinationType type, MessageBrokerAction action,
363365
string vendor, string queueName)
@@ -368,6 +370,14 @@ public static MetricName GetMessageBroker(MessageBrokerDestinationType type, Mes
368370
: MetricName.Create(MessageBrokerPrefix, vendor, normalizedType, action, MessageBrokerTemp);
369371
}
370372

373+
public static MetricName GetMessageBrokerSerialization(MessageBrokerDestinationType type, MessageBrokerAction action,
374+
string vendor, string queueName, string kind)
375+
{
376+
var normalizedType = NormalizeMessageBrokerDestinationTypeForMetricName(type);
377+
return MetricName.Create(MessageBrokerPrefix, vendor, normalizedType, action, MessageBrokerNamed, queueName, Serialization, kind);
378+
379+
}
380+
371381
private static MessageBrokerDestinationType NormalizeMessageBrokerDestinationTypeForMetricName(
372382
MessageBrokerDestinationType type)
373383
{
@@ -384,6 +394,14 @@ private static MessageBrokerDestinationType NormalizeMessageBrokerDestinationTyp
384394
return type;
385395
}
386396

397+
private const string KakfaTopic = "Topic";
398+
private const string KakfaReceived = "Received";
399+
private const string KakfaMessages = "Messages";
400+
public static MetricName GetKafkaMessagesReceivedPerConsume(string topic)
401+
{
402+
return MetricName.Create(Message, "Kafka", KakfaTopic, MessageBrokerNamed, topic, KakfaReceived, KakfaMessages);
403+
}
404+
387405
#endregion MessageBroker
388406

389407
#region Datastore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright 2020 New Relic, Inc. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using NewRelic.Agent.Core.Aggregators;
7+
using NewRelic.Agent.Core.Metrics;
8+
using NewRelic.Agent.Core.Time;
9+
using static NewRelic.Agent.Core.WireModels.MetricWireModel;
10+
using NewRelic.Agent.Configuration;
11+
12+
namespace NewRelic.Agent.Core.Segments
13+
{
14+
public class MessageBrokerSerializationSegmentData : AbstractSegmentData
15+
{
16+
17+
private const string TransactionGuidSegmentParameterKey = "transaction_guid";
18+
19+
public string Vendor { get; set; }
20+
21+
public string Destination { get; set; }
22+
23+
public MetricNames.MessageBrokerDestinationType DestinationType { get; set; }
24+
25+
public MetricNames.MessageBrokerAction Action { get; set; }
26+
27+
public string Kind { get; set; }
28+
29+
30+
public MessageBrokerSerializationSegmentData(string vendor, string destination, MetricNames.MessageBrokerDestinationType destinationType, MetricNames.MessageBrokerAction action, string kind)
31+
{
32+
Vendor = vendor;
33+
Destination = destination;
34+
DestinationType = destinationType;
35+
Action = action;
36+
Kind = kind;
37+
}
38+
39+
public override bool IsCombinableWith(AbstractSegmentData otherData)
40+
{
41+
var otherTypedSegment = otherData as MessageBrokerSerializationSegmentData;
42+
if (otherTypedSegment == null)
43+
return false;
44+
45+
if (!Vendor.Equals(otherTypedSegment.Vendor))
46+
return false;
47+
48+
if (!Destination.Equals(otherTypedSegment.Destination))
49+
return false;
50+
51+
if (DestinationType != otherTypedSegment.DestinationType)
52+
return false;
53+
54+
if (Action != otherTypedSegment.Action)
55+
return false;
56+
57+
if (!Kind.Equals(otherTypedSegment.Kind))
58+
return false;
59+
60+
return true;
61+
}
62+
63+
public override string GetTransactionTraceName()
64+
{
65+
return MetricNames.GetMessageBrokerSerialization(DestinationType, Action, Vendor, Destination, Kind).ToString();
66+
}
67+
68+
public override void AddMetricStats(Segment segment, TimeSpan durationOfChildren, TransactionMetricStatsCollection txStats, IConfigurationService configService)
69+
{
70+
var duration = segment.Duration.Value;
71+
var exclusiveDuration = TimeSpanMath.Max(TimeSpan.Zero, duration - durationOfChildren);
72+
73+
MetricBuilder.TryBuildMessageBrokerSerializationSegmentMetric(Vendor, Destination, DestinationType, Action, Kind, duration, exclusiveDuration, txStats);
74+
75+
}
76+
}
77+
}

src/Agent/NewRelic/Agent/Core/Segments/NoOpSegment.cs

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public ISegmentExperimental MakeLeaf()
5050
}
5151

5252
public void RemoveSegmentFromCallStack() { }
53+
public void SetMessageBrokerDestination(string destination) { }
5354

5455
public ISegmentExperimental SetSegmentData(ISegmentData segmentData)
5556
{

src/Agent/NewRelic/Agent/Core/Segments/Segment.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,15 @@ public void RemoveSegmentFromCallStack()
210210
_transactionSegmentState.CallStackPop(this);
211211
}
212212

213+
public void SetMessageBrokerDestination(string destination)
214+
{
215+
if (SegmentData is MessageBrokerSegmentData)
216+
{
217+
var messageBrokerSegmentData = SegmentData as MessageBrokerSegmentData;
218+
messageBrokerSegmentData!.Destination = destination;
219+
}
220+
}
221+
213222
private const long NoEndTime = -1;
214223
internal static NoOpSegment NoOpSegment = new NoOpSegment();
215224
protected readonly static IEnumerable<KeyValuePair<string, object>> EmptyImmutableParameters = new KeyValuePair<string, object>[0];
@@ -410,7 +419,7 @@ public Segment CreateSimilar(TimeSpan newRelativeStartTime, TimeSpan newDuration
410419

411420
public string ToStringForFinestLogging()
412421
{
413-
return $"Id={UniqueId},ParentId={ParentUniqueId?.ToString() ?? "Root"},Name={Data.GetTransactionTraceName()},IsLeaf={IsLeaf},Combinable={Combinable},MethodCallData={MethodCallData}";
422+
return $"Id={UniqueId},ParentId={ParentUniqueId?.ToString() ?? "Root"},Name={GetTransactionTraceName()},IsLeaf={IsLeaf},Combinable={Combinable},MethodCallData={MethodCallData}";
414423
}
415424

416425
public ISegmentExperimental SetSegmentData(ISegmentData segmentData)

src/Agent/NewRelic/Agent/Core/Transactions/NoOpTransaction.cs

+13
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ public ISegment StartMessageBrokerSegment(MethodCall methodCall, MessageBrokerDe
8181
return Segment.NoOpSegment;
8282
}
8383

84+
public ISegment StartMessageBrokerSerializationSegment(MethodCall methodCall, MessageBrokerDestinationType destinationType, MessageBrokerAction operation, string brokerVendorName, string destinationName, string kind)
85+
{
86+
#if DEBUG
87+
Log.Finest("Skipping StartMessageBrokerSegment outside of a transaction");
88+
#endif
89+
return Segment.NoOpSegment;
90+
}
91+
8492
public ISegment StartMethodSegment(MethodCall methodCall, string typeName, string methodName, bool isLeaf = false)
8593
{
8694
#if DEBUG
@@ -175,6 +183,11 @@ public void SetMessageBrokerTransactionName(MessageBrokerDestinationType destina
175183

176184
}
177185

186+
public void SetKafkaMessageBrokerTransactionName(MessageBrokerDestinationType destinationType, string brokerVendorName, string destination = null, TransactionNamePriority priority = TransactionNamePriority.Uri)
187+
{
188+
189+
}
190+
178191
public void SetOtherTransactionName(string category, string name, TransactionNamePriority priority = TransactionNamePriority.Uri)
179192
{
180193

0 commit comments

Comments
 (0)