Interface MicrometerJobWorkerMetricsBuilder

All Known Implementing Classes:
MicrometerJobWorkerMetricsBuilderImpl

public interface MicrometerJobWorkerMetricsBuilder
Builder interface for the JobWorkerMetrics backed by Micrometer. This is an optional feature which requires you to add Micrometer to your classpath (see the installation guide for more).

This will create a JobWorkerMetrics implementation which will track the following metrics:

  • A counter for the jobs activated count
  • A counter for the jobs handled count
From these counters you can derive the rate of jobs activated, the rate of jobs handled, and subtract both to estimate the count/rate of jobs queued in a given worker.

NOTE: the names may be changed depending on the registry backing Micrometer (e.g. Prometheus names will replace the periods with underscore, etc.)

  • Method Details

    • withMeterRegistry

      MicrometerJobWorkerMetricsBuilder withMeterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
      Specifies where the worker metrics will be registered. If null, Metrics.globalRegistry is used.
      Parameters:
      meterRegistry - the meter registry to use
      Returns:
      this builder for chaining
    • withTags

      MicrometerJobWorkerMetricsBuilder withTags(Iterable<io.micrometer.core.instrument.Tag> tags)
      Tags which will be applied to all worker metrics. Can be null.
      Parameters:
      tags - the tags to apply to all metrics
      Returns:
      this builder for chaining
    • build