Class ClassLoaderMetrics.Builder

java.lang.Object
io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics.Builder
Enclosing class:
ClassLoaderMetrics

public static class ClassLoaderMetrics.Builder extends Object
Builder for ClassLoaderMetrics.
Since:
1.18.0
  • Method Details

    • extraTags

      public ClassLoaderMetrics.Builder extraTags(Iterable<? extends Tag> extraTags)
      Extra tags to add to meters registered by this binder. If a conflict occurs between extra tags and convention tags, the convention tag takes precedence.
      Parameters:
      extraTags - tags to add
      Returns:
      this builder
    • classCountConvention

      public ClassLoaderMetrics.Builder classCountConvention(JvmClassCountMeterConvention convention)
      Custom convention for the current class count meter.
      Parameters:
      convention - the convention to use
      Returns:
      this builder
    • classLoadedConvention

      public ClassLoaderMetrics.Builder classLoadedConvention(JvmClassLoadedMeterConvention convention)
      Custom convention for the classes loaded (total) meter.
      Parameters:
      convention - the convention to use
      Returns:
      this builder
    • classUnloadedConvention

      public ClassLoaderMetrics.Builder classUnloadedConvention(JvmClassUnloadedMeterConvention convention)
      Custom convention for the classes unloaded meter.
      Parameters:
      convention - the convention to use
      Returns:
      this builder
    • openTelemetryConventions

      public ClassLoaderMetrics.Builder openTelemetryConventions()
      Use OpenTelemetry semantic conventions for applicable meters that have a stable semantic convention as of the version documented in the otel conventions package. Individual conventions can still be overridden by calling the specific convention methods after this one.

      In future minor releases, this method may configure additional conventions as new OpenTelemetry semantic conventions for this binder become stable. If strict metric stability across library upgrades is required, configure individual conventions explicitly instead of using this convenience method.

      Returns:
      this builder
      See Also:
    • build

      public ClassLoaderMetrics build()
      Build a new ClassLoaderMetrics instance.
      Returns:
      a new ClassLoaderMetrics