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

feature: addition of monitoring directive #284

Merged
merged 21 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
42706bf
initial addition of grafana and prometheus nodes
Anmol1696 Oct 16, 2023
884f31d
add prometheus ports to service, set grafana port and addr in env var…
Anmol1696 Oct 16, 2023
e0c310a
Merge branch 'main' into anmol/monitoring
Anmol1696 Oct 16, 2023
3ab0a74
remove exposer from test config
Anmol1696 Oct 16, 2023
8a9c79e
update prometheus to use static_configs for fetching metrics endpoint…
Anmol1696 Oct 17, 2023
c560890
add k8s level metrics to prometheus config
Anmol1696 Oct 17, 2023
e2fd650
add grafana dashboard for chains and tendermint dashboard
Anmol1696 Oct 18, 2023
e0ea7e4
add resources to the grafana and prometheus deployments
Anmol1696 Oct 18, 2023
9b88d74
increase default memory for monitoring deployments
Anmol1696 Oct 18, 2023
cf05040
Merge branch 'main' into anmol/monitoring
Anmol1696 Oct 18, 2023
798e593
add newline in the end
Anmol1696 Oct 18, 2023
f6509a8
fix newlines at end of file
Anmol1696 Oct 18, 2023
9bbad69
update starship cli for connecting with the monitoring ports
Anmol1696 Oct 18, 2023
4841e39
Merge branch 'main' into anmol/monitoring
Anmol1696 Oct 18, 2023
8310273
Update tests/e2e/Makefile
Anmol1696 Oct 19, 2023
c744759
Merge branch 'main' into anmol/monitoring
Anmol1696 Oct 19, 2023
4bc8369
Update charts/devnet/templates/monitoring/prometheus.yaml
Anmol1696 Oct 19, 2023
eaa1220
Update charts/devnet/templates/monitoring/prometheus.yaml
Anmol1696 Oct 19, 2023
b5e0d3f
Update charts/devnet/templates/monitoring/prometheus.yaml
Anmol1696 Oct 19, 2023
a08b6ff
Merge branch 'main' into anmol/monitoring
Anmol1696 Oct 20, 2023
5c0cf7f
Merge branch 'main' into anmol/monitoring
Anmol1696 Oct 21, 2023
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
2,277 changes: 2,277 additions & 0 deletions charts/devnet/configs/grafana-dashboards/chains.json

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion charts/devnet/templates/chains/cosmos/service.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{{ $portMap := dict "p2p" 26656 "address" 26658 "grpc" 9090 "rest" 1317 }}
{{- range $chain := .Values.chains }}
{{- if ne $chain.type "virtual" }}
{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }}

{{ $chain := include "devnet.fullchain" (dict "name" $chain.name "file" $defaultFile "context" $) | fromJson }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "devnet.chain.name" $chain.name }}-genesis
name: {{ $chain.hostname }}-genesis
labels:
app.kubernetes.io/name: {{ $chain.name }}-genesis
spec:
Expand All @@ -21,6 +24,12 @@ spec:
port: 26657
protocol: TCP
targetPort: 26657
{{- if $chain.metrics }}
- name: metrics
port: 26660
protocol: TCP
targetPort: 26660
{{- end }}
- name: exposer
port: {{ $.Values.exposer.ports.rest | default 8081 }}
protocol: TCP
Expand Down Expand Up @@ -53,6 +62,12 @@ spec:
port: 26657
protocol: TCP
targetPort: 26657
{{- if $chain.metrics }}
- name: metrics
port: 26660
protocol: TCP
targetPort: 26660
{{- end }}
- name: exposer
port: {{ $.Values.exposer.ports.rest | default 8081 }}
protocol: TCP
Expand Down
135 changes: 135 additions & 0 deletions charts/devnet/templates/monitoring/grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{{- if .Values.monitoring.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-datasources
data:
prometheus.yaml: |-
{
"apiVersion": 1,
"datasources": [
{
"access":"proxy",
"editable": true,
"name": "prometheus",
"orgId": 1,
"type": "prometheus",
"url": "http://prometheus.aws-starship.svc:9090",
"version": 1
}
]
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboard-providers
data:
default.yaml: |-
{
"apiVersion": 1,
"providers": [
{
"name": "chain-dashboard",
"orgId": 1,
"type": "file",
"allowUiUpdates": true,
"options": {
"path": "/var/lib/grafana/dashboards",
}
}
]
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboards
data:
{{- range $path, $_ := .Files.Glob "configs/grafana-dashboards/*.json" }}
{{ base $path }}: |-
{{- $.Files.Get $path | nindent 4}}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: grafana
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '8080'
spec:
clusterIP: None
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app.kubernetes.io/name: grafana
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: grafana
template:
metadata:
name: grafana
labels:
app.kubernetes.io/instance: monitoring
app.kubernetes.io/name: grafana
spec:
containers:
- name: grafana
image: grafana/grafana:latest
env:
- name: GF_SERVER_HTTP_PORT
value: "8080"
- name: GF_SERVER_HTTP_ADDR
value: "0.0.0.0"
- name: GF_AUTH_DISABLE_LOGIN_FORM
value: "true"
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_NAME
value: "Main Org."
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
value: "Editor"
ports:
- name: grafana
containerPort: 3000
resources:
{{- include "getResourceObject" $.Values.monitoring.resources | indent 12 }}
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-storage
- mountPath: /etc/grafana/provisioning/datasources
name: grafana-datasources
readOnly: false
- mountPath: /etc/grafana/provisioning/dashboards
name: grafana-dashboard-providers
readOnly: false
- mountPath: /var/lib/grafana/dashboards
name: grafana-dashboards
readOnly: false
volumes:
- name: grafana-datasources
configMap:
defaultMode: 420
name: grafana-datasources
- name: grafana-dashboard-providers
configMap:
defaultMode: 420
name: grafana-dashboard-providers
- name: grafana-dashboards
configMap:
name: grafana-dashboards
- name: grafana-storage
emptyDir: { }
---
{{- end }}
Loading
Loading