Class DefaultInMemoryTracer.Builder

    • Method Detail

      • withSampler

        public DefaultInMemoryTracer.Builder withSampler​(java.util.function.Predicate<java.lang.String> sampler)
        Sets the sampler.
        Parameters:
        sampler - policy which takes a traceId and returns whether the given trace should be sampled
        Returns:
        this
      • withSampler

        public DefaultInMemoryTracer.Builder withSampler​(java.util.function.BiFunction<java.lang.String,​java.lang.Boolean,​java.lang.Boolean> sampler)
        Sets the sampler.
        Parameters:
        sampler - policy which takes a traceId and the sampling flag specified in carrier (optional, could be null), and returns whether the given trace should be sampled.
        Returns:
        this
      • withMaxTagSize

        public DefaultInMemoryTracer.Builder withMaxTagSize​(int maxTagSize)
        Sets the maximum number of tags.
        Parameters:
        maxTagSize - maximum number of tags
        Returns:
        this
      • persistLogs

        public DefaultInMemoryTracer.Builder persistLogs​(boolean persistLogs)
        Sets whether logs are persisted in the span object. This is necessary when using using listeners which sends the span to a backend on span finish.
        Parameters:
        persistLogs - whether to persist logs in the span object. Defaults to false.
        Returns:
        this
      • use128BitTraceId

        public DefaultInMemoryTracer.Builder use128BitTraceId​(boolean use128BitTraceId)
        Sets whether to use 128-bit trace IDs.
        Parameters:
        use128BitTraceId - whether to use 128-bit trace IDs.
        Returns:
        this