Check out the source code with
git clone https://github.com/pbrane/PromSNMP.git
Compile and assemble the JAR file including the test suite
make
Build a Docker container image in your local registry
make oci
Start the application locally
java -jar target/promsnmp-*.jar
Start the application using Docker
docker run -it --init --rm -p "8082:8080/tcp" local/promsnmp:$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
The application exposes the following endpoints:
Endpoint | Method | Description |
---|---|---|
/promSnmp/hello |
GET | Returns a simple "Hello World" response |
/promSnmp/sample |
GET | Returns sample Prometheus metrics from static file |
/promSnmp/router |
GET | Returns router metrics from static file |
You can find in the development folder a stack with Prometheus and Grafana.
cd deployment
docker compose up -d
Endpoints:
- Grafana: http://localhost:3000, login admin, password admin
- Prometheus: http://localhost:9090
- PromSNMP: http://localhost:8080
To make a release the following steps are required:
- Set the Maven project version without -SNAPSHOT
- Make a version tag with git
- Set a new SNAPSHOT version in the main branch
- Publish a release
To help you with these steps you can run a make goal make release
.
It requires a version number you want to release.
As an example the current main branch has 0.0.2-SNAPSHOT and you want to release 0.0.2 you need to run
make release RELEASE_VERSION=0.0.2
The 0.0.2 version is set with the git tag v0.0.2. It will automatically set the main branch to 0.0.3-SNAPSHOT for the next iteration. All changes stay in your local repository. When you want to publish the new released version you need to run
git push # Push the main branch with the new -SNAPSHOT version
git push origin v0.0.2 # Push the release tag which triggers the build which publishes artifacts.