Skip to content

yogendra/api-demo

Repository files navigation

API Demo Project

Getting Started

Simple git clone, change dir and run

git clone https://github.com/yogendra/api-demo.git
cd apidemo
./mvnw spring-boot:run

Build docker image

./mvnw spring-boot:build-image

Push docker image

docker push ghcr.io/yogendra/api-demo:latest

Monitoring

Test application monitoring using local Prometheus and Grafana.

Monitoring

  • Run Prometheus locally

    docker run -d --rm\
        --add-host hostmachine:$(ipconfig getifaddr en0) \
        -p 9090:9090 \
        -v $PWD/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
        --name prometheus \
        --hostname prometheus \
        prom/prometheus \
        --config.file=/etc/prometheus/prometheus.yml
  • Run Grafana locally

    docker run --rm -d \
        --name=grafana \
        --link prometheus:prometheus \
        -v $PWD/monitoring/grafana/dashboards:/var/lib/grafana/dashboards \
        -v $PWD/monitoring/grafana/provisioning:/etc/grafana/provisioning \
        -v $PWD/monitoring/grafana/config.ini:/etc/grafana/config.ini \
        -p 3000:3000 \
        grafana/grafana 

Logging

TODO

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely: