Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Grafana dashboards #940

Merged
merged 4 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions Makefile.d/k8s.mk
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,25 @@ k8s/metrics/metrics-server/delete:
kubectl delete -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

.PHONY: k8s/metrics/prometheus/deploy
## deploy prometheus and grafana
## deploy prometheus
k8s/metrics/prometheus/deploy:
kubectl apply -f k8s/metrics/prometheus
kubectl create configmap grafana-dashboards --from-file=k8s/metrics/grafana/dashboards/
kubectl apply -f k8s/metrics/grafana

.PHONY: k8s/metrics/prometheus/delete
## delete prometheus and grafana
## delete prometheus
k8s/metrics/prometheus/delete:
kubectl delete -f k8s/metrics/prometheus
kubectl delete configmap grafana-dashboards

.PHONY: k8s/metrics/grafana/deploy
## deploy grafana
k8s/metrics/grafana/deploy:
kubectl apply -f k8s/metrics/grafana/dashboards
kubectl apply -f k8s/metrics/grafana

.PHONY: k8s/metrics/grafana/delete
## delete grafana
k8s/metrics/grafana/delete:
kubectl delete -f k8s/metrics/grafana/dashboards
kubectl delete -f k8s/metrics/grafana

.PHONY: k8s/metrics/jaeger/deploy
Expand All @@ -340,6 +348,26 @@ k8s/metrics/jaeger/deploy:
k8s/metrics/jaeger/delete:
kubectl delete -f k8s/metrics/jaeger

.PHONY: k8s/metrics/loki/deploy
## deploy loki and promtail
k8s/metrics/loki/deploy:
kubectl apply -f k8s/metrics/loki

.PHONY: k8s/metrics/loki/delete
## delete loki and promtail
k8s/metrics/loki/delete:
kubectl delete -f k8s/metrics/loki

.PHONY: k8s/metrics/tempo/deploy
## deploy tempo and jaeger-agent
k8s/metrics/tempo/deploy:
kubectl apply -f k8s/metrics/tempo

.PHONY: k8s/metrics/tempo/delete
## delete tempo and jaeger-agent
k8s/metrics/tempo/delete:
kubectl delete -f k8s/metrics/tempo

.PHONY: k8s/metrics/profefe/deploy
## deploy profefe
k8s/metrics/profefe/deploy:
Expand Down
40 changes: 20 additions & 20 deletions internal/observability/metrics/agent/core/ngt/ngt.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,35 @@ func New(n service.NGT) metrics.Metric {
return &ngtMetrics{
ngt: n,
indexCount: *metrics.Int64(
metrics.ValdOrg+"/ngt/index_count",
"NGT index count",
metrics.ValdOrg+"/agent/core/ngt/index_count",
"Agent NGT index count",
metrics.UnitDimensionless),
uncommittedIndexCount: *metrics.Int64(
metrics.ValdOrg+"/ngt/uncommitted_index_count",
"NGT uncommitted index count",
metrics.ValdOrg+"/agent/core/ngt/uncommitted_index_count",
"Agent NGT uncommitted index count",
metrics.UnitDimensionless),
insertVCacheCount: *metrics.Int64(
metrics.ValdOrg+"/ngt/insert_vcache_count",
"NGT insert vcache count",
metrics.ValdOrg+"/agent/core/ngt/insert_vcache_count",
"Agent NGT insert vcache count",
metrics.UnitDimensionless),
deleteVCacheCount: *metrics.Int64(
metrics.ValdOrg+"/ngt/delete_vcache_count",
"NGT delete vcache count",
metrics.ValdOrg+"/agent/core/ngt/delete_vcache_count",
"Agent NGT delete vcache count",
metrics.UnitDimensionless),
completedCreateIndexTotal: *metrics.Int64(
metrics.ValdOrg+"/ngt/completed_create_index_total",
metrics.ValdOrg+"/agent/core/ngt/completed_create_index_total",
"the cumulative count of completed create index execution",
metrics.UnitDimensionless),
executedProactiveGCTotal: *metrics.Int64(
metrics.ValdOrg+"/ngt/executed_proactive_gc_total",
metrics.ValdOrg+"/agent/core/ngt/executed_proactive_gc_total",
"the cumulative count of proactive GC execution",
metrics.UnitDimensionless),
isIndexing: *metrics.Int64(
metrics.ValdOrg+"/ngt/is_indexing",
metrics.ValdOrg+"/agent/core/ngt/is_indexing",
"currently indexing or not",
metrics.UnitDimensionless),
isSaving: *metrics.Int64(
metrics.ValdOrg+"/ngt/is_saving",
metrics.ValdOrg+"/agent/core/ngt/is_saving",
"currently saving or not",
metrics.UnitDimensionless),
}
Expand Down Expand Up @@ -104,49 +104,49 @@ func (n *ngtMetrics) MeasurementWithTags(ctx context.Context) ([]metrics.Measure
func (n *ngtMetrics) View() []*metrics.View {
return []*metrics.View{
{
Name: "ngt_index_count",
Name: "agent_core_ngt_index_count",
Description: n.indexCount.Description(),
Measure: &n.indexCount,
Aggregation: metrics.LastValue(),
},
{
Name: "ngt_uncommitted_index_count",
Name: "agent_core_ngt_uncommitted_index_count",
Description: n.uncommittedIndexCount.Description(),
Measure: &n.uncommittedIndexCount,
Aggregation: metrics.LastValue(),
},
{
Name: "ngt_insert_vcache_count",
Name: "agent_core_ngt_insert_vcache_count",
Description: n.insertVCacheCount.Description(),
Measure: &n.insertVCacheCount,
Aggregation: metrics.LastValue(),
},
{
Name: "ngt_delete_vcache_count",
Name: "agent_core_ngt_delete_vcache_count",
Description: n.deleteVCacheCount.Description(),
Measure: &n.deleteVCacheCount,
Aggregation: metrics.LastValue(),
},
{
Name: "ngt_completed_create_index_total",
Name: "agent_core_ngt_completed_create_index_total",
Description: n.completedCreateIndexTotal.Description(),
Measure: &n.completedCreateIndexTotal,
Aggregation: metrics.LastValue(),
},
{
Name: "ngt_executed_proactive_gc_total",
Name: "agent_core_ngt_executed_proactive_gc_total",
Description: n.executedProactiveGCTotal.Description(),
Measure: &n.executedProactiveGCTotal,
Aggregation: metrics.LastValue(),
},
{
Name: "ngt_is_indexing",
Name: "agent_core_ngt_is_indexing",
Description: n.isIndexing.Description(),
Measure: &n.isIndexing,
Aggregation: metrics.LastValue(),
},
{
Name: "ngt_is_saving",
Name: "agent_core_ngt_is_saving",
Description: n.isSaving.Description(),
Measure: &n.isSaving,
Aggregation: metrics.LastValue(),
Expand Down
76 changes: 60 additions & 16 deletions k8s/metrics/grafana/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
---
#
# Copyright (C) 2019-2021 vdaas.org vald team <[email protected]>
#
Expand All @@ -23,14 +22,22 @@ data:
providers.yaml: |
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards
- name: dashboards-vald
orgId: 1
folder: Vald
type: file
disableDeletion: true
editable: false
options:
path: /var/lib/grafana/dashboards-vald
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -40,10 +47,47 @@ data:
providers.yaml: |
apiVersion: 1
datasources:
- name: 'prometheus'
type: prometheus
access: proxy
orgId: 1
url: http://prometheus.default.svc.cluster.local:9090
isDefault: true
editable: false
- name: Prometheus
type: prometheus
access: proxy
orgId: 1
uid: vald_prometheus
url: http://prometheus:9090
isDefault: true
editable: false
- name: Jaeger
type: jaeger
access: proxy
orgId: 1
uid: vald_jaeger
url: http://jaeger-query:80
isDefault: false
editable: false
- name: Loki
type: loki
access: proxy
orgId: 1
uid: vald_loki
url: http://loki:3100
isDefault: false
editable: false
jsonData:
derivedFields:
- datasourceUid: vald_jaeger
matcherRegex: '"(?:traceID|trace_id)\":"(\w+)"'
name: TraceID
url: $${__value.raw}
internalLink: true
- datasourceUid: vald_tempo
matcherRegex: '"(?:traceID|trace_id)\":"(\w+)"'
name: TraceID
url: $${__value.raw}
internalLink: true
- name: Tempo
type: tempo
access: browser
orgId: 1
uid: vald_tempo
url: http://tempo:16686
isDefault: false
editable: false
Loading