Skip to content

HindujaB/siddhi-io-prometheus

 
 

Repository files navigation

Siddhi-io-prometheus

The siddhi-io-prometheus extension is an extension to Siddhi. The Prometheus-sink publishes Siddhi events as Prometheus metrics and expose them to Prometheus server. The Prometheus-source retrieves Prometheus metrics from an endpoint and send them as Siddhi events.

Prerequisites

  • Prometheus server instance should be started.
  • Prometheus Pushgateway should be started. (optional)
  • Download and copy the prometheus client jars to the {WSO2SPHome}/lib directory as follows.
    • Download the following jars from https://mvnrepository.com/artifact/io.prometheus
      • simpleclient_common-*.jar
      • simpleclient-*.jar
      • simpleclient_httpserver-*.jar
      • simpleclient_pushgateway-*.jar
    • Copy the downloaded jars into {WSO2SPHome}/lib directory.

Find some useful links below:

Latest API Docs

Latest API Docs is 1.0.0.

How to use

Using the extension in WSO2 Stream Processor

  • You can use this extension in the latest WSO2 Stream Processor that is a part of WSO2 Analytics offering, with editor, debugger and simulation support.

  • This extension is shipped by default with WSO2 Stream Processor, if you wish to use an alternative version of this extension you can replace the component jar that can be found in the <STREAM_PROCESSOR_HOME>/lib directory.

Using the extension as a java library

  • This extension can be added as a maven dependency along with other Siddhi dependencies to your project.
     <dependency>
        <groupId>org.wso2.extension.siddhi.io.prometheus</groupId>
        <artifactId>siddhi-io-prometheus</artifactId>
        <version>x.x.x</version>
     </dependency>

Jenkins Build Status


Branch Build Status
master Build Status

Features

  • prometheus (Sink)

    The sink publishes events processed by WSO2 SP into Prometheus metrics and exposes them to Prometheus server at the provided url. The created metrics can be published to Prometheus through 'server' or 'pushGateway' publishing modes depending on the preference of the user. The server mode exposes the metrics through an http server at the provided url and the pushGateway mode pushes the metrics to pushGateway which must be running at the provided url.
     The metric types that are supported by Prometheus sink are counter, gauge, histogram and summary. The values and labels of the Prometheus metrics can be updated through the events.

  • prometheus (Source)

    The source consumes Prometheus metrics which are exported from the specified url as Siddhi events, by making http requests to the url. According to the source configuration, it analyses metrics from the text response and sends them as Siddhi events through key-value mapping.The user can retrieve metrics of types including, counter, gauge, histogram and summary. Since the source retrieves the metrics from a text response of the target, it is advised to use 'string' as the attribute type for the attributes that correspond to Prometheus metric labels. Further, the Prometheus metric value is passed through the event as 'value'. Therefore, it is advisable to have an attribute with the name 'value' in the stream.
    The supported types for the attribute, 'value' are INT, LONG, FLOAT and DOUBLE.

How to contribute

Running Integration tests in docker containers (Optional)

  • The prometheus sink can be tested with the docker base integration test framework. The test framework initialize a docker container with required configuration before execute the test suit.

    To start integration tests,

    1. Install and run docker

    2. To run the integration tests,

      • navigate to the siddhi-io-prometheus/ directory and issue the following command.
        mvn verify -P local-prometheus
        
  • Prometheus target configurations can be modified at the directory for integration tests :

    siddhi-io-prometheus/component/src/test/resources/prometheus/prometheus.yml

Contact us

Support

  • We are committed to ensuring support for this extension in production. Our unique approach ensures that all support leverages our open development methodology and is provided by the very same engineers who build the technology.

  • For more details and to take advantage of this unique opportunity contact us via http://wso2.com/support/.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%