You have a distributed system made up of diferent microservices, stages and other network resoursces, all of these have some sort of monitoring and logging but there is no compelling overview.
but these are overpowered and / or overkill, take to much time to setup when you just want to know a simple status of these different componenets that you build upon.
- a simple Node Js Server
- check on network level (ping)
- check on application level (get)
- display a color code RED, GREEN or YELLOW to map 5XX error, 2XX Status and everything in between
- easy configuration for adding components that should be monitored
- ensure you have
node
installed - clone this project
cd into the directory
where you cloned this project- run
./install.sh
- edit
bubble-dash/src/stateAndHost.json
according to your needs and save
if you are coming from the former jQuery version, you need to manually transfer your hostnames like in the following picture:
- run
./launch.sh
- your standard browser should open (
http://localhost:3000
)
- docker pull grafana/grafana
- docker pull quay.io/prometheus (also clone its source code from github, you will change it a bit)
- change directory to where you cloned
- configure Prometheus to include /metrics endpoint
to configure
prometheus.yml
(see /docker/prometheus/prometheus.yml) - in your cloned prometheus project run
docker build -t bubblegum/prometheus
- ( launch
bubblegum
if it is not running already ) - start prometheus:
docker run --name prometheus --network="host" -d bubblegum/prometheus:0.0.1
- start grafana and do the initial setup
DONE!
query v {
repository(name: "bubblegum", owner: "vos-0-org") {
packages(orderBy: {direction: ASC, field: CREATED_AT}, last: 100) {
totalCount
nodes {
versions(last: 100) {
edges {
cursor
node {
id
v: version
stats: statistics{
cnt: downloadsTotalCount
}
}
}
}
}
}
}
}
this GraphQl
query run against the GitHub graphql endpoint https://graphql.github.com/graphql/proxy
will output this data.json
:
{
"data": {
"repository": {
"packages": {
"totalCount": 1,
"nodes": [
{
"versions": {
"edges": [
{
"cursor": "Y3Vyc29yOnYyOpHOAHdaEw==",
"node": {
"id": "MDE0OlBhY2thZ2VWZXJzaW9uNzgyMTg0Mw==",
"v": "0.2.0-alpha.3",
"stats": {
"cnt": 1
}
}
},
{
"cursor": "Y3Vyc29yOnYyOpHOAHdZ9A==",
"node": {
"id": "MDE0OlBhY2thZ2VWZXJzaW9uNzgyMTgxMg==",
"v": "0.2.0-alpha.2",
"stats": {
"cnt": 0
}
}
},
{
"cursor": "Y3Vyc29yOnYyOpHOAHdKNg==",
"node": {
"id": "MDE0OlBhY2thZ2VWZXJzaW9uNzgxNzc4Mg==",
"v": "0.2.0-alpha.1",
"stats": {
"cnt": 1
}
}
},
{
"cursor": "Y3Vyc29yOnYyOpHOAHdIfg==",
"node": {
"id": "MDE0OlBhY2thZ2VWZXJzaW9uNzgxNzM0Mg==",
"v": "0.1.0",
"stats": {
"cnt": 0
}
}
}
]
}
}
]
}
}
}
}
Parsing the result from above with the following jq
filter:
cat data.json | jq '.data.repository.packages.nodes[].versions.edges[].node as $node | select($node.stats.cnt == 0) | $node.id '
will provide exactly the versions of the packages that did not receive any downloads (from the statistics):
"MDE0OlBhY2thZ2VWZXJzaW9uNzgyMTg0Mw=="
"MDE0OlBhY2thZ2VWZXJzaW9uNzgxNzc4Mg=="
These are the ids that need to be provided to the aformentioned Delete Package Versions - GitHub Action.