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

Improve date handling #12

Merged
merged 4 commits into from
May 7, 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
7 changes: 7 additions & 0 deletions .config/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ARG pods_csv=/dev/null
ARG grafana_version=latest
ARG grafana_image=grafana-enterprise

Expand All @@ -13,4 +14,10 @@ ENV GF_DEFAULT_APP_MODE "development"

# Inject livereload script into grafana index.html
USER root
RUN grafana-cli plugins install marcusolsson-csv-datasource

# [plugin.marcusolsson-csv-datasource]
# allow_local_mode = true
RUN echo -ne "[plugin.marcusolsson-csv-datasource]\n allow_local_mode = true\n" >> /etc/grafana/grafana.ini
COPY ${pods_csv} /tmp/pods.csv
RUN sed -i 's|</body>|<script src="http://localhost:35729/livereload.js"></script></body>|g' /usr/share/grafana/public/views/index.html
5 changes: 0 additions & 5 deletions .config/webpack/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ const config = async (env): Promise<Configuration> => {

module: {
rules: [
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
},
{
exclude: /(node_modules)/,
test: /\.[tj]sx?$/,
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ services:
args:
grafana_image: ${GRAFANA_IMAGE:-grafana-enterprise}
grafana_version: ${GRAFANA_VERSION:-10.3.3}
networks:
- grafana
ports:
- 4000:3000/tcp
external_links:
- prometheus-app:prom

volumes:
- ./dist:/var/lib/grafana/plugins/ekacnet-cubismgrafana-panel
- ./provisioning:/etc/grafana/provisioning

networks:
grafana:
name: grafanacubism-panel_default
attachable: true
48 changes: 2 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.3",
"description": "A panel to display cubism like graph in grafana",
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
"dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development",
"build": "webpack -c ./webpack.config.ts --env production",
"dev": "webpack -w -c ./webpack.config.ts --env development",
"test": "jest --watch --onlyChanged",
"test:ci": "jest --passWithNoTests --maxWorkers 4",
"typecheck": "tsc --noEmit",
Expand Down
78 changes: 78 additions & 0 deletions provisioning/dashboards/dashboard2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"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,
"id": 2,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "grafana-testdata-datasource",
"uid": "a0ce46a5-c7f8-4cec-997c-6314adf138a1"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"automaticExtents": true,
"extentMax": 10,
"extentMin": -10,
"seriesCountSize": "sm",
"showSeriesCount": false,
"text": ""
},
"targets": [
{
"datasource": {
"type": "grafana-testdata-datasource",
"uid": "a0ce46a5-c7f8-4cec-997c-6314adf138a1"
},
"max": 10,
"min": -5,
"refId": "A",
"scenarioId": "random_walk",
"seriesCount": 10
}
],
"title": "Demo single",
"type": "ekacnet-cubismgrafana-panel"
}
],
"refresh": "",
"schemaVersion": 39,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Single panel dashboard",
"uid": "f930d956-0144-49fb-87dd-9c3d4a558e03",
"version": 2,
"weekStart": ""
}
112 changes: 112 additions & 0 deletions provisioning/dashboards/dashboard3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"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,
"id": 3,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "marcusolsson-csv-datasource",
"uid": "a0ce46a5-c7f8-4cec-997c-6314adf138a2"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"automaticExtents": true,
"extentMax": 10,
"extentMin": -10,
"text": ""
},
"pluginVersion": "10.3.3",
"targets": [
{
"datasource": {
"type": "marcusolsson-csv-datasource",
"uid": "a0ce46a5-c7f8-4cec-997c-6314adf138a2"
},
"decimalSeparator": ".",
"delimiter": ",",
"header": true,
"ignoreUnknown": true,
"refId": "A",
"schema": [
{
"name": "aggregator-668c9957c7-btfgg",
"type": "number"
},
{
"name": "Time",
"type": "time"
}
],
"skipRows": 0,
"timezone": "America/Los_Angeles"
},
{
"datasource": {
"type": "marcusolsson-csv-datasource",
"uid": "a0ce46a5-c7f8-4cec-997c-6314adf138a2"
},
"decimalSeparator": ".",
"delimiter": ",",
"header": true,
"hide": false,
"ignoreUnknown": true,
"refId": "B",
"schema": [
{
"name": "Time",
"type": "time"
},
{
"name": "aggregator-7469f76bf4-ddmjm",
"type": "number"
}
],
"skipRows": 0,
"timezone": "America/Los_Angeles"
}
],
"title": "Aggregator CPU",
"type": "ekacnet-cubismgrafana-panel"
}
],
"refresh": false,
"schemaVersion": 39,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "2024-04-17T03:28:45.000Z",
"to": "2024-04-17T05:49:15.000Z"
},
"timepicker": {},
"timezone": "",
"title": "K8s PODs",
"uid": "fdc65402-092c-4a87-9dd8-6112d7909fb9",
"version": 4,
"weekStart": ""
77 changes: 77 additions & 0 deletions provisioning/dashboards/dashboard4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"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,
"id": 3,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "aaad26df-aaa4-4734-9904-74004d9a2d78"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"automaticExtents": false,
"extentMax": 50,
"extentMin": -10,
"text": ""
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "aaad26df-aaa4-4734-9904-74004d9a2d78"
},
"editorMode": "code",
"expr": "process_cpu_seconds_total",
"instant": false,
"legendFormat": "{{job}}",
"range": true,
"refId": "A"
}
],
"title": "CPU containers",
"type": "ekacnet-cubismgrafana-panel"
}
],
"refresh": "",
"schemaVersion": 39,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "2024-04-17T05:23:05.839Z",
"to": "2024-04-19T05:23:05.839Z"
},
"timepicker": {},
"timezone": "",
"title": "CPU",
"uid": "ebcbe55f-f9ab-4f92-ab37-0311a0db5043",
"version": 3,
"weekStart": ""
}
Loading
Loading