Class PrometheusLifecycleDescriptor
java.lang.Object
de.iip_ecosphere.platform.monitoring.prometheus.PrometheusLifecycleDescriptor
- All Implemented Interfaces:
de.iip_ecosphere.platform.support.LifecycleDescriptor
public class PrometheusLifecycleDescriptor
extends Object
implements de.iip_ecosphere.platform.support.LifecycleDescriptor
Platform lifecycle descriptor for prometheus monitoring. Unpacks and starts prometheus.
- Author:
- bettelsc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classProcesses all modification requests. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AlertManagerImporterstatic final Stringstatic final Stringstatic final Stringprivate Processprivate Supplier<AlertManagerImporter> private static booleanprivate IipEcospherePrometheusExporterprivate Supplier<IipEcospherePrometheusExporter> private Deque<ConfigModifier> private Supplier<ConfigModifier> static final Stringstatic final Stringstatic final Stringstatic final Stringprivate Processprivate Filestatic final StringFields inherited from interface de.iip_ecosphere.platform.support.LifecycleDescriptor
AAS_PRIORITY, CMD_LINE_PRIORITY, INIT_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes all files used in prometheus run.private static List<ConfigModifier.ScrapeEndpoint> Returns the default scrape points.Returns the exporter instance.private static InputStreamgetResource(String name) Returns a resource to use.intpriority()static voidsetDebugFlag(boolean flag) Allows changing the debug flag.voidDefines the exporter supplier.voidshutdown()voidprivate voidupdateConfiguration(ConfigModifier modifier, boolean notify) Updates the prometheus configuration.
-
Field Details
-
PROMETHEUS
- See Also:
-
PROMETHEUS_VERSION
- See Also:
-
ALERTMGR
- See Also:
-
ALERTMGR_VERSION
- See Also:
-
PROMETHEUS_CONFIG_INITIAL
- See Also:
-
PROMETHEUS_CONFIG
- See Also:
-
ALERTMGR_CONFIG
- See Also:
-
RESOURCES
- See Also:
-
debug
private static boolean debug -
prometheusProcess
-
alertMgrProcess
-
prometheusWorkingDirectory
-
exporter
-
alertImporter
-
modifierRunnable
-
modifierQueue
-
exporterSupplier
-
alertMgrSupplier
-
modifierSupplier
-
-
Constructor Details
-
PrometheusLifecycleDescriptor
public PrometheusLifecycleDescriptor()
-
-
Method Details
-
getDefaultScrapePoints
Returns the default scrape points.- Returns:
- the default scrape points
-
setDebugFlag
public static void setDebugFlag(boolean flag) Allows changing the debug flag. [testing, debugging]- Parameters:
flag- the new value of the debug flag,truewith prometheus debug information
-
updateConfiguration
Updates the prometheus configuration. Rules may follow.- Parameters:
modifier- the modifier to usenotify- notify prometheus about the change, e.g., after initial writing
-
getResource
Returns a resource to use.- Parameters:
name- the name of the resource- Returns:
- the resource
- Throws:
IOException- if the resource can (finally) not be loaded
-
startup
- Specified by:
startupin interfacede.iip_ecosphere.platform.support.LifecycleDescriptor
-
setExporterSupplier
Defines the exporter supplier.- Parameters:
supplier- the supplier
-
deleteWorkingFiles
public void deleteWorkingFiles()Deletes all files used in prometheus run. -
getExporter
Returns the exporter instance. [testing]- Returns:
- the exporter instance
-
shutdown
public void shutdown()- Specified by:
shutdownin interfacede.iip_ecosphere.platform.support.LifecycleDescriptor
-
getShutdownHook
- Specified by:
getShutdownHookin interfacede.iip_ecosphere.platform.support.LifecycleDescriptor
-
priority
public int priority()- Specified by:
priorityin interfacede.iip_ecosphere.platform.support.LifecycleDescriptor
-