Uncomment the maven-dependency-plugin
plugin in pom.xml
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.plugin.version}</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
Then run the following commands in a terminal window:
mvn verify
jdeps --ignore-missing-deps -q -recursive --multi-release 21 \
--print-module-deps --class-path 'target/libs/*' target/spring-todo-app.jar
Place yourself in the root directory and run :
docker-compose up --build
You can access the following endpoints:
Application | Local Endpoint |
---|---|
Todo App | http://localhost:8080 |
Prometheus | http://localhost:9090 |
Grafana | http://localhost:300 |
Now create some requests by running:
sh scripts/load.sh
Please take a look at /scripts/flag.sh and:
sh scripts/flag.sh
Run
sh scripts/track.sh
Run
sh scripts/query.sh
rate(jdk_CPULoadmachineTotal[1m])
or rate(http_server_requests_seconds_sum{method="POST", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="GET", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="PUT", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="DELETE"}[1m])
rate(jdk_GarbageCollectionlongestPause[1m])
or rate(http_server_requests_seconds_sum{method="POST", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="GET", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="PUT", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="DELETE"}[1m])
rate(jdk_GarbageCollectionsumOfPauses[1m])
or rate(http_server_requests_seconds_sum{method="POST", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="GET", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="PUT", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="DELETE"}[1m])
rate(jdk_GCHeapSummaryheapUsed[1m])
or rate(http_server_requests_seconds_sum{method="POST", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="GET", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="PUT", uri="/api/todo"}[1m])
or rate(http_server_requests_seconds_sum{method="DELETE"}[1m])