public class MetricsService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
METRICS_APPLICATION_ROLE_TAG
Tag name to use to distinguish between application components.
|
static java.lang.String |
METRICS_HTTP_PORT_DEFAULT
Default por the metrics HTTP server will listen on.
|
static java.lang.String |
METRICS_HTTP_PORT_PROPERTY_NAME
Property used to configure the HTTP Metrics port.
|
static java.lang.String |
METRICS_HTTP_SERVICE_ENABLED_PROPERTY_NAME
Property used to control if the metric server is enabled (true) or disabled.
|
static java.lang.String |
METRICS_SERVICE_ENABLED_DEFAULT
Default property used to indicate if the HTTP Metric server is enabled.
|
static java.lang.String |
METRICS_SERVICE_PATH
HTTP path that metrics will be served on.
|
Constructor and Description |
---|
MetricsService()
Public default constructor.
|
Modifier and Type | Method and Description |
---|---|
MetricsService |
bindAllMetrics()
Creates the
PrometheusMeterRegistry and binds the following component metrics to
it so they are also provided when the service is scraped. |
int |
getMetricsHttpPort()
Get the metrics http port the service is running on.
|
boolean |
isMetricsHttpServiceEnabled()
Get the enabled status of this metrics service.
|
MetricsService |
setApplicationRole(java.lang.String applicationName)
Add the Application tag to the registry.
|
MetricsService |
setCommonTags() |
MetricsService |
setCommonTags(java.util.List<Tag> tagList)
Adds a list of Common Tags to the registry.
|
MetricsService |
setCommonTags(java.util.Map<java.lang.String,java.lang.String> tagMap) |
MetricsService |
setLogger(Logger logger) |
void |
setNM(com.nt.udc.nodemgr.OSANodeMgr inNM) |
boolean |
startMetricsHttpService()
Starts the ECE Prometheus metrics service endpoint which provides metrics from the ECE
application and other components using a common Prometheus registry.
|
public static final java.lang.String METRICS_SERVICE_PATH
public static final java.lang.String METRICS_HTTP_PORT_DEFAULT
public static final java.lang.String METRICS_HTTP_PORT_PROPERTY_NAME
public static final java.lang.String METRICS_SERVICE_ENABLED_DEFAULT
public static final java.lang.String METRICS_HTTP_SERVICE_ENABLED_PROPERTY_NAME
public static final java.lang.String METRICS_APPLICATION_ROLE_TAG
public MetricsService setCommonTags(java.util.List<Tag> tagList)
tagList
- List
of Tags to apply to all metrics.public MetricsService setApplicationRole(java.lang.String applicationName)
applicationName
- name of the applicationpublic MetricsService setCommonTags()
public MetricsService setCommonTags(java.util.Map<java.lang.String,java.lang.String> tagMap)
public MetricsService bindAllMetrics()
PrometheusMeterRegistry
and binds the following component metrics to
it so they are also provided when the service is scraped.
1) Coherence Metrics
2) JVM GC Metrics
3) JVM Thread Metrics
4) Processor MetricsMetricsService
instance.public boolean startMetricsHttpService()
public int getMetricsHttpPort()
public boolean isMetricsHttpServiceEnabled()
public void setNM(com.nt.udc.nodemgr.OSANodeMgr inNM)
public MetricsService setLogger(Logger logger)