GithubHelp home page GithubHelp logo

Comments (9)

pb82 avatar pb82 commented on May 18, 2024 2

@itewk The problem lies somewhere with the grafana sdk. I'm currently working on removing it and just sending the raw json (after some validation). That seems to be working and the gauge in your example renders exactly the same operator imported vs. directly imported.

from grafana-operator.

itewk avatar itewk commented on May 18, 2024

example dashboard I can reproduce with

{
  "__inputs": [
    {
      "name": "DS_OPENSHIFT_PROMETHEUS",
      "label": "openshift-prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.5.2"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1576850855482,
  "links": [],
  "panels": [
    {
      "datasource": "${DS_OPENSHIFT_PROMETHEUS}",
      "gridPos": {
        "h": 5,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "fieldOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "defaults": {
            "links": [],
            "mappings": [
              {
                "from": "",
                "id": 1,
                "operator": "",
                "text": "",
                "to": "",
                "type": 1,
                "value": ""
              }
            ],
            "max": 1,
            "min": 0,
            "thresholds": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 0.85
              }
            ],
            "title": "",
            "unit": "percentunit"
          },
          "override": {},
          "values": false
        },
        "orientation": "horizontal",
        "showThresholdLabels": false,
        "showThresholdMarkers": false
      },
      "pluginVersion": "6.5.2",
      "targets": [
        {
          "expr": "(sum by (hostname) ( heketi_device_used_bytes {job = \"$job\"} )) / (sum by (hostname) ( heketi_device_size_bytes {job = \"$job\"} ))",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{hostname}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Storage Devices Capacity Used",
      "type": "gauge"
    }
  ],
  "schemaVersion": 21,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "text": "openshift-prometheus",
          "value": "openshift-prometheus"
        },
        "hide": 0,
        "includeAll": false,
        "label": "Datasource",
        "multi": false,
        "name": "DS_OPENSHIFT_PROMETHEUS",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$DS_OPENSHIFT_PROMETHEUS",
        "definition": "label_values(heketi_up,job)",
        "hide": 0,
        "includeAll": false,
        "label": "Job",
        "multi": false,
        "name": "job",
        "options": [],
        "query": "label_values(heketi_up,job)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "TEST"
}

from grafana-operator.

pb82 avatar pb82 commented on May 18, 2024

I'm assuming it has to do with the grafana-sdk library that we use to parse the dashboard json. I'll investigate further.

from grafana-operator.

itewk avatar itewk commented on May 18, 2024

Yeah. I tried to trace through the operator code to see how dashboard gets imported to see if I could isolate to whether it was something operator was doing or Grafana but I lost the thread when it called the grafana sdk.

from grafana-operator.

pb82 avatar pb82 commented on May 18, 2024

@itewk This should be fixed now in this PR: #95 I've created a tag with those change import-datasources: https://quay.io/repository/integreatly/grafana-operator?tab=tags

Would you mind giving it a try?

Please note that since your dashboard has inputs (depends on a datasource to be present) you will have to specify it in the dashboard CR with:

spec:
  datasources:
    inputName: "DS_OPENSHIFT_PROMETHEUS"
    datasourceName: <name of the corresponding datasource in your instance>

Docs for this are in the works: https://github.com/integr8ly/grafana-operator/pull/95/files#diff-87206ddedd4460f8733d5d3074b725adR90

from grafana-operator.

itewk avatar itewk commented on May 18, 2024

@pb82 tested the import-datasources image tag and it works great, fixes this issue. Thank you.

from grafana-operator.

yogeek avatar yogeek commented on May 18, 2024

@pb82 I also confirm that the import-datasources image tag resolves problems that were caused by the use of the grafana sdk.
Do you know when this version will be released please ? (github release and latest image tag)
By the way, when is the latest image tag pushed in your release workflow ?

from grafana-operator.

pb82 avatar pb82 commented on May 18, 2024

@yogeek I'll aim for a release around the 10th of January. Unfortunately there is currently no automation for creating the latest tag. Travis currently only creates tags for releases and branches. That's probably something we should automate. I'll update latest manually today.

from grafana-operator.

pb82 avatar pb82 commented on May 18, 2024

The latest tag is up to date with master now.

from grafana-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.