Interface ISOMsgMetrics

All Known Implementing Classes:
ISOMsgCounter

public interface ISOMsgMetrics
Interface for ISO message metrics tracking.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Implemented by components that expose an ISOMsgMetrics instance.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default channel fields for metrics.
    static final String
    Default channel metric name.
    static final String
    Default tags for channel metrics.
    static final String
    Environment variable name for channel fields configuration.
    static final String
    Environment variable name for channel tags configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micrometer.core.instrument.Tags
    addTags(io.micrometer.core.instrument.Tags tags)
    Adds metric tags to the given Tags object.
    default io.micrometer.core.instrument.Tags
    addTags(String... tags)
    Adds metric tags from an array of strings.
    Returns the metric description.
    Returns the metric name.
    default String
    A unique meter signature, concatenating the meter name, vertical pipe, comma-separated sorted list of all tag keys that this object produces.
    Default implementation uses the values from getMetricName() and getTags().
    io.micrometer.core.instrument.MeterRegistry
    Returns the meter registry.
    default io.micrometer.core.instrument.Tags
    Returns all metric tags.
    void
    Records an ISOMsg in the meter registry.
    The metric name and tags will be taken strictly from this object's configuration.
    void
    Records an ISOMsg in the meter registry.
    Similar to recordMessage(ISOMsg) but using the metric name, description and maybe some tags taken from the MeterInfo argument.
    boolean
    register(io.micrometer.core.instrument.MeterRegistry registry)
    Register this object to work with a given MeterRegistry.
    This method may serve more than one purpose in the object's lifecycle: Assign a MeterRegistry to be used for the created meters.
    void
    Removes all registered meters.
    void
    setMetricDescription(String metricDescription)
    Sets the metric description.
    void
    setMetricName(String metricName)
    Sets the metric name.
    void
    It calls removeMeters() and clears its internal reference to its MeterRegistry.
    It will also "unfreeze" the object, making it available for reconfiguration.
  • Field Details

  • Method Details

    • setMetricName

      void setMetricName(String metricName)
      Sets the metric name.
      Parameters:
      metricName - the metric name
    • getMetricName

      Returns the metric name.
      Returns:
      the metric name
    • getMetricDescription

      Returns the metric description.
      Returns:
      the metric description
    • setMetricDescription

      void setMetricDescription(String metricDescription)
      Sets the metric description.
      Parameters:
      metricDescription - the metric description
    • addTags

      io.micrometer.core.instrument.Tags addTags(io.micrometer.core.instrument.Tags tags)
      Adds metric tags to the given Tags object.
      Parameters:
      tags - the Tags to add to
      Returns:
      the updated Tags
    • addTags

      default io.micrometer.core.instrument.Tags addTags(String... tags)
      Adds metric tags from an array of strings.
      Parameters:
      tags - the tags to add
      Returns:
      the updated Tags
    • getTags

      default io.micrometer.core.instrument.Tags getTags()
      Returns all metric tags.
      Returns:
      the metric tags
    • recordMessage

      Records an ISOMsg in the meter registry.
      The metric name and tags will be taken strictly from this object's configuration.
      If this object hasn't been successfully registered, it throws an IllegalStateException.
      Parameters:
      m - the ISOMsg to record.
      Throws:
      IllegalStateException - when this object hasn't been registered
    • recordMessage

      Records an ISOMsg in the meter registry.
      Similar to recordMessage(ISOMsg) but using the metric name, description and maybe some tags taken from the MeterInfo argument.

      If the metric for that combination of MeterInfo values and local values fails to register in the global MeterRegistry (or any underlying one like the Prometheus registry), the method may throw an IllegalStateException. This also happens if this object hasn't been successfully registered by The metric name and tags will be taken from what has been configured. If this object hasn't been successfully registered, it throws an IllegalStateException.

      Parameters:
      m - the ISO message
      meterInfo - the meter info to record
      Throws:
      IllegalStateException - if recording fails
    • register

      boolean register(io.micrometer.core.instrument.MeterRegistry registry)
      Register this object to work with a given MeterRegistry.
      This method may serve more than one purpose in the object's lifecycle:
      • Assign a MeterRegistry to be used for the created meters. (The registry can be obtained by calling getRegistry())
      • Before this object has been registered, it can be configured by setting tags, etc., but attempting to record a message (e.g. through recordMessage(ISOMsg)) will throw an IllegalStateException.
      • After it has been registered, it's ready to record messages. However, it can't be configured any longer, or it will throw an IllegalStateException. The object's configuration can be considered "frozen".
      • In some (future) implementation, it may make use of the getMetricSignature() to do some caching to ensure that every metric name has only one set of tag keys, thus avoiding metrics name+keyset collision in PrometheusMeterRegistry.
      The unregister() method should be called when done using this object.
      Parameters:
      registry - the meter registry to register with
      Returns:
      true if successful, false if there was an error
    • unregister

      void unregister()
      It calls removeMeters() and clears its internal reference to its MeterRegistry.
      It will also "unfreeze" the object, making it available for reconfiguration.
    • getRegistry

      io.micrometer.core.instrument.MeterRegistry getRegistry()
      Returns the meter registry.
      Returns:
      the MeterRegistry
    • removeMeters

      void removeMeters()
      Removes all registered meters.
    • getMetricSignature

      A unique meter signature, concatenating the meter name, vertical pipe, comma-separated sorted list of all tag keys that this object produces.
      Default implementation uses the values from getMetricName() and getTags(). A concrete implementation must make sure of gathering all the appropriate tag keys from internal config state which may include more than what's returned by getTags().
      Returns:
      The unique metric signature.