insights-results-aggregator

command module
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

Insights Results Aggregator

forthebadge made-with-go

GoDoc GitHub Pages Go Report Card Build Status Build Status codecov GitHub go.mod Go version License

Aggregator service for insights results

Description

Insights Results Aggregator is a service that provides Insight OCP data (officially called recommendations) that are being consumed by OpenShift Cluster Manager (OCM), Advanced Cluster Manager (ACM), and OCP WebConsole via Insights Operator. That data contain information about clusters status (especially health, security, performance, etc.) and recommendations based on results generated by Insights rules engine. Insights OCP data are consumed from selected broker, stored in different storages (that basically work as a cache) so we can expose it via REST API endpoints.

Documentation

Documentation is hosted on Github Pages https://redhatinsights.github.io/insights-results-aggregator/. Sources are located in docs.

Makefile targets

clean                Run go clean
build                Build binary containing service executable
build-cover          Build binary with code coverage detection support
fmt                  Run go fmt -w for all sources
lint                 Run golint
vet                  Run go vet. Report likely mistakes in source code
cyclo                Run gocyclo
ineffassign          Run ineffassign checker
shellcheck           Run shellcheck
errcheck             Run errcheck
goconst              Run goconst checker
gosec                Run gosec checker
abcgo                Run ABC metrics checker
json-check           Check all JSONs for basic syntax
style                Run all the formatting related commands (fmt, vet, lint, cyclo) + check shell scripts
run                  Build the project and executes the binary
test                 Run the unit tests
cover                Generate HTML pages with code coverage
coverage             Display code coverage on terminal
integration_tests    Run all integration tests
rest_api_tests       Run REST API tests
before_commit        Checks done before commit
help                 Show this help screen
function_list        List all functions in generated binary file

Usage

Usage:

    ./insights-results-aggregator [command]

The commands are:

    <EMPTY>             starts aggregator
    start-service       starts aggregator
    help                prints help
    print-help          prints help
    print-config        prints current configuration set by files & env variables
    print-env           prints env variables
    print-version-info  prints version info
    migration           prints information about migrations (current, latest)
    migration <version> migrates database to the specified version

BDD tests

Behaviour tests for this service are included in Insights Behavioral Spec repository. In order to run these tests, the following steps need to be made:

  1. clone the Insights Behavioral Spec repository
  2. go into the cloned subdirectory insights-behavioral-spec
  3. run the insights_results_aggregator_tests.sh from this subdirectory

List of all test scenarios prepared for this service is available at https://redhatinsights.github.io/insights-behavioral-spec/feature_list.html#insights-results-aggregator

Package manifest

Package manifest is available at docs/manifest.txt.

Documentation

Overview

Entry point to the insights results aggregator service.

The service contains consumer (usually Kafka consumer) that consumes messages from given source, processes those messages and stores them in configured data store. It also starts REST API servers with endpoints that expose several types of information: list of organizations, list of clusters for given organization, and cluster health.

Directories

Path Synopsis
Package broker contains data types, interfaces, and methods related to brokers that can be used to consume input messages by aggegator.
Package broker contains data types, interfaces, and methods related to brokers that can be used to consume input messages by aggegator.
Package conf contains definition of data type named ConfigStruct that represents configuration of Insights Results Aggregator.
Package conf contains definition of data type named ConfigStruct that represents configuration of Insights Results Aggregator.
Package consumer contains interface for any consumer that is able to process messages.
Package consumer contains interface for any consumer that is able to process messages.
Package metrics contains all metrics that needs to be exposed to Prometheus and indirectly to Grafana.
Package metrics contains all metrics that needs to be exposed to Prometheus and indirectly to Grafana.
Package migration contains an implementation of a simple database migration mechanism that allows semi-automatic transitions between various database versions as well as building the latest version of the database from scratch.
Package migration contains an implementation of a simple database migration mechanism that allows semi-automatic transitions between various database versions as well as building the latest version of the database from scratch.
Package producer contains functions that can be used to produce (that is send) messages to properly configured Kafka broker.
Package producer contains functions that can be used to produce (that is send) messages to properly configured Kafka broker.
Package server contains implementation of REST API server (HTTPServer) for the Insights results aggregator service.
Package server contains implementation of REST API server (HTTPServer) for the Insights results aggregator service.
Package storage contains an implementation of interface between Go code and (almost any) SQL database like PostgreSQL or MariaDB.
Package storage contains an implementation of interface between Go code and (almost any) SQL database like PostgreSQL or MariaDB.
Implementation of REST API tests that checks all REST API endpoints of Insights aggregator service.
Implementation of REST API tests that checks all REST API endpoints of Insights aggregator service.
rest
Package tests contains REST API tests for following endpoints:
Package tests contains REST API tests for following endpoints:
Package types contains declaration of various data types (usually structures) used elsewhere in the aggregator code.
Package types contains declaration of various data types (usually structures) used elsewhere in the aggregator code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL