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

io.opentelemetry.sdk.metrics.internal.debug.SourceInfo Maven / Gradle / Ivy

There is a newer version: 1.44.1
Show newest version
/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.sdk.metrics.internal.debug;

/**
 * An interface that can be used to record the (runtime) source of registered metrics in the sdk.
 *
 * 

This class is internal and is hence not for public use. Its APIs are unstable and can change * at any time. */ public interface SourceInfo { /** * Returns a debugging string to report where a given metric was registered. * *

Example: {@code MyFile.java:15} */ String shortDebugString(); /** * Returns a multi-line debugging string to report where a given metric was registered. * *

Example: * *

   *   at full.package.name.method MyFile.java:15
   *   at full.packae.name.otherMethod MyOtherFile.java:10
   * 
*/ String multiLineDebugString(); /** Returns a source info that asks the user to register information. */ static SourceInfo noSourceInfo() { return NoSourceInfo.INSTANCE; } /** * Constructs source information form the current stack. * *

This will attempt to ignore SDK classes. */ static SourceInfo fromCurrentStack() { if (!DebugConfig.isMetricsDebugEnabled()) { return noSourceInfo(); } return new StackTraceSourceInfo(Thread.currentThread().getStackTrace()); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy