Search in sources :

Example 11 with OK

use of zipkin2.CheckResult.OK in project zipkin by openzipkin.

the class ScribeCollectorTest method check_failsWhenNotStarted.

@Test
void check_failsWhenNotStarted() {
    try (ScribeCollector scribe = ScribeCollector.newBuilder().storage(storage).port(0).build()) {
        CheckResult result = scribe.check();
        assertThat(result.ok()).isFalse();
        assertThat(result.error()).isInstanceOf(IllegalStateException.class);
        scribe.start();
        assertThat(scribe.check().ok()).isTrue();
    }
}
Also used : CheckResult(zipkin2.CheckResult) Test(org.junit.jupiter.api.Test)

Example 12 with OK

use of zipkin2.CheckResult.OK in project zipkin by openzipkin.

the class ITElasticsearchHealthCheck method healthyThenNotHealthyThenHealthy.

// If this flakes, uncomment in initWithHosts and log4j2.properties
@Test
public void healthyThenNotHealthyThenHealthy() {
    try (ElasticsearchStorage storage = context.getBean(ElasticsearchStorage.class)) {
        assertOk(storage.check());
        logger.info("setting server 1 and 2 unhealthy");
        server1Health.setHealthy(false);
        server2Health.setHealthy(false);
        awaitTimeout.untilAsserted(() -> assertThat(storage.check().ok()).isFalse());
        logger.info("setting server 1 healthy");
        server1Health.setHealthy(true);
        awaitTimeout.untilAsserted(() -> assertThat(storage.check().ok()).isTrue());
    }
}
Also used : ElasticsearchStorage(zipkin2.elasticsearch.ElasticsearchStorage) Test(org.junit.Test)

Example 13 with OK

use of zipkin2.CheckResult.OK in project zipkin by openzipkin.

the class SelectSpansAndAnnotations method endpoint.

static Endpoint endpoint(Record a) {
    Endpoint.Builder result = Endpoint.newBuilder().serviceName(a.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME)).port(Schema.maybeGet(a, ZIPKIN_ANNOTATIONS.ENDPOINT_PORT, (short) 0));
    int ipv4 = maybeGet(a, ZIPKIN_ANNOTATIONS.ENDPOINT_IPV4, 0);
    if (ipv4 != 0) {
        // allocation is ok here as Endpoint.ipv4Bytes would anyway
        result.parseIp(new byte[] { (byte) (ipv4 >> 24 & 0xff), (byte) (ipv4 >> 16 & 0xff), (byte) (ipv4 >> 8 & 0xff), (byte) (ipv4 & 0xff) });
    }
    result.parseIp(Schema.maybeGet(a, ZIPKIN_ANNOTATIONS.ENDPOINT_IPV6, null));
    return result.build();
}
Also used : Endpoint(zipkin2.Endpoint) Endpoint(zipkin2.Endpoint)

Aggregations

Span (zipkin2.Span)8 Test (org.junit.Test)7 Test (org.junit.jupiter.api.Test)5 Task (io.crnk.monitor.brave.mock.models.Task)3 TestSpanData (io.opentelemetry.sdk.testing.trace.TestSpanData)3 SpanData (io.opentelemetry.sdk.trace.data.SpanData)3 CheckResult (zipkin2.CheckResult)3 Endpoint (zipkin2.Endpoint)3 ElasticsearchStorage (zipkin2.elasticsearch.ElasticsearchStorage)3 QuerySpec (io.crnk.core.queryspec.QuerySpec)2 Tracing (brave.Tracing)1 HttpTracing (brave.http.HttpTracing)1 CurrentTraceContext (brave.propagation.CurrentTraceContext)1 Client (feign.Client)1 Feign (feign.Feign)1 FeignException (feign.FeignException)1 Request (feign.Request)1 RequestLine (feign.RequestLine)1 Response (feign.Response)1 FilterSpec (io.crnk.core.queryspec.FilterSpec)1