Class OpenCensusMetricExporterSpi
- java.lang.Object
-
- org.apache.ignite.spi.IgniteSpiAdapter
-
- org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter
-
- org.apache.ignite.spi.metric.opencensus.OpenCensusMetricExporterSpi
-
- All Implemented Interfaces:
IgniteSpi,MetricExporterSpi
public class OpenCensusMetricExporterSpi extends org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapterOpenCensus monitoring exporter.
This class will export all Ignite metrics with the OpenCensus API.
Please, note, metrics recorded with the OpenCensus API eachPushMetricsExporterAdapter.periodmilliseconds.
To enable export from OpenCensus to the wild user should configure OpenCensus exporter. Please, see OpenCensus documentation for additional information. Example of exporter configuration:PrometheusStatsCollector.createAndRegister(); HTTPServer server = new HTTPServer("localhost", 8888, true);- See Also:
MetricRegistry,GridMetricManager,ReadOnlyMetricManager
-
-
Field Summary
Fields Modifier and Type Field Description static io.opencensus.tags.TagKeyCONSISTENT_ID_TAGIgnite node consistent id.static io.opencensus.tags.TagKeyINSTANCE_NAME_TAGIgnite instance name.static io.opencensus.tags.TagMetadataMETADATATags metadata.static io.opencensus.tags.TagKeyNODE_ID_TAGIgnite node id.-
Fields inherited from class org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter
DFLT_EXPORT_PERIOD, filter, mreg
-
Fields inherited from class org.apache.ignite.spi.IgniteSpiAdapter
ignite, igniteInstanceName, log
-
-
Constructor Summary
Constructors Constructor Description OpenCensusMetricExporterSpi()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexport()Callback to do the export of metrics info.protected voidonContextInitialized0(IgniteSpiContext spiCtx)Method to be called in the end of onContextInitialized method.voidsetSendConsistentId(boolean sendConsistentId)IftruethenCONSISTENT_ID_TAGwill be added to each exported measure.voidsetSendInstanceName(boolean sendInstanceName)IftruethenINSTANCE_NAME_TAGwill be added to each exported measure.voidsetSendNodeId(boolean sendNodeId)IftruethenNODE_ID_TAGwill be added to each exported measure.voidspiStart(@Nullable String igniteInstanceName)This method is called to start SPI.-
Methods inherited from class org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter
getPeriod, setExportFilter, setMetricRegistry, setPeriod, spiStop
-
Methods inherited from class org.apache.ignite.spi.IgniteSpiAdapter
addTimeoutObject, assertParameter, checkConfigurationConsistency0, clientFailureDetectionTimeout, configInfo, createSpiAttributeName, failureDetectionTimeout, failureDetectionTimeoutEnabled, failureDetectionTimeoutEnabled, getConsistentAttributeNames, getExceptionRegistry, getLocalNode, getName, getNodeAttributes, getSpiContext, ignite, initFailureDetectionTimeout, injectables, injectResources, isNodeStopping, onBeforeStart, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextDestroyed0, onContextInitialized, registerMBean, removeTimeoutObject, setName, started, startInfo, startStopwatch, stopInfo, unregisterMBean
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.spi.IgniteSpi
getName, getNodeAttributes, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextInitialized
-
-
-
-
Field Detail
-
INSTANCE_NAME_TAG
public static final io.opencensus.tags.TagKey INSTANCE_NAME_TAG
Ignite instance name.
-
NODE_ID_TAG
public static final io.opencensus.tags.TagKey NODE_ID_TAG
Ignite node id.
-
CONSISTENT_ID_TAG
public static final io.opencensus.tags.TagKey CONSISTENT_ID_TAG
Ignite node consistent id.
-
METADATA
public static final io.opencensus.tags.TagMetadata METADATA
Tags metadata.
-
-
Method Detail
-
export
public void export()
Callback to do the export of metrics info. Method will be called into some Ignite managed thread eachPushMetricsExporterAdapter.getPeriod()millisecond.- Specified by:
exportin classorg.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter
-
spiStart
public void spiStart(@Nullable @Nullable String igniteInstanceName) throws IgniteSpiExceptionThis method is called to start SPI. After this method returns successfully kernel assumes that SPI is fully operational.- Specified by:
spiStartin interfaceIgniteSpi- Overrides:
spiStartin classorg.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter- Parameters:
igniteInstanceName- Name of Ignite instance this SPI is being started for (nullfor default Ignite instance).- Throws:
IgniteSpiException- Throws in case of any error during SPI start.
-
onContextInitialized0
protected void onContextInitialized0(IgniteSpiContext spiCtx) throws IgniteSpiException
Method to be called in the end of onContextInitialized method.- Overrides:
onContextInitialized0in classorg.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter- Parameters:
spiCtx- SPI context.- Throws:
IgniteSpiException- In case of errors.
-
setSendInstanceName
public void setSendInstanceName(boolean sendInstanceName)
IftruethenINSTANCE_NAME_TAGwill be added to each exported measure.- Parameters:
sendInstanceName- Flag value.
-
setSendNodeId
public void setSendNodeId(boolean sendNodeId)
IftruethenNODE_ID_TAGwill be added to each exported measure.- Parameters:
sendNodeId- Flag value.
-
setSendConsistentId
public void setSendConsistentId(boolean sendConsistentId)
IftruethenCONSISTENT_ID_TAGwill be added to each exported measure.- Parameters:
sendConsistentId- Flag value.
-
-