Giter Site home page Giter Site logo

hawk-service's Introduction

Hawk Service

workflow

The Hawk Service is a service exposing an HTTP / REST API written in Kotlin / Spring Boot. It serves as a managing component for Hawk Core and Hawk Release managing anything about the Usage , Mapping and Field entities. Because of its stateless design, it can be horizontally scaled requiring a robust enough Postgres Database in the backend.

For API reference: SwaggerHub

Hawk Core Operate

Uses the /api/usage[/batch] endpoints for inserting Usage request and combining them into inside the database layer.

Hawk Core Monitoring (Configuration)

The Configuration Dashboard uses a variety of different endpoint to add, modify and delete Mappings / Endpoints.

Hawk Core Monitoring Grafana

The Hawk Service implements the endpoints for the Grafana JSON Plugin.

The following metrics / targets are exported:

Name Type Description
service_requests_table table Count of the requests, grouped by endpoint host.
service_initiator_requests_table table Count of requests, grouped by endpoint host and initiator host
endpoint_requests_table table Count of requests, grouped by endpoint id
endpoint_initiator_requests_table table Count of requests, grouped by endpoint id, initiator host
requests_time time-series Count of requests with optional endpoint as payload endpoint
field_requests table Count of requests by field, optional selection of fields with payload fields
field_endpoints table All endpoints in which a field is mapped with payload field
field_requests_time time-series Count of requests accumulated by selected fields passed with payload fields
endpoints variable List of tracked endpoints
fields variable List of created fields
unmapped_endpoints variable List of endpoints with no mapping

Hawk Release

When the Spring Profile flagger-canary is active and the current environment is a Kubernetes environment this services uses the Fabric8 Kubernetes Client to watch for new Flagger Canary Releases. Recent and active releases are available at the /api/release/* endpoints.

Using Micrometer and Spring Boot Actuator this service also exposes the following metrics for all services participating in an ongoing release as Prometheus Metrics:

hawk.<service-name>.count
hawk.<service-name>.mapped.count
hawk.<service-name>.unmapped.count
hawk.<service-name>.unmapped.ratio

The metrics are useful for Flagger.

Installation

For the Hawk Service to run you need to its mandatory to have a PostgreSQL Database connected. With smaller workloads Postgres itself is fine, for bigger workloads you might need some technologies like YugabyteDB. Just pass the following environment variables:

SPRING_DATASOURCE_URL=jdbc:postgresql://localhost/hawk
SPRING_DATASOURCE_USERNAME=xxxx
SPRING_DATASOURCE_PASSWORD=xxxx

Profiles can be activated using the following environment variable.

SPRING_PROFILES_ACTIVE=flagger-canary,test-data

By default, the service starts on port 8080. Pass the env SERVER_PORT to change that.

To install via. Docker run the following command and pass the environment variables after using you need:

docker run -p 8080:8080 -e ENV1=1 ENV2=2 p4skal/hawk-service

Random Usage Generation

The Service features a limited Usage generation for Test data. Activate the profile test-data for that.

hawk-service's People

Contributors

p4skal avatar siar-akbayin avatar

Stargazers

Karl Wolf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.