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

Add observability chart #10

Merged
merged 7 commits into from
Apr 29, 2024
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
23 changes: 23 additions & 0 deletions charts/observability/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions charts/observability/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dependencies:
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 7.3.9
- name: loki
repository: https://grafana.github.io/helm-charts
version: 5.36.3
- name: opencost
repository: https://opencost.github.io/opencost-helm-chart
version: 1.33.3
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
version: 25.19.1
digest: sha256:17da27050d4d929132a812a2fcfc17f6efd1352f90bf05584d1accad698dbe1d
generated: "2024-04-18T13:59:29.786238+02:00"
43 changes: 43 additions & 0 deletions charts/observability/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: v2
name: observability
description: A Helm chart for medic observability
home: https://github.com/medic/helm-charts/tree/main/charts/observability


# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
dependencies:
- name: grafana
version: "7.3.*"
repository: https://grafana.github.io/helm-charts
condition: grafana.enabled
- name: loki
version: "5.36.*"
repository: https://grafana.github.io/helm-charts
condition: loki.enabled
- name: opencost
version: "1.33.*"
repository: https://opencost.github.io/opencost-helm-chart
condition: opencost.enabled
- name: prometheus
version: "25.19.*"
repository: https://prometheus-community.github.io/helm-charts
condition: prometheus.enabled
23 changes: 23 additions & 0 deletions charts/observability/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Medic Observability

## Chart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

light preference to use mermaid instead of ASCII, but not that big of a deal. If you do convert it, build it in the live editor and then paste in the resulting markdown - v. fast!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on the fence about this, mermaid if nice, but some of the consumers will be local terminal (helm show readme <chart> or locally checked out git repo) in which case I find it preferable to have plain ASCII. I vote that we keep it ASCII and reconsider mermaid if it becomes complex enough where ASCII is too limiting.


Here's an example how mermaid would look:

flowchart LR
subgraph Daemonset
NE[Node Exporter] -->|metrics| Vector
end
NL[Node Logs] -.->|logs| Vector
Opencost <-->|metrics| Prometheus
Vector -->|metrics| Prometheus
Prometheus -->|metrics| Grafana
Vector -.->|logs| Loki
Loki-.->|logs| Grafana
Loading

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cools - Thanks for explaining your desire to go wit ASCII. makes sense then!

```
┌─Map────────┐
│ │
│ ─▶ Metrics │
│ │
│ ═▷ Logs │ ┌────────┐
│ │ │Opencost│
└────────────┘ └──▲┬────┘
┌───┴▼─────┐
┌────▶Prometheus├───┐
┌ Daemonset ─ ─ ─ ─ ─ ─ ─│─ ┐ └──────────┘ │
┌─────────────┐ ┌─────┴┐ ┌───▼───┐
│ │node-exporter├──▶Vector│ │ │Grafana│
└─────────────┘ └─△───╦┘ └───△───┘
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─║─ ─║─ ┘ ┌──────────┐ ║
┌───────╩─┐ ╚════▷ Loki ╠═══╝
│Node logs│ └──────────┘
└─────────┘

```
183 changes: 183 additions & 0 deletions charts/observability/dashboards/medic/logs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"gridPos": {
"h": 15,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": false,
"showTime": false,
"sortOrder": "Descending",
"wrapLogMessage": false
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"editorMode": "builder",
"expr": "{namespace=\"$namespace\", container=~\"$container\"} | json message | line_format `{{.message}}` |~ `(?i)$search`",
"queryType": "range",
"refId": "A"
}
],
"title": "Logs",
"type": "logs"
}
],
"schemaVersion": 39,
"tags": [
"medic",
"logs"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Medic / Loki",
"value": "P0218D2AE89D0C514"
},
"hide": 0,
"includeAll": false,
"label": "Datasource",
"multi": false,
"name": "datasource",
"options": [],
"query": "loki",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": true,
"text": "kube-system",
"value": "kube-system"
},
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"definition": "",
"hide": 0,
"includeAll": false,
"label": "Namespace",
"multi": false,
"name": "namespace",
"options": [],
"query": {
"label": "namespace",
"refId": "LokiVariableQueryEditor-VariableQuery",
"stream": "",
"type": 1
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"allValue": ".*",
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"definition": "",
"hide": 0,
"includeAll": true,
"label": "Container",
"multi": true,
"name": "container",
"options": [],
"query": {
"label": "container",
"refId": "LokiVariableQueryEditor-VariableQuery",
"stream": "{namespace=\"$namespace\"}",
"type": 1
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {
"selected": false,
"text": "",
"value": ""
},
"description": "Case insensitive search of log message content",
"hide": 0,
"label": "Search",
"name": "search",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"skipUrlSync": false,
"type": "textbox"
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "Medic / Logs",
"uid": "edj073o8s7b40a",
"version": 1,
"weekStart": ""
}
Loading