Skip to content

Commit

Permalink
Merge pull request #9 from negz/prom
Browse files Browse the repository at this point in the history
Be better Prometheus citizens
  • Loading branch information
negz authored Sep 19, 2018
2 parents 16087a3 + bf3c39a commit abf028a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ metrics at `/metrics`. The following metrics exist:
```bash
$ kubectl -n kube-system exec -it ${DRAINO_POD} -- apk add curl
$ kubectl -n kube-system exec -it ${DRAINO_POD} -- curl http://localhost:10002/metrics
# HELP draino_nodes_cordoned Number of nodes cordoned.
# TYPE draino_nodes_cordoned counter
draino_nodes_cordoned{node_name="coolnode",result="succeeded"} 1
draino_nodes_cordoned{node_name="ambivalentnode",result="succeeded"} 1
draino_nodes_cordoned{node_name="lamenode",result="failed"} 1
# HELP draino_nodes_drained Number of nodes drained.
# TYPE draino_nodes_drained counter
draino_nodes_drained{node_name="coolnode",result="succeeded"} 1
draino_nodes_drained{node_name="ambivalentnode",result="failed"} 1
# HELP draino_cordoned_nodes_total Number of nodes cordoned.
# TYPE draino_cordoned_nodes_total counter
draino_cordoned_nodes_total{result="succeeded"} 2
draino_cordoned_nodes_total{result="failed"} 1
# HELP draino_drained_nodes_total Number of nodes drained.
# TYPE draino_drained_nodes_total counter
draino_drained_nodes_total{result="succeeded"} 1
draino_drained_nodes_total{result="failed"} 1
```
8 changes: 4 additions & 4 deletions cmd/draino/draino.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ func main() {

var (
nodesCordoned = &view.View{
Name: "nodes_cordoned",
Name: "cordoned_nodes_total",
Measure: kubernetes.MeasureNodesCordoned,
Description: "Number of nodes cordoned.",
Aggregation: view.Count(),
TagKeys: []tag.Key{kubernetes.TagNodeName, kubernetes.TagResult},
TagKeys: []tag.Key{kubernetes.TagResult},
}
nodesDrained = &view.View{
Name: "nodes_drained",
Name: "drained_nodes_total",
Measure: kubernetes.MeasureNodesDrained,
Description: "Number of nodes drained.",
Aggregation: view.Count(),
TagKeys: []tag.Key{kubernetes.TagNodeName, kubernetes.TagResult},
TagKeys: []tag.Key{kubernetes.TagResult},
}
)
kingpin.FatalIfError(view.Register(nodesCordoned, nodesDrained), "cannot create metrics")
Expand Down

0 comments on commit abf028a

Please sign in to comment.