Skip to content

Commit

Permalink
Attempt to push up changes round 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaffinito committed Jul 26, 2024
1 parent 314ae68 commit 7d37e1c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public AfterWrappedMethodDelegate BeforeWrappedMethod(InstrumentedMethodCall ins
MessageBrokerAction.Consume,
RabbitMqHelper.VendorName,
destName,
serverAddress: RabbitMqHelper.GetServerAddress(instrumentedMethodCall),
serverPort: RabbitMqHelper.GetServerPort(instrumentedMethodCall),
serverAddress: RabbitMqHelper.GetServerAddress(instrumentedMethodCall, agent),
serverPort: RabbitMqHelper.GetServerPort(instrumentedMethodCall, agent),
routingKey: queue); // no way to get routing key from BasicGet

return Delegates.GetDelegateFor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public AfterWrappedMethodDelegate BeforeWrappedMethod(InstrumentedMethodCall ins
// 3.6.0+ (5.1.0+) (IModel)void BasicPublish(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, byte[] body)

var segment = (RabbitMqHelper.GetRabbitMQVersion(instrumentedMethodCall) >= 6) ?
RabbitMqHelper.CreateSegmentForPublishWrappers6Plus(instrumentedMethodCall, transaction, BasicPropertiesIndex) :
RabbitMqHelper.CreateSegmentForPublishWrappers(instrumentedMethodCall, transaction, BasicPropertiesIndex);
RabbitMqHelper.CreateSegmentForPublishWrappers6Plus(instrumentedMethodCall, transaction, BasicPropertiesIndex, agent) :
RabbitMqHelper.CreateSegmentForPublishWrappers(instrumentedMethodCall, transaction, BasicPropertiesIndex, agent);

return Delegates.GetDelegateFor(segment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public CanWrapResponse CanWrap(InstrumentedMethodInfo methodInfo)
public AfterWrappedMethodDelegate BeforeWrappedMethod(InstrumentedMethodCall instrumentedMethodCall, IAgent agent, ITransaction transaction)
{
// 3.5.X (IModel)void BasicPublish(string exchange, string routingKey, bool mandatory, bool immediate, IBasicProperties basicProperties, byte[] body)
var segment = RabbitMqHelper.CreateSegmentForPublishWrappers(instrumentedMethodCall, transaction, BasicPropertiesIndex);
var segment = RabbitMqHelper.CreateSegmentForPublishWrappers(instrumentedMethodCall, transaction, BasicPropertiesIndex, agent);
return Delegates.GetDelegateFor(segment);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public AfterWrappedMethodDelegate BeforeWrappedMethod(InstrumentedMethodCall ins

agent.CurrentTransaction.AcceptDistributedTraceHeaders(headers, GetHeaderValue, TransportType.AMQP);

GetServerDetails(instrumentedMethodCall, out var hostname, out var port);
GetServerDetails(instrumentedMethodCall, out var hostname, out var port, agent);

var segment = transaction.StartMessageBrokerSegment(
instrumentedMethodCall.MethodCall,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public AfterWrappedMethodDelegate BeforeWrappedMethod(InstrumentedMethodCall ins
MessageBrokerAction.Purge,
RabbitMqHelper.VendorName,
destName,
serverAddress: RabbitMqHelper.GetServerAddress(instrumentedMethodCall),
serverPort: RabbitMqHelper.GetServerPort(instrumentedMethodCall));
serverAddress: RabbitMqHelper.GetServerAddress(instrumentedMethodCall, agent),
serverPort: RabbitMqHelper.GetServerPort(instrumentedMethodCall, agent));

// Routing key is not available for this method.
// It only returns uint and invocationTarget does not have the value.
Expand Down

0 comments on commit 7d37e1c

Please sign in to comment.