Class FcMetricsExport

java.lang.Object
org.frontcache.metrics.FcMetricsExport

public class FcMetricsExport extends Object
Prometheus / OTLP export, additive alongside the SSE stream. The SSE stream stays the source of truth for the Hystrix dashboard: Micrometer's model does not carry Hystrix's event taxonomy, so choosing it INSTEAD would mean hand-writing the same JSON from a poorer data model. So FcCommandMetrics keeps producing the dashboard's numbers and this class exports the same counters through Micrometer. See proposal section 7.5.

Off by default

front-cache.metrics.export=none is the default. A node that starts a listener or an OTLP push loop merely because it was upgraded is not acceptable behaviour, and an OTLP registry with no endpoint configured would log a failure every step.

Cardinality

Series are labelled by command key and event name, and by nothing else. RequestLogger has URL-level data and labelling with it would be tempting; on a page cache the URL space is unbounded by construction, so that is a cardinality explosion rather than an observability feature.
  • Method Details

    • start

      public static void start()
      Starts the exporter if configured. Idempotent, and cheap when export is off - which is why the engine can call it unconditionally at startup.
    • stop

      public static void stop()
      Test seam - closes the registries and forgets the instance.
    • isEnabled

      public static boolean isEnabled()
    • scrape

      public static String scrape()
      Returns:
      the Prometheus text exposition, or null when Prometheus export is not enabled
    • refresh

      public static void refresh()
      Picks up commands and pools that started serving after the exporter did. Called from the scrape endpoint and before an OTLP push, so a series never goes missing just because of startup order.