Skip to content

Commit

Permalink
Merge pull request #12 from bitmaqs/8-monitoring-with-prometheus
Browse files Browse the repository at this point in the history
8 monitoring with prometheus
  • Loading branch information
bitmaqs authored Sep 8, 2024
2 parents 62b4fb4 + 8ebbe9d commit d3f652d
Show file tree
Hide file tree
Showing 5 changed files with 525 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/giropops-senhas/templates/service-giropops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ kind: Service
metadata:
name: {{ .Values.giropops.service.name }}
namespace: {{ .Values.namespace }}
labels:
app: {{ .Values.giropops.labels.app }}
spec:
selector:
app: {{ .Values.giropops.labels.app }}
ports:
- protocol: {{ .Values.giropops.service.protocol }}
port: {{ .Values.giropops.service.port }}
targetPort: {{ .Values.giropops.service.port }}
name: {{ .Values.giropops.service.portName }}
type: {{ .Values.giropops.service.type }}
1 change: 1 addition & 0 deletions charts/giropops-senhas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ giropops:
type: "ClusterIP"
port: 5000
targetPort: 5000
portName: "giropops-port"
name: "giropops-senhas"
protocol: "TCP"
resources:
Expand Down
99 changes: 99 additions & 0 deletions monitoring/grafana-alert.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"apiVersion": 1,
"groups": [
{
"orgId": 1,
"name": "1m",
"folder": "giropops",
"interval": "1m",
"rules": [
{
"uid": "bdx8i43bi8iyoc",
"title": "Giropops",
"condition": "C",
"data": [
{
"refId": "A",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "prometheus",
"model": {
"disableTextWrap": false,
"editorMode": "builder",
"expr": "kube_deployment_status_replicas{deployment=\"giropops-senhas\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": true,
"intervalMs": 1000,
"legendFormat": "__auto",
"maxDataPoints": 43200,
"range": false,
"refId": "A",
"useBackend": false
}
},
{
"refId": "C",
"relativeTimeRange": {
"from": 600,
"to": 0
},
"datasourceUid": "__expr__",
"model": {
"conditions": [
{
"evaluator": {
"params": [
4
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"C"
]
},
"reducer": {
"params": [],
"type": "last"
},
"type": "query"
}
],
"datasource": {
"type": "__expr__",
"uid": "__expr__"
},
"expression": "A",
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "C",
"type": "threshold"
}
}
],
"noDataState": "NoData",
"execErrState": "Error",
"for": "1m",
"annotations": {
"description": "",
"runbook_url": "",
"summary": "Number of replicas is High!"
},
"labels": {
"": ""
},
"isPaused": false,
"notification_settings": {
"receiver": "grafana-default-email"
}
}
]
}
]
}
Loading

0 comments on commit d3f652d

Please sign in to comment.