Class OpenCensusMetricExporterSpi

  • All Implemented Interfaces:
    IgniteSpi, MetricExporterSpi

    public class OpenCensusMetricExporterSpi
    extends org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter
    OpenCensus monitoring exporter.

    This class will export all Ignite metrics with the OpenCensus API.

    Please, note, metrics recorded with the OpenCensus API each PushMetricsExporterAdapter.period milliseconds.
    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 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.
    • Constructor Detail

      • OpenCensusMetricExporterSpi

        public OpenCensusMetricExporterSpi()
    • Method Detail

      • export

        public void export()
        Callback to do the export of metrics info. Method will be called into some Ignite managed thread each PushMetricsExporterAdapter.getPeriod() millisecond.
        Specified by:
        export in class org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter
      • spiStart

        public void spiStart​(@Nullable
                             @Nullable String igniteInstanceName)
                      throws IgniteSpiException
        This method is called to start SPI. After this method returns successfully kernel assumes that SPI is fully operational.
        Specified by:
        spiStart in interface IgniteSpi
        Overrides:
        spiStart in class org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter
        Parameters:
        igniteInstanceName - Name of Ignite instance this SPI is being started for (null for 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:
        onContextInitialized0 in class org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter
        Parameters:
        spiCtx - SPI context.
        Throws:
        IgniteSpiException - In case of errors.
      • setSendInstanceName

        public void setSendInstanceName​(boolean sendInstanceName)
        If true then INSTANCE_NAME_TAG will be added to each exported measure.
        Parameters:
        sendInstanceName - Flag value.
      • setSendNodeId

        public void setSendNodeId​(boolean sendNodeId)
        If true then NODE_ID_TAG will be added to each exported measure.
        Parameters:
        sendNodeId - Flag value.
      • setSendConsistentId

        public void setSendConsistentId​(boolean sendConsistentId)
        If true then CONSISTENT_ID_TAG will be added to each exported measure.
        Parameters:
        sendConsistentId - Flag value.