java.lang.Object
io.opentelemetry.sdk.metrics.internal.state.DebugUtils

public final class DebugUtils extends Object
Utilities for logging metric diagnostic issues.

This is a publicly accessible class purely for testing.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Constructor Details

    • DebugUtils

      private DebugUtils()
  • Method Details

    • duplicateMetricErrorMessage

      public static String duplicateMetricErrorMessage(MetricDescriptor existing, MetricDescriptor conflict)
      Creates a detailed error message comparing two MetricDescriptors.

      Called when the metrics with the descriptors have the same name, but MetricDescriptor.equals(Object) is false.

      This should identify all issues between the descriptor and log information on where they are defined. Users should be able to find/fix issues based on this error.

      Visible for testing.

      Parameters:
      existing - The already registered metric stream.
      conflict - The about-to-be registered metric stream.
      Returns:
      A multi-line debugging string.