use of org.hypertrace.traceenricher.enrichment.enrichers.resolver.backend.BackendInfo in project hypertrace-ingester by hypertrace.
the class SqsBackendProviderTest method TestOtelSqsBackendResolution.
@Test
public void TestOtelSqsBackendResolution() {
String sqsConnectionString = "https://queue.amazonaws.com/80398EXAMPLE/MyQueue";
URL sqsURL;
try {
sqsURL = new URL(sqsConnectionString);
String sqsHost = sqsURL.getHost();
BackendInfo backendInfo = backendEntityEnricher.resolve(getOtelSqsBackendEvent(sqsConnectionString), structuredTrace, structuredTraceGraph).get();
Entity entity = backendInfo.getEntity();
Assertions.assertEquals(sqsHost, entity.getEntityName());
Map<String, AttributeValue> attributes = backendInfo.getAttributes();
assertEquals(Map.of("BACKEND_OPERATION", AttributeValueCreator.create("receive"), "BACKEND_DESTINATION", AttributeValueCreator.create("QueueName")), attributes);
} catch (MalformedURLException e) {
Assertions.fail("Unable to create URL for given connection string");
}
}
use of org.hypertrace.traceenricher.enrichment.enrichers.resolver.backend.BackendInfo in project hypertrace-ingester by hypertrace.
the class SqsBackendProviderTest method TestOTBackendEventResolution.
@Test
public void TestOTBackendEventResolution() {
String sqsHost = "sqs.ap-south-1.amazonaws.com";
BackendInfo entity = backendEntityEnricher.resolve(getOTSqsBackendEvent(sqsHost), structuredTrace, structuredTraceGraph).get();
Assertions.assertEquals(sqsHost, entity.getEntity().getEntityName());
}
use of org.hypertrace.traceenricher.enrichment.enrichers.resolver.backend.BackendInfo in project hypertrace-ingester by hypertrace.
the class CassandraBackendProviderTest method testBackendResolution.
@Test
public void testBackendResolution() {
BackendInfo backendInfo = backendEntityEnricher.resolve(getCassandraEvent(), structuredTrace, structuredTraceGraph).get();
Entity entity = backendInfo.getEntity();
Assertions.assertEquals("localhost:9000", entity.getEntityName());
Map<String, AttributeValue> attributes = backendInfo.getAttributes();
assertEquals(Map.of("BACKEND_OPERATION", AttributeValueCreator.create("select"), "BACKEND_DESTINATION", AttributeValueCreator.create("customer.orders")), attributes);
}
use of org.hypertrace.traceenricher.enrichment.enrichers.resolver.backend.BackendInfo in project hypertrace-ingester by hypertrace.
the class CassandraBackendProviderTest method testBackendResolutionForOTEvent.
@Test
public void testBackendResolutionForOTEvent() {
BackendInfo backendInfo = backendEntityEnricher.resolve(getCassandraOTEvent(), structuredTrace, structuredTraceGraph).get();
Entity entity = backendInfo.getEntity();
Assertions.assertEquals("localhost:9000", entity.getEntityName());
Map<String, AttributeValue> attributes = backendInfo.getAttributes();
assertEquals(Map.of("BACKEND_OPERATION", AttributeValueCreator.create("select")), attributes);
}
use of org.hypertrace.traceenricher.enrichment.enrichers.resolver.backend.BackendInfo in project hypertrace-ingester by hypertrace.
the class ElasticsearchBackendProviderTest method testBackendResolutionForOTelEvent.
@Test
public void testBackendResolutionForOTelEvent() {
BackendInfo backendInfo = backendEntityEnricher.resolve(getElasticsearchOTelEvent(), structuredTrace, structuredTraceGraph).get();
Entity entity = backendInfo.getEntity();
Assertions.assertEquals("test:2000", entity.getEntityName());
Map<String, AttributeValue> attributes = backendInfo.getAttributes();
assertEquals(Map.of("BACKEND_OPERATION", AttributeValueCreator.create("GetAction"), "BACKEND_DESTINATION", AttributeValueCreator.create("test-index")), attributes);
}
Aggregations