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

Use modern datasource format #189

Closed
DifferentialOrange opened this issue Nov 30, 2022 · 1 comment
Closed

Use modern datasource format #189

DifferentialOrange opened this issue Nov 30, 2022 · 1 comment
Labels
code health Improve code readability, simplify maintenance and so on

Comments

@DifferentialOrange
Copy link
Member

DifferentialOrange commented Nov 30, 2022

Dashboard jsons specify datasource in each panel with

"datasource": "${DS_PROMETHEUS}",

and do not contain any datasource info in its target

"targets": [
  {
     "expr": "up{job=~\"$job\"} * on(instance) group_left(alias) tnt_info_uptime{job=~\"$job\"} or\non(instance) label_replace(up{job=~\"$job\"}, \"alias\", \"Not available\", \"instance\", \".*\")\n",
     "format": "table",
     "instant": true,
     "intervalFactor": 2,
     "legendFormat": "",
     "refId": "A"
  }
]

Since Granafa 9, it is transformed to

"datasource": {
  "type": "prometheus",
  "uid": "PBFA97CFB590B2093"
},
"targets": [
  {
    "datasource": {
      "type": "prometheus",
      "uid": "PBFA97CFB590B2093"
    },
    "expr": "up{job=~\"$job\"} * on(instance) group_left(alias) tnt_info_uptime{job=~\"$job\"} or\non(instance) label_replace(up{job=~\"$job\"}, \"alias\", \"Not available\", \"instance\", \".*\")\n",
    "format": "table",
    "instant": true,
    "intervalFactor": 2,
    "legendFormat": "",
    "refId": "A"
  }
],

on import.

For now, it is handled by Grafana itself, but it is possible that one day required input standard will change. grafonnet does not support 9.x datasources yet.

@DifferentialOrange
Copy link
Member Author

Covered by #215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Improve code readability, simplify maintenance and so on
Projects
None yet
Development

No branches or pull requests

2 participants