Class IipEcospherePrometheusExporter

java.lang.Object
de.iip_ecosphere.platform.monitoring.MonitoringReceiver
de.iip_ecosphere.platform.monitoring.prometheus.IipEcospherePrometheusExporter

public class IipEcospherePrometheusExporter extends de.iip_ecosphere.platform.monitoring.MonitoringReceiver
Observes IIP-Ecosphere standard transport channels and feeds the information into Prometheus. [public for testing]
Author:
Holger Eichelberger, SSE
  • Field Details

    • DEFAULT_METRICS_SERVLET_NAME

      public static final String DEFAULT_METRICS_SERVLET_NAME
      See Also:
    • DEFAULT_METRICS_ENDPOINT

      public static final String DEFAULT_METRICS_ENDPOINT
      See Also:
    • METER_FILTERS

      private static final io.micrometer.core.instrument.config.MeterFilter[] METER_FILTERS
    • server

      private org.apache.catalina.startup.Tomcat server
    • context

      private org.apache.catalina.Context context
    • modifier

      private Supplier<ConfigModifier> modifier
    • port

      private int port
    • webapps

      private File webapps
  • Constructor Details

  • Method Details

    • setModifierSupplier

      public void setModifierSupplier(Supplier<ConfigModifier> modifier)
      Defines the modifier supplier.
      Parameters:
      modifier - the modifier supplier
    • start

      public void start()
      Overrides:
      start in class de.iip_ecosphere.platform.monitoring.MonitoringReceiver
    • stop

      public void stop()
      Overrides:
      stop in class de.iip_ecosphere.platform.monitoring.MonitoringReceiver
    • addServlet

      protected String addServlet(String id, javax.servlet.Servlet servlet)
      Adds a servlet to the tomcat instance. Tomcat must at least be initialized:
      Parameters:
      id - the id of the servlet, also used for the path
      servlet - the servlet instance
      Returns:
      the path to the servlet
    • getPath

      private String getPath(String id)
      Returns the servlet mapping path.
      Parameters:
      id - the servlet id
      Returns:
      the mapping path
    • removeServlet

      protected void removeServlet(String id)
      Removes the given servlet from the server container.
      Parameters:
      id - the servlet id
    • createExporter

      protected de.iip_ecosphere.platform.monitoring.MonitoringReceiver.Exporter createExporter(String id)
      Specified by:
      createExporter in class de.iip_ecosphere.platform.monitoring.MonitoringReceiver
    • notifyExporterAdded

      protected void notifyExporterAdded(de.iip_ecosphere.platform.monitoring.MonitoringReceiver.Exporter exporter)
      Overrides:
      notifyExporterAdded in class de.iip_ecosphere.platform.monitoring.MonitoringReceiver
    • notifyExporterRemoved

      protected void notifyExporterRemoved(de.iip_ecosphere.platform.monitoring.MonitoringReceiver.Exporter exporter)
      Overrides:
      notifyExporterRemoved in class de.iip_ecosphere.platform.monitoring.MonitoringReceiver
    • writeScrapeConfig

      private void writeScrapeConfig()
      Changes the prometheus configuration for modified scrape setup.