All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.kristofa.brave.SpanCollector Maven / Gradle / Ivy

package com.github.kristofa.brave;

import com.twitter.zipkin.gen.Span;

/**
 * Collects spans that are submitted by {@link ServerTracer} and {@link ClientTracer}. We can have implementations that
 * simply log the collected spans or implementations that persist the spans to a database, submit them to a service,...
 * 
 * @author kristof
 */
public interface SpanCollector {

    /**
     * Collect span.
     * 
     * @param span Span, should not be null.
     */
    void collect(final Span span);

    /**
     * Adds a fixed annotation that will be added to every span that is submitted to this collector.
     * 

* One use case for this is to distinguish spans from different environments or for testing reasons. * * @param key Annotation name/key. Should not be empty or null. * @param value Annotation value. Should not be null. */ void addDefaultAnnotation(final String key, final String value); /** * Closes and cleans up resources. After close has been called SpanCollector will probably not be usable anymore. */ void close(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy