API Response Tracking with StreamSets, Elasticsearch, and Kibana

API Response Tracking with StreamSets, Elasticsearch, and Kibana

Overview

RESTful API JSON response data can be used to view various aspects such as pipeline configuration or monitoring information of the StreamSets Data Collector. This API response information can be used with Data Collector REST API and can be used to provide Data Collector details to a REST-based monitoring system.

In this blog, let us discuss on capturing all alerts produced by StreamSets pipelines using RESTful API, loading alerts in Elasticsearch, and visualizing alerts in Kibana.

Pre-requisites

  • Install Java 1.8
  • Install streamsets-datacollector-2.6.0.1

Use Case

Create a dataflow pipeline to capture response of RESTful API using StreamSets and to load it in Elasticsearch.

Synopsis

  • View RESTful API response data
  • Capture RESTful API response
  • Load API response in Elasticsearch
  • Visualize pipeline alerts in Kibana

Viewing RESTful API Response Data

To view RESTful API response data, perform the following:

  • Log in to StreamSets.
  • On the top right corner, click Help icon.
  • Click RESTful API.
    Different categories such as ACL, definitions, manager, preview, store, and system can be viewed.

select

  • Click manager to view API required to get alerts triggered for all the pipelines.
  • Click try it out! to get the request URL.

select

  • Check the response in UI using the below URL:
    http://<sdc_host>:/rest/v1/pipelines/alerts

select

Capturing RESTful API Response

To capture RESTful API response, perform the following:

  • Configure HTTP Client Processor by setting Resource URL as “http://<sdc_host>:/rest/v1/pipelines/alerts”, Mode as “Polling”, and Polling Interval.

select

  • Capture RESTful API response using the HTTP client processor.
  • In Pagination tab, set Pagination Mode as “Link HTTP header” and Result Field Path as “/”.

select

Loading API Response in Elasticsearch

To load API Response in Elasticsearch, perform the following:

  • Configure “Elasticsearch” processor.
  • Set Cluster HTTP URI.
  • Use the below template for Elasticsearch:
select

Visualizing Pipeline Alerts in Kibana

The alerts produced by all the pipelines can be viewed in Kibana without using StreamSets.

Number of Alerts vs Label as Attribute

select select

Number of Alerts vs Timestamp

select

Conclusion

StreamSets provides different RESTful APIs to get metrics, status, alerts, and so on. These APIs can be used with different visualization tools to visualize data and to monitor the pipelines externally.

References

247 Views 1 Views Today