public class PrometheusLifecycleDescriptor extends Object implements de.iip_ecosphere.platform.support.LifecycleDescriptor
| Modifier and Type | Class and Description |
|---|---|
private class |
PrometheusLifecycleDescriptor.ModifierRunnable
Processes all modification requests.
|
| Modifier and Type | Field and Description |
|---|---|
private AlertManagerImporter |
alertImporter |
static String |
ALERTMGR |
static String |
ALERTMGR_CONFIG |
static String |
ALERTMGR_VERSION |
private Process |
alertMgrProcess |
private Supplier<AlertManagerImporter> |
alertMgrSupplier |
private static boolean |
debug |
private IipEcospherePrometheusExporter |
exporter |
private Supplier<IipEcospherePrometheusExporter> |
exporterSupplier |
private Deque<ConfigModifier> |
modifierQueue |
private PrometheusLifecycleDescriptor.ModifierRunnable |
modifierRunnable |
private Supplier<ConfigModifier> |
modifierSupplier |
static String |
PROMETHEUS |
static String |
PROMETHEUS_CONFIG |
static String |
PROMETHEUS_CONFIG_INITIAL |
static String |
PROMETHEUS_VERSION |
private Process |
prometheusProcess |
private File |
prometheusWorkingDirectory |
static String |
RESOURCES |
| Constructor and Description |
|---|
PrometheusLifecycleDescriptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteWorkingFiles()
Deletes all files used in prometheus run.
|
private static List<ConfigModifier.ScrapeEndpoint> |
getDefaultScrapePoints()
Returns the default scrape points.
|
IipEcospherePrometheusExporter |
getExporter()
Returns the exporter instance.
|
private static InputStream |
getResource(String name)
Returns a resource to use.
|
Thread |
getShutdownHook() |
int |
priority() |
static void |
setDebugFlag(boolean flag)
Allows changing the debug flag.
|
void |
setExporterSupplier(Supplier<IipEcospherePrometheusExporter> supplier)
Defines the exporter supplier.
|
void |
shutdown() |
void |
startup(String[] args) |
private void |
updateConfiguration(ConfigModifier modifier,
boolean notify)
Updates the prometheus configuration.
|
public static final String PROMETHEUS
public static final String PROMETHEUS_VERSION
public static final String ALERTMGR
public static final String ALERTMGR_VERSION
public static final String PROMETHEUS_CONFIG_INITIAL
public static final String PROMETHEUS_CONFIG
public static final String ALERTMGR_CONFIG
public static final String RESOURCES
private static boolean debug
private Process prometheusProcess
private Process alertMgrProcess
private File prometheusWorkingDirectory
private IipEcospherePrometheusExporter exporter
private AlertManagerImporter alertImporter
private PrometheusLifecycleDescriptor.ModifierRunnable modifierRunnable
private Deque<ConfigModifier> modifierQueue
private Supplier<IipEcospherePrometheusExporter> exporterSupplier
private Supplier<AlertManagerImporter> alertMgrSupplier
private Supplier<ConfigModifier> modifierSupplier
private static List<ConfigModifier.ScrapeEndpoint> getDefaultScrapePoints()
public static void setDebugFlag(boolean flag)
flag - the new value of the debug flag, true with prometheus debug informationprivate void updateConfiguration(ConfigModifier modifier, boolean notify)
modifier - the modifier to usenotify - notify prometheus about the change, e.g., after initial writingprivate static InputStream getResource(String name) throws IOException
name - the name of the resourceIOException - if the resource can (finally) not be loadedpublic void startup(String[] args)
startup in interface de.iip_ecosphere.platform.support.LifecycleDescriptorpublic void setExporterSupplier(Supplier<IipEcospherePrometheusExporter> supplier)
supplier - the supplierpublic void deleteWorkingFiles()
public IipEcospherePrometheusExporter getExporter()
public void shutdown()
shutdown in interface de.iip_ecosphere.platform.support.LifecycleDescriptorpublic Thread getShutdownHook()
getShutdownHook in interface de.iip_ecosphere.platform.support.LifecycleDescriptorpublic int priority()
priority in interface de.iip_ecosphere.platform.support.LifecycleDescriptorCopyright © 2022. All rights reserved.