Search in sources :

Example 21 with Component

use of zipkin2.Component in project spring-cloud-gcp by spring-cloud.

the class LabelExtractorTests method testRpcClientBasicsTraceKeys.

@Test
public void testRpcClientBasicsTraceKeys() {
    LabelExtractor extractor = new LabelExtractor(new TraceKeys());
    String instanceId = "localhost";
    long begin = 1238912378081L;
    long end = 1238912378123L;
    Span span = Span.newBuilder().traceId("123").id("9999").timestamp(begin).duration(end - begin).putTag("http.host", "localhost").putTag("custom-tag", "hello").localEndpoint(Endpoint.newBuilder().serviceName("hello-service").build()).build();
    Map<String, String> labels = extractor.extract(span);
    Assert.assertNotNull("span shouldn't be null", span);
    Assert.assertEquals("localhost", labels.get("/http/host"));
    Assert.assertEquals("spring-cloud-gcp-trace", labels.get("/agent"));
    Assert.assertEquals("hello-service", labels.get("/component"));
    Assert.assertEquals("hello", labels.get("cloud.spring.io/custom-tag"));
}
Also used : TraceKeys(org.springframework.cloud.sleuth.TraceKeys) Span(zipkin2.Span) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 Point (java.awt.Point)5 Component (org.powerbot.script.rt6.Component)5 Span (zipkin2.Span)5 Condition (org.powerbot.script.Condition)4 Component (org.sbolstandard.core2.Component)4 ComponentDefinition (org.sbolstandard.core2.ComponentDefinition)4 CheckResult (zipkin2.CheckResult)4 SequenceAnnotation (org.sbolstandard.core2.SequenceAnnotation)3 Font (java.awt.Font)2 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Component (org.powerbot.script.rt4.Component)2 Item (org.powerbot.script.rt6.Item)2 FunctionalComponent (org.sbolstandard.core2.FunctionalComponent)2 SBOLDocument (org.sbolstandard.core2.SBOLDocument)2 Sequence (org.sbolstandard.core2.Sequence)2 Component (zipkin2.Component)2 TraceSpan (com.google.devtools.cloudtrace.v1.TraceSpan)1