Skip to content

Commit

Permalink
[metrics] change prometheus to grafana-agent
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>

add k3d-k3s-config.yaml

Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Nov 9, 2023
1 parent 89968a9 commit 2e3bd61
Show file tree
Hide file tree
Showing 43 changed files with 105,650 additions and 9,156 deletions.
6 changes: 3 additions & 3 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ $(KUSTOMIZE): $(BINGO_DIR)/kustomize.mod
@echo "(re)installing $(GOBIN)/kustomize-v5.2.1"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kustomize.mod -o=$(GOBIN)/kustomize-v5.2.1 "sigs.k8s.io/kustomize/kustomize/v5"

MIXTOOL := $(GOBIN)/mixtool-v0.0.0-20231012051940-173803b1f00d
MIXTOOL := $(GOBIN)/mixtool-v0.0.0-20231106214329-ad41c1466f54
$(MIXTOOL): $(BINGO_DIR)/mixtool.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/mixtool-v0.0.0-20231012051940-173803b1f00d"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=mixtool.mod -o=$(GOBIN)/mixtool-v0.0.0-20231012051940-173803b1f00d "github.com/monitoring-mixins/mixtool/cmd/mixtool"
@echo "(re)installing $(GOBIN)/mixtool-v0.0.0-20231106214329-ad41c1466f54"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=mixtool.mod -o=$(GOBIN)/mixtool-v0.0.0-20231106214329-ad41c1466f54 "github.com/monitoring-mixins/mixtool/cmd/mixtool"

2 changes: 1 addition & 1 deletion .bingo/mixtool.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.20

require github.com/monitoring-mixins/mixtool v0.0.0-20231012051940-173803b1f00d // cmd/mixtool
require github.com/monitoring-mixins/mixtool v0.0.0-20231106214329-ad41c1466f54 // cmd/mixtool
12 changes: 12 additions & 0 deletions .bingo/mixtool.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand Down Expand Up @@ -197,6 +199,8 @@ github.com/grafana/dashboard-linter v0.0.0-20230815114304-3c1213ef32d9 h1:NXsChA
github.com/grafana/dashboard-linter v0.0.0-20230815114304-3c1213ef32d9/go.mod h1:4zovusCMljsbpo6ISSN/awpv+bjHhZJphYNLI1+7I74=
github.com/grafana/dashboard-linter v0.0.0-20231004202449-1a59e34df198 h1:usamkuSmV/LfB3aKi5N4dvyW62s7GRHqmCkhVbKGIV0=
github.com/grafana/dashboard-linter v0.0.0-20231004202449-1a59e34df198/go.mod h1:PtmdqZJtHPsQlZ5eLJGlbfrTPRQ0fPNuTGpCtn+UP4c=
github.com/grafana/dashboard-linter v0.0.0-20231014085532-6c322b3e955e h1:tj3TzclWdzJdQJ6L43Lh3ybCQ1OW6Qdn+xJIn/m02zg=
github.com/grafana/dashboard-linter v0.0.0-20231014085532-6c322b3e955e/go.mod h1:NmKXbgKgfPmM9RQ9b4gLsdihzxJueh6yrHYNVcsjXTE=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/grafana/tanka v0.25.0 h1:4S5ouwiXx6TDTxjLAFxhfHanJA20PfvWwMXjCOpqVQ4=
Expand Down Expand Up @@ -259,6 +263,8 @@ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPn
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
Expand All @@ -281,6 +287,8 @@ github.com/monitoring-mixins/mixtool v0.0.0-20230905112407-a9e78b0942a4 h1:oUwKc
github.com/monitoring-mixins/mixtool v0.0.0-20230905112407-a9e78b0942a4/go.mod h1:GjDPQ0hTICpVsoL6t8L3GJpWZFQGbknrrMkMNCOoRRo=
github.com/monitoring-mixins/mixtool v0.0.0-20231012051940-173803b1f00d h1:ktjRLmy5tsBOznNx88+van+bzxObkma4q4qZ1kD6eGs=
github.com/monitoring-mixins/mixtool v0.0.0-20231012051940-173803b1f00d/go.mod h1:WYFzy8QcyeXtHxyaf6h86yZ0XqswGRzeHogqQ8Jyrdg=
github.com/monitoring-mixins/mixtool v0.0.0-20231106214329-ad41c1466f54 h1:gYRxnkJdaD1R0Blu4excnPIFxUqh4+mc7OG2kmnBZ38=
github.com/monitoring-mixins/mixtool v0.0.0-20231106214329-ad41c1466f54/go.mod h1:QBrYcNkbwkWTG6nxsmXXaSD4BTvVQThpXnDKYVwfRf4=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
Expand Down Expand Up @@ -333,6 +341,8 @@ github.com/prometheus/prometheus v0.46.0 h1:9JSdXnsuT6YsbODEhSQMwxNkGwPExfmzqG73
github.com/prometheus/prometheus v0.46.0/go.mod h1:10L5IJE5CEsjee1FnOcVswYXlPIscDWWt3IJ2UDYrz4=
github.com/prometheus/prometheus v0.47.1 h1:bd2LiZyxzHn9Oo2Ei4eK2D86vz/L/OiqR1qYo0XmMBo=
github.com/prometheus/prometheus v0.47.1/go.mod h1:J/bmOSjgH7lFxz2gZhrWEZs2i64vMS+HIuZfmYNhJ/M=
github.com/prometheus/prometheus v0.47.2 h1:jWcnuQHz1o1Wu3MZ6nMJDuTI0kU5yJp9pkxh8XEkNvI=
github.com/prometheus/prometheus v0.47.2/go.mod h1:J/bmOSjgH7lFxz2gZhrWEZs2i64vMS+HIuZfmYNhJ/M=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
Expand Down Expand Up @@ -562,6 +572,8 @@ golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand Down
2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ JSONNETFMT="${GOBIN}/jsonnetfmt-v0.20.0"

KUSTOMIZE="${GOBIN}/kustomize-v5.2.1"

MIXTOOL="${GOBIN}/mixtool-v0.0.0-20231012051940-173803b1f00d"
MIXTOOL="${GOBIN}/mixtool-v0.0.0-20231106214329-ad41c1466f54"

9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,18 @@ copyright: $(COPYRIGHT) ## Add Copyright header to .go files.

##@ Kubernetes

.PHONY: k3s
k3s: ## create k3s cluster
k3d cluster create k3s-codelab --config kubernetes/k3d-k3s-config.yaml

.PHONY: clean
clean: ## clean cluster
k3d cluster delete k3s-codelab

.PHONY: manifests
manifests: $(KUSTOMIZE) ## Generates k8s manifests
$(KUSTOMIZE) build kubernetes/microservices-mode/metrics > kubernetes/microservices-mode/metrics/k8s-all-in-one.yaml
$(KUSTOMIZE) build monitoring-mixins > monitoring-mixins/k8s-all-in-one.yaml

##@ General

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
},
{
"datasource": "${datasource}",
"description": "The frequency in which the component graph gets updated.\n",
"description": "The frequency at which components get updated.\n",
"fieldConfig": {
"defaults": {
"custom": {
Expand Down Expand Up @@ -298,12 +298,12 @@
"range": true
}
],
"title": "Graph evaluation rate",
"title": "Component evaluation rate",
"type": "timeseries"
},
{
"datasource": "${datasource}",
"description": "The percentiles for how long it takes to complete a graph evaluation.\n\nGraph evaluations must complete for components to have the latest\narguments. The longer graph evaluations take, the slower it will be to\nreconcile the state of components.\n\nIf evaluation is taking too long, consider sharding your components to\ndeal with smaller amounts of data and reuse data as much as possible.\n",
"description": "The percentiles for how long it takes to complete component evaluations.\n\nComponent evaluations must complete for components to have the latest\narguments. The longer the evaluations take, the slower it will be to\nreconcile the state of components.\n\nIf evaluation is taking too long, consider sharding your components to\ndeal with smaller amounts of data and reuse data as much as possible.\n",
"fieldConfig": {
"defaults": {
"unit": "s"
Expand Down Expand Up @@ -338,12 +338,12 @@
"range": true
}
],
"title": "Graph evaluation time",
"title": "Component evaluation time",
"type": "timeseries"
},
{
"datasource": "${datasource}",
"description": "Detailed histogram view of how long graph evaluations take.\n\nThe goal is to design your config so that evaluations take as little\ntime as possible; under 100ms is a good goal.\n",
"description": "Detailed histogram view of how long component evaluations take.\n\nThe goal is to design your config so that evaluations take as little\ntime as possible; under 100ms is a good goal.\n",
"gridPos": {
"h": 10,
"w": 8,
Expand Down Expand Up @@ -386,7 +386,55 @@
"range": true
}
],
"title": "Graph evaluation histogram",
"title": "Component evaluation histogram",
"type": "heatmap"
},
{
"datasource": "${datasource}",
"description": "Detailed histogram of how long components wait to be evaluated after their dependency is updated.\n\nThe goal is to design your config so that most of the time components do not\nqueue for long; under 10ms is a good goal.\n",
"gridPos": {
"h": 10,
"w": 8,
"x": 0,
"y": 22
},
"maxDataPoints": 30,
"options": {
"calculate": false,
"color": {
"exponent": 0.5,
"fill": "dark-orange",
"mode": "scheme",
"scale": "exponential",
"scheme": "Oranges",
"steps": 65
},
"exemplars": {
"color": "rgba(255,0,255,0.7)"
},
"filterValues": {
"le": 1.0000000000000001e-09
},
"tooltip": {
"show": true,
"yHistogram": true
},
"yAxis": {
"unit": "s"
}
},
"pluginVersion": "9.0.6",
"targets": [
{
"datasource": "${datasource}",
"expr": "sum by (le) (increase(agent_component_dependencies_wait_seconds_bucket{cluster=\"$cluster\", namespace=\"$namespace\"}[$__rate_interval]))",
"format": "heatmap",
"instant": false,
"legendFormat": "{{le}}",
"range": true
}
],
"title": "Component dependency wait histogram",
"type": "heatmap"
}
],
Expand Down
6 changes: 5 additions & 1 deletion kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
TODO(qc)
# Kubernetes

``` shell
k3d cluster create k3s-codelab --config k3d-k3s-config.yaml
```
17 changes: 17 additions & 0 deletions kubernetes/k3d-k3s-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: k3d.io/v1alpha5
kind: Simple
metadata:
name: k3s-codelab
servers: 1
agents: 1
kubeAPI:
hostIP: "127.0.0.1"
hostPort: "6550"
image: rancher/k3s:v1.27.4-k3s1
ports:
- port: 8080:80
nodeFilters:
- loadbalancer
- port: 8443:443
nodeFilters:
- loadbalancer
Loading

0 comments on commit 2e3bd61

Please sign in to comment.