Search in sources :

Example 16 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project instrumentation-java by census-instrumentation.

the class ZipkinExporterHandler method produceLocalEndpoint.

/**
 * Logic borrowed from brave.internal.Platform.produceLocalEndpoint
 */
static Endpoint produceLocalEndpoint(String serviceName) {
    Endpoint.Builder builder = Endpoint.newBuilder().serviceName(serviceName);
    try {
        Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
        if (nics == null) {
            return builder.build();
        }
        while (nics.hasMoreElements()) {
            NetworkInterface nic = nics.nextElement();
            Enumeration<InetAddress> addresses = nic.getInetAddresses();
            while (addresses.hasMoreElements()) {
                InetAddress address = addresses.nextElement();
                if (address.isSiteLocalAddress()) {
                    builder.ip(address);
                    break;
                }
            }
        }
    } catch (Exception e) {
        // don't crash the caller if there was a problem reading nics.
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "error reading nics", e);
        }
    }
    return builder.build();
}
Also used : Endpoint(zipkin2.Endpoint) NetworkInterface(java.net.NetworkInterface) InetAddress(java.net.InetAddress) IOException(java.io.IOException)

Example 17 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project wildfly by wildfly.

the class EJBRemoteConnectorService method start.

@Override
public void start(StartContext context) throws StartException {
    final AssociationService associationService = associationServiceInjectedValue.getValue();
    final Endpoint endpoint = endpointValue.getValue();
    Executor executor = executorService.getOptionalValue();
    if (executor != null) {
        associationService.setExecutor(executor);
    }
    RemoteEJBService remoteEJBService = RemoteEJBService.create(associationService.getAssociation(), remotingTransactionServiceInjectedValue.getValue(), classResolverFilter);
    remoteEJBService.serverUp();
    // Register an EJB channel open listener
    OpenListener channelOpenListener = remoteEJBService.getOpenListener();
    try {
        registration = endpoint.registerService(EJB_CHANNEL_NAME, channelOpenListener, this.channelCreationOptions);
    } catch (ServiceRegistrationException e) {
        throw new StartException(e);
    }
}
Also used : RemoteEJBService(org.jboss.ejb.protocol.remote.RemoteEJBService) Executor(java.util.concurrent.Executor) Endpoint(org.jboss.remoting3.Endpoint) OpenListener(org.jboss.remoting3.OpenListener) ServiceRegistrationException(org.jboss.remoting3.ServiceRegistrationException) StartException(org.jboss.msc.service.StartException)

Example 18 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin by openzipkin.

the class SelectSpansAndAnnotationsTest method processAnnotationRecord_address_skipWrongKey.

@Test
public void processAnnotationRecord_address_skipWrongKey() {
    Record4<Integer, Long, String, byte[]> annotationRecord = annotationRecord(0, null, "sr", new byte[] { 1 });
    Endpoint ep = Endpoint.newBuilder().serviceName("foo").build();
    V1Span.Builder builder = V1Span.newBuilder().traceId(1).id(1);
    SelectSpansAndAnnotations.processAnnotationRecord(annotationRecord, builder, ep);
    assertThat(builder.build().binaryAnnotations()).isEmpty();
}
Also used : Endpoint(zipkin2.Endpoint) V1Span(zipkin2.v1.V1Span) Test(org.junit.Test)

Example 19 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin by openzipkin.

the class SelectSpansAndAnnotationsTest method processAnnotationRecord_address.

@Test
public void processAnnotationRecord_address() {
    Record4<Integer, Long, String, byte[]> annotationRecord = annotationRecord(0, null, "ca", new byte[] { 1 });
    Endpoint ep = Endpoint.newBuilder().serviceName("foo").build();
    V1Span.Builder builder = V1Span.newBuilder().traceId(1).id(1);
    SelectSpansAndAnnotations.processAnnotationRecord(annotationRecord, builder, ep);
    assertThat(builder.build().binaryAnnotations().get(0)).isEqualTo(V1BinaryAnnotation.createAddress("ca", ep));
}
Also used : Endpoint(zipkin2.Endpoint) V1Span(zipkin2.v1.V1Span) Test(org.junit.Test)

Example 20 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin by openzipkin.

the class ITDependencies method notInstrumentedClientAndServer.

/**
 * This test confirms that the span store can detect dependency indicated by local and remote
 * endpoint. Specifically, this detects an uninstrumented client before the trace and an
 * uninstrumented server at the end of it.
 */
@Test
protected void notInstrumentedClientAndServer(TestInfo testInfo) throws Exception {
    String testSuffix = testSuffix(testInfo);
    String traceId = newTraceId();
    Endpoint kafka = suffixServiceName(TestObjects.KAFKA, testSuffix);
    Endpoint frontend = suffixServiceName(TestObjects.FRONTEND, testSuffix);
    Endpoint backend = suffixServiceName(TestObjects.BACKEND, testSuffix);
    Endpoint db = suffixServiceName(TestObjects.DB, testSuffix);
    List<Span> trace = asList(Span.newBuilder().traceId(traceId).id("20").name("get").timestamp(TODAY * 1000L).duration(350L * 1000L).kind(Kind.SERVER).localEndpoint(frontend).remoteEndpoint(kafka).build(), Span.newBuilder().traceId(traceId).parentId("20").id("21").name("get").timestamp((TODAY + 50L) * 1000L).duration(250L * 1000L).kind(Kind.CLIENT).localEndpoint(frontend).build(), Span.newBuilder().traceId(traceId).parentId("20").id("21").name("get").shared(true).timestamp((TODAY + 250) * 1000L).duration(50L * 1000L).kind(Kind.SERVER).localEndpoint(backend).build(), Span.newBuilder().traceId(traceId).parentId("21").id("22").name("get").timestamp((TODAY + 150L) * 1000L).duration(50L * 1000L).kind(Kind.CLIENT).localEndpoint(backend).remoteEndpoint(db).build());
    processDependencies(trace);
    assertThat(store().getDependencies(endTs(trace), DAY).execute()).containsOnly(DependencyLink.newBuilder().parent(kafka.serviceName()).child(frontend.serviceName()).callCount(1).build(), DependencyLink.newBuilder().parent(frontend.serviceName()).child(backend.serviceName()).callCount(1).build(), DependencyLink.newBuilder().parent(backend.serviceName()).child(db.serviceName()).callCount(1).build());
}
Also used : Endpoint(zipkin2.Endpoint) Span(zipkin2.Span) V1Span(zipkin2.v1.V1Span) Test(org.junit.jupiter.api.Test)

Aggregations

Endpoint (zipkin2.Endpoint)73 Span (zipkin2.Span)33 Test (org.junit.Test)28 Endpoint (org.jboss.remoting3.Endpoint)22 Test (org.junit.jupiter.api.Test)20 V1Span (zipkin2.v1.V1Span)16 NoopHealthCheckManager (com.wavefront.agent.channel.NoopHealthCheckManager)10 SpanSampler (com.wavefront.agent.sampler.SpanSampler)10 ByteBuf (io.netty.buffer.ByteBuf)10 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)10 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)10 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)10 Span (wavefront.report.Span)10 IOException (java.io.IOException)8 URI (java.net.URI)8 HashMap (java.util.HashMap)8 Annotation (wavefront.report.Annotation)8 ServiceName (org.jboss.msc.service.ServiceName)7 RateSampler (com.wavefront.sdk.entities.tracing.sampling.RateSampler)6 SaslAuthenticationFactory (org.wildfly.security.auth.server.SaslAuthenticationFactory)6