spring-boot-starter-prometheus-alerts

Starter for spring boot application witch catch alerts from Prometheus Alertmanager

License

License

MIT
Categories

Categories

Spring Boot Container Microservices Prometheus Application Testing & Monitoring Monitoring
GroupId

GroupId

com.github.mikesafonov
ArtifactId

ArtifactId

spring-boot-starter-prometheus-alerts
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

spring-boot-starter-prometheus-alerts
Starter for spring boot application witch catch alerts from Prometheus Alertmanager
Project URL

Project URL

https://github.com/MikeSafonov/spring-boot-starter-prometheus-alerts
Project Organization

Project Organization

com.github.mikesafonov
Source Code Management

Source Code Management

https://github.com/MikeSafonov/spring-boot-starter-prometheus-alerts

Download spring-boot-starter-prometheus-alerts

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.mikesafonov/spring-boot-starter-prometheus-alerts/ -->
<dependency>
    <groupId>com.github.mikesafonov</groupId>
    <artifactId>spring-boot-starter-prometheus-alerts</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.mikesafonov/spring-boot-starter-prometheus-alerts/
implementation 'com.github.mikesafonov:spring-boot-starter-prometheus-alerts:1.0.0'
// https://jarcasting.com/artifacts/com.github.mikesafonov/spring-boot-starter-prometheus-alerts/
implementation ("com.github.mikesafonov:spring-boot-starter-prometheus-alerts:1.0.0")
'com.github.mikesafonov:spring-boot-starter-prometheus-alerts:jar:1.0.0'
<dependency org="com.github.mikesafonov" name="spring-boot-starter-prometheus-alerts" rev="1.0.0">
  <artifact name="spring-boot-starter-prometheus-alerts" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.mikesafonov', module='spring-boot-starter-prometheus-alerts', version='1.0.0')
)
libraryDependencies += "com.github.mikesafonov" % "spring-boot-starter-prometheus-alerts" % "1.0.0"
[com.github.mikesafonov/spring-boot-starter-prometheus-alerts "1.0.0"]

Dependencies

runtime (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter jar
org.springframework.boot : spring-boot-starter-web jar
org.slf4j : slf4j-api jar

test (4)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar
org.junit.jupiter : junit-jupiter jar 5.5.1
org.mockito : mockito-core jar
org.assertj : assertj-core jar 3.13.1

Project Modules

There are no modules declared in this project.

spring-boot-starter-prometheus-alerts

Maven Central codecov Travis-CI Conventional Commits

Quality Gate Status Reliability Rating Maintainability Rating Security Rating

Bugs Code Smells Vulnerabilities

Duplicated Lines (%) Lines of Code Technical Debt

This is a starter for spring boot application witch catch alerts from Prometheus Alertmanager.

The starter is available at https://repo1.maven.org/maven2/ repository.

Using gradle:

repositories {
    maven {url "https://repo1.maven.org/maven2/"}
}
dependencies {
    implementation 'com.github.mikesafonov:spring-boot-starter-prometheus-alerts:1.0.0'
}

The only thing you need to do after adding the dependency is to create a bean with implementation of NotificationService interface:

@Serivce
public class MyNotificationService implementation NotificationService {
...
} 

Configuration

The following properties can be configured:

property description
prometheus.alertmanager.endpoint.base base url for POST request mapping for prometheus alert (default /alert)

Build

Build from source

You can build application using following command:

./gradlew clean build -x signArchives

Requirements:

JDK >= 1.8

Unit tests

You can run unit tests using following command:

./gradlew test

Alertmanager configuration

route:
  receiver: 'my-application'
receivers:
- name: 'my-application'
  webhook_configs:
    - url: http://<application-host>:<application-port>/alert

Usage example

Contributing

Feel free to contribute. New feature proposals and bug fixes should be submitted as GitHub pull requests. Fork the repository on GitHub, prepare your change on your forked copy, and submit a pull request.

IMPORTANT!

Before contributing please read about Conventional Commits / Conventional Commits RU

Versions

Version
1.0.0