use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class UtilTest method testGenerateProduceMetricsBadQueueName.
@Test
public void testGenerateProduceMetricsBadQueueName() {
MessageProduceParameters messageProduceParameters = Util.generateExternalProduceMetrics("path");
Assert.assertEquals("SQS", messageProduceParameters.getLibrary());
Assert.assertEquals("unknown", messageProduceParameters.getDestinationName());
Assert.assertEquals(DestinationType.NAMED_QUEUE, messageProduceParameters.getDestinationType());
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class SqsClient_Instrumentation method sendMessageBatch.
@Trace
public SendMessageBatchResponse sendMessageBatch(SendMessageBatchRequest sendMessageBatchRequest) {
MessageProduceParameters messageProduceParameters = Util.generateExternalProduceMetrics(sendMessageBatchRequest.queueUrl());
NewRelic.getAgent().getTracedMethod().reportAsExternal(messageProduceParameters);
return Weaver.callOriginal();
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class SqsClient_Instrumentation method sendMessage.
@Trace
public SendMessageResponse sendMessage(SendMessageRequest sendMessageRequest) {
MessageProduceParameters messageProduceParameters = Util.generateExternalProduceMetrics(sendMessageRequest.queueUrl());
NewRelic.getAgent().getTracedMethod().reportAsExternal(messageProduceParameters);
return Weaver.callOriginal();
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class SNSInstrumentationHelperTest method testTargetArnBasedMessage.
@Test
public void testTargetArnBasedMessage() throws Exception {
PublishRequest publishRequest = new PublishRequest(null, "message", "VERY IMPORTANT");
publishRequest.setTargetArn("userSpecifiedTargetArn");
MessageProduceParameters result = SNSInstrumentationHelper.makeMessageProducerParameters(publishRequest);
assertEquals("SNS", result.getLibrary());
assertEquals("userSpecifiedTargetArn", result.getDestinationName());
assertEquals(DestinationType.NAMED_TOPIC, result.getDestinationType());
}
use of com.newrelic.api.agent.MessageProduceParameters in project newrelic-java-agent by newrelic.
the class SnsClientInstrumentationHelper method startSegmentAndReportAsExternal.
public static Segment startSegmentAndReportAsExternal(PublishRequest publishRequest) {
Transaction transaction = NewRelic.getAgent().getTransaction();
Segment segment = transaction.startSegment("SNS");
MessageProduceParameters params = SnsClientInstrumentationHelper.makeMessageProducerParameters(publishRequest);
segment.reportAsExternal(params);
return segment;
}
Aggregations