Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Bridge for Eureka and Prometheus written in Kotlin

License

Notifications You must be signed in to change notification settings

adessoSE/eureka-prometheus-bridge

Repository files navigation

GitHub issues GitHub stars GitHub license

Bridge for Eureka and Prometheus.

1. General Information

1.1 Features

The bridge pulls the service-urls from eureka. It provides a config-file for prometheus which contains the services /prometheus endpoint (or any endpoint you define), so prometheus knows where to scrape for metrics.

1.2 Test it

To test the project a fully dockerized spring-boot-kotlin app is available here. More information in the Chapter "Starting the Application"

1.3 Configurable Parameters

spring.application.name=eureka-prometheus-bridge

server.port=1111

eureka.client.register-with-eureka=false

query.interval.second=60

bridge.eureka.port=8761
bridge.eureka.host=http://127.0.0.1
bridge.eureka.apipath=/eureka/apps/
bridge.eureka.showJson=false

bridge.prometheus.scrapeinterval=15 
bridge.prometheus.scrapetimeout=10 
bridge.prometheus.metricspath=/prometheus 
bridge.prometheus.scheme=http
bridge.prometheus.generatedConfigFilePath=generated-prometheus-configs/prometheus.yml
bridge.prometheus.configFileTemplatePath=src/main/resources/prometheus-basic.yml
bridge.prometheus.testConfigFilePath=src/test/resources/prometheus-test.yml

2 Starting the Application

2.1 Start the Standalone Bridge Application

  1. In the project_dir use gradlew build
  2. Run the jar under .\build\libs\eureka-prometheus-bridge-0.0.1.jar

2.2 Start the Test-Microservice-Project

As you may notice, just running the app doesnt fetch any services. So i built a spring boot project with some example-services to use.

2.3 Starting everything at once (Docker-Compose needs to be installed)

Run docker-compose up in the root-directory.

The Applications will be available:

Service url What it does
Eureka Dasboard localhost:8761 Shows you the services of the Microservice landscape
Prometheus-Server localhost:9090 Monitors the services given in the prometheus.yml config file
Test-Service 1 localhost:1001 Is a test-service with a simple endpoint /test
Test-Service 2 localhost:1002 Is a test-service with a simple endpoint /test

3 Releases and Dependency

Have a look at Bintray as new releases will be available there as a dependency for future projects.