National Dashboard Ingest Service

Overview

The objective of the national-dashboard-ingest service is listed below -

  1. To provide a one-stop framework for ingesting data regardless of the data source based on configuration.

  2. To create provision for ingesting based on module-wise requirements which directly or indirectly requires aggregated data ingestion functionality.

Pre-requisites

  1. Prior Knowledge of Java/J2EE

  2. Prior Knowledge of SpringBoot

  3. Prior Knowledge of PostgresSQL

  4. Prior Knowledge of REST APIs and related concepts like path parameters, headers, JSON etc.

  5. Prior Knowledge of ElasticSearch

Setup And Key Functionalities

Setup

Step 1: Define the index name for the module as per your requirement in module.index.mapping key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps .

Step 2: Define the allowed metrics for the module as per your requirement in module.fields.mapping key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps

Step 3: Define the allowed group-by fields for the module as per your requirement in module.allowed.groupby.fields.mapping key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps

Step 4: Define the master data index name as per your requirement in master.data.index key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps

Step 5: Define the allowed metrics for the master data index as per your requirement in master.module.fields.mapping key present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps

Step 6: Create Kafka connectors for all the modules that have been configured. A sample request for creating a trade license national dashboard Kafka connector is as follows -

Step 7: Run the national-dashboard-ingest application along with the national-dashboard-ingest-kafka-pipeline.

Definitions

  1. Config file - A YAML (xyz.yml) file which contains configuration for running national dashboard ingest.

  2. API - A REST endpoint to post data based on the configuration.

Functionality

  1. When national dashboard ingest metrics API is hit, all the data payload lookup keys are first checked against the db to determine whether they already exist or not. The db table currently being used for storing lookup keys is nss-ingest-data.

  2. If the record for a given date and area details is not present, the payload is then flattened and pushed to nss-ingest-keydata topic.

  3. National dashboard ingest kafka pipeline consumer listens on nss-ingest-keydata topic and according to the module to which the data belongs to, pushes it to the respective topic defined in the module.index.mapping key.

  4. Once the national dashboard ingest kafka pipeline pushes data to the respective topic, a kafka-connector then takes the flattened records from that topic and ingests to ElasticSearch.

Deployment Details

  1. Add configs for different modules required for National Dashboard Ingest Service and National Dashboard Kafka Pipeline service.

  2. Deploy the latest version of National Dashboard Ingest and National dashboard kafka pipeline service.

  3. Add Role-Action mapping for API’s.

Integration

Integration Scope

The national dashboard service is used to push aggregated data present in systems and persisting them onto elasticsearch on top of which dashboards are built for visualizing and analyzing data.

Integration Benefits

  • Can perform service-specific business logic without impacting the other module.

  • In the future, if we want to expose the application to citizens then it can be done easily.

Steps to Integration

  1. To integrate the host of national-dashboard-ingest-service module should be overwritten in the helm chart.

  2. national-dashboard/metric/_ingest should be added as the search endpoint for the config added.

  3. national-dashboard/masterdata/_ingest should be added as the search endpoint for the config added.

API Details

URI: The format of the ingest API to be used to ingest data using national-dashboard-ingest is as follows: national-dashboard/metric/_ingest

Body: The Body consists of 2 parts: RequestInfo and Data. Data is where the aggregated data to be ingested resides. The keys given under metrics object here are metrics provided in module.fields.mapping present in the configuration here - DIGIT-DevOps/qa.yaml at master · egovernments/DIGIT-DevOps

Example Ingest Request Body -

Index Properties & Ingest Curls (Module-wise)

The steps for creating the index and adding the index mapping for the same are available here - National Dashboard: Steps for index creation

The following section contains module-wise index names, index mapping and the ingest curls for ingesting data to national dashboard indexes.

1. Property Tax

a. Index - pt-national-dashboard

b. Index mapping -

c. Ingest curl -

2. Water and Sewerage

a. Index name - ws-national-dashboard

b. Index mapping -

c. Ingest curl -

3. Fire NOC

a. Index name - firenoc-national-dashboard

b. Index mapping -

c. Ingest curl -

4. Public Grievance Redressal

a. Index name - pgr-national-dashboard

b. Index mapping -

c. Ingest curl -

5. Trade License

a. Index name - tl-national-dashboard

b. Index mapping -

c. Ingest curl -

6. mCollect

a. Index name - mcollect-national-dashboard

b. Index mapping -

c. Ingest curl -

7. Online Building Permission System

a. Index name - obps-national-dashboard

b. Index mapping -

c. Ingest curl -

8. Common National Dashboard

a. Index name - common-national-dashboard

b. Index mapping -

c. Ingest curl -

Note: ulb, ward and region are not applicable as common-nation-dashboard data is ingested at state level. These three field values will be dummy and can be same across. The Dashboard queries does not use ward, ulb or region in Landing Page Metrics

Creative Commons LicenseAll content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.

Last updated

Was this helpful?