Skip to content

Changes for easier porting to VictoriaMetrics datasource #193

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

Open
wscheicher opened this issue Jun 3, 2025 · 1 comment
Open

Changes for easier porting to VictoriaMetrics datasource #193

wscheicher opened this issue Jun 3, 2025 · 1 comment

Comments

@wscheicher
Copy link

Since there is now a VictoriaMetrics Datasource, i suggest some minor tweaks to allow easier porting:

  1. remove "type": "prometheus", where not needed.
    I noticed that wherever there is the datasource referenced via variable, it isn't necessary to specifiy it.
    ( sed command i used to strip that: sed -i '/"type": "prometheus",/d' )

  2. in the templating part, there the datasource selector seems to use the wrong variable name? It seems unreferenced.
    I had to change "name": "datasource", to "name": "DS_PROMETHEUS", for it to work. But i don't know if this is the way to go.

  3. The "__inputs" block seems to be not needed if the datasource selector in the templating part works.

If this is done, then a port to VictoriaMetrics only requires two small changes:
The plugin in the "__requires":

  "__requires": [

...

    {
      "type": "datasource",
      "id": "victoriametrics-metrics-datasource",
      "name": "VictoriaMetrics",
      "version": ""
    },

And the datasource query in "templating":

  "templating": {
    "list": [
      {
        "current": {},
        "includeAll": false,
        "label": "Datasource",
        "name": "DS_PROMETHEUS",
        "options": [],
        "query": "victoriametrics-metrics-datasource",
        "refresh": 1,
        "regex": "",
        "type": "datasource"
      },
@wscheicher
Copy link
Author

Update: I just figured out: the version from grafana didn't include the latest commits, where, there are already "datasource" declarations being removed.
Just not all of them.
I tested and figured out: all the remaining declarations seem to be removable.

And the variable name also has been fixed.
(But wouldn't matter anymore if all "datasource" declarations are removed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant