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

io.opentelemetry.instrumentation.kafka.internal.OpenTelemetrySupplier Maven / Gradle / Ivy

The newest version!
/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.instrumentation.kafka.internal;

import io.opentelemetry.api.OpenTelemetry;
import java.io.Serializable;
import java.util.Objects;
import java.util.function.Supplier;

/**
 * Wrapper for OpenTelemetry that can be injected into kafka configuration without breaking
 * serialization. https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/7597
 *
 * 

This class is internal and is hence not for public use. Its APIs are unstable and can change * at any time. */ public final class OpenTelemetrySupplier implements Supplier, Serializable { private static final long serialVersionUID = 1L; private final transient OpenTelemetry openTelemetry; public OpenTelemetrySupplier(OpenTelemetry openTelemetry) { Objects.requireNonNull(openTelemetry); this.openTelemetry = openTelemetry; } @Override public OpenTelemetry get() { return openTelemetry; } private Object writeReplace() { // serialize this object to null return null; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy