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

io.airlift.tracing.Tracing Maven / Gradle / Ivy

There is a newer version: 298
Show newest version
package io.airlift.tracing;

import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.api.trace.TracerProvider;
import jakarta.annotation.Nullable;

import java.util.Optional;

public final class Tracing
{
    private Tracing() {}

    public static Tracer noopTracer()
    {
        return TracerProvider.noop().get("noop");
    }

    @Deprecated(forRemoval = true)
    public static  Attributes attribute(AttributeKey key, Optional value)
    {
        return value.map(x -> Attributes.of(key, x)).orElseGet(Attributes::empty);
    }

    @Deprecated(forRemoval = true)
    public static  Attributes attribute(AttributeKey key, @Nullable T value)
    {
        return (value != null) ? Attributes.of(key, value) : Attributes.empty();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy