java.lang.Object
io.helidon.metrics.serviceapi.JsonFormat

public final class JsonFormat extends Object
Support for creating MicroProfile JSON responses for metrics endpoints.
  • Method Details

    • jsonData

      public static JsonObject jsonData(Registry... registries)
      Create JSON metric response for specified registries.
      Parameters:
      registries - registries to use
      Returns:
      JSON with data of metrics
    • jsonData

      public static JsonObject jsonData(Registry registry)
      JSON for a single registry.
      Parameters:
      registry - registry
      Returns:
      JSON with data of a single registry
    • jsonDataByName

      public static JsonObject jsonDataByName(Registry registry, String metricName)
      Create JSON metric response for specified metric in a specified registry.
      Parameters:
      registry - registry
      metricName - metric name
      Returns:
      JSON with data of the metric
    • jsonMeta

      public static void jsonMeta(JsonObjectBuilder builder, HelidonMetric helidonMetric, List<MetricID> metricIds)
      Update JSON metric metadata response for specified metric and its ids.
      Parameters:
      builder - JSON builder to update
      helidonMetric - metric instance
      metricIds - metric IDs
    • jsonMeta

      public static JsonObject jsonMeta(Registry... registries)
      Create JSON metric metadata response for specified registries.
      Parameters:
      registries - registries to use
      Returns:
      JSON with all metadata
    • jsonMeta

      public static JsonObject jsonMeta(Registry registry)
      Create JSON metric metadata response for a single registry.
      Parameters:
      registry - registry to use
      Returns:
      JSON with all metadata for metrics in the specified registry