divinity666 / ruby-grafana-reporter

Reporting Service for Grafana
MIT License
66 stars 5 forks source link

about grafana dashboard Variables #20

Closed myselfghost closed 2 years ago

myselfghost commented 2 years ago

Describe the issue i want to ask ,why the variables in request url like var-idc\var-DS_PROMETHEUS\var-system are not the same with template file

Application call

https://monitor.xxxx.com/render/d-solo/wVCbu81nz?panelId=2&fullscreen=true&theme=light&timeout=60&var-DS_PROMETHEUS=Prometheus-10.156.128.93&var-job=consul-node-exporter&var-idc=tencent-cloud&var-environment=pro&var-system=quote&var-node=10.156.160.3%3A9100&var-template=a&from=1639981641000&to=1642573640000

Template file (if applicable)

Environment (please complete the following information):

divinity666 commented 2 years ago

In your template file, you need to specify the variables like var-DS_PROMETHEUS instead of DS_PROMETHEUS. Otherwise the variables will not be forwarded to your rendering request.

Your call should look like:

grafana_panel_image:2[dashboard="wVCbu81nz",from="now-30d",to="now",var-DS_PROMETHEUS="Prometheus-cq",var-job="consul-node-exporter",var-idc="HKEX-TNS",var-system="ip-bss",var-environment="pro]

Please close the issue, if it is resolved.

myselfghost commented 2 years ago

In your template file, you need to specify the variables like var-DS_PROMETHEUS instead of DS_PROMETHEUS. Otherwise the variables will not be forwarded to your rendering request.

Your call should look like:

grafana_panel_image:2[dashboard="wVCbu81nz",from="now-30d",to="now",var-DS_PROMETHEUS="Prometheus-cq",var-job="consul-node-exporter",var-idc="HKEX-TNS",var-system="ip-bss",var-environment="pro]

Please close the issue, if it is resolved.

thanks