Class MetricRegistry

java.lang.Object
io.kestra.core.metrics.MetricRegistry

@Singleton public class MetricRegistry extends Object
  • Field Details

  • Constructor Details

    • MetricRegistry

      public MetricRegistry()
  • Method Details

    • counter

      public io.micrometer.core.instrument.Counter counter(String name, String... tags)
      Tracks a monotonically increasing value.
      Parameters:
      name - The base metric name
      tags - MUST be an even number of arguments representing key/value pairs of tags.
      Returns:
      A new or existing counter.
    • gauge

      public <T extends Number> T gauge(String name, T number, String... tags)
      Register a gauge that reports the value of the Number.
      Type Parameters:
      T - The type of the number from which the gauge value is extracted.
      Parameters:
      name - Name of the gauge being registered.
      number - Thread-safe implementation of Number used to access the value.
      tags - Sequence of dimensions for breaking down the name.
      Returns:
      The number that was passed in so the registration can be done as part of an assignment statement.
    • timer

      public io.micrometer.core.instrument.Timer timer(String name, String... tags)
      Measures the time taken for short tasks and the count of these tasks.
      Parameters:
      name - The base metric name
      tags - MUST be an even number of arguments representing key/value pairs of tags.
      Returns:
      A new or existing timer.
    • summary

      public io.micrometer.core.instrument.DistributionSummary summary(String name, String... tags)
      Measures the distribution of samples.
      Parameters:
      name - The base metric name
      tags - MUST be an even number of arguments representing key/value pairs of tags.
      Returns:
      A new or existing distribution summary.
    • tags

      public String[] tags(WorkerTask workerTask, String workerGroup, String... tags)
      Return tags for current WorkerTask. We don't include current state since it will break up the values per state which make no sense.
      Parameters:
      workerTask - the current WorkerTask
      workerGroup - the worker group, optional
      Returns:
      tags to applied to metrics
    • tags

      public String[] tags(WorkerTaskResult workerTaskResult, String... tags)
      Return tags for current WorkerTaskResult
      Parameters:
      workerTaskResult - the current WorkerTaskResult
      Returns:
      tags to applied to metrics
    • tags

      public String[] tags(Task task)
      Return tags for current Task
      Parameters:
      task - the current Task
      Returns:
      tags to applied to metrics
    • tags

      public String[] tags(Execution execution)
      Return tags for current Execution
      Parameters:
      execution - the current Execution
      Returns:
      tags to applied to metrics
    • tags

      public String[] tags(TriggerContext triggerContext, String workerGroup)
      Return tags for current TriggerContext
      Parameters:
      triggerContext - the current TriggerContext
      workerGroup - the worker group, optional
      Returns:
      tags to applied to metrics
    • tags

      public String[] tags(TriggerContext triggerContext)
      Return tags for current TriggerContext
      Parameters:
      triggerContext - the current TriggerContext
      Returns:
      tags to applied to metrics
    • tags

      public String[] tags(SchedulerExecutionWithTrigger schedulerExecutionWithTrigger, String... tags)
      Return tags for current SchedulerExecutionWithTrigger.
      Parameters:
      schedulerExecutionWithTrigger - the current SchedulerExecutionWithTrigger
      Returns:
      tags to applied to metrics
    • tags

      public io.micrometer.core.instrument.Tags tags(String... tags)
      Return globals tags
      Returns:
      tags to applied to metrics
    • bind

      public void bind(io.micrometer.core.instrument.binder.MeterBinder meterBinder)
      Attach a MeterBinder to current registry
      Parameters:
      meterBinder - the MeterBinder to bind to current registry