Class NCPrometheusExporter
- java.lang.Object
-
- org.apache.nlpcraft.model.opencensus.NCPrometheusExporter
-
- All Implemented Interfaces:
NCLifecycle
public class NCPrometheusExporter extends Object implements NCLifecycle
Probe lifecycle component that manages OpenCensus Prometheus stats exporter. See https://opencensus.io/exporters/supported-exporters/java/prometheus/ for more details. This is a probe lifecycle component - seeNCLifecycle
for usage information.When running Prometheus you will need to supply it a configuration file. Here's an example of the minimal YAML configuration you can use to monitor both the server and the probe:
global: scrape_interval: 5s external_labels: monitor: 'nlpcraft' scrape_configs: - job_name: 'prometheus' scrape_interval: 5s static_configs: - targets: ['localhost:9090'] - job_name: 'nlpcraft-server' scrape_interval: 5s static_configs: - targets: ['localhost:8888'] - job_name: 'nlpcraft-probe' scrape_interval: 5s static_configs: - targets: ['localhost:8889']
See documentation on how to configure probe life cycle components, default values, etc.
-
-
Constructor Summary
Constructors Constructor Description NCPrometheusExporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onInit()
Called before lifecycle component is used and just after its creation.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.nlpcraft.model.NCLifecycle
onDiscard
-
-
-
-
Method Detail
-
onInit
public void onInit()
Description copied from interface:NCLifecycle
Called before lifecycle component is used and just after its creation. This method is guaranteed to be called. Default implementation is no-op.- Specified by:
onInit
in interfaceNCLifecycle
-
-