Class JvmMemoryMetrics.Builder

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

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

    • extraTags

      public JvmMemoryMetrics.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
    • memoryUsedConvention

      public JvmMemoryMetrics.Builder memoryUsedConvention(JvmMemoryUsedMeterConvention convention)
      Custom convention for the memory used meter.
      Parameters:
      convention - the convention to use
      Returns:
      this builder
    • memoryCommittedConvention

      public JvmMemoryMetrics.Builder memoryCommittedConvention(JvmMemoryCommittedMeterConvention convention)
      Custom convention for the memory committed meter.
      Parameters:
      convention - the convention to use
      Returns:
      this builder
    • memoryMaxConvention

      public JvmMemoryMetrics.Builder memoryMaxConvention(JvmMemoryMaxMeterConvention convention)
      Custom convention for the memory max meter.
      Parameters:
      convention - the convention to use
      Returns:
      this builder
    • memoryUsedAfterLastGcConvention

      public JvmMemoryMetrics.Builder memoryUsedAfterLastGcConvention(JvmMemoryUsedAfterLastGcMeterConvention convention)
      Custom convention for the memory used after last GC meter.
      Parameters:
      convention - the convention to use
      Returns:
      this builder
    • openTelemetryConventions

      public JvmMemoryMetrics.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 JvmMemoryMetrics build()
      Build a new JvmMemoryMetrics instance.
      Returns:
      a new JvmMemoryMetrics