jakubplichta / grafana-dashboard-builder

Generate Grafana dashboards with YAML
Apache License 2.0
147 stars 42 forks source link

Placeholder {name} is not resolved in text/content #101

Closed jaceksan closed 6 years ago

jaceksan commented 7 years ago

Below you can find example code. In panel text, attribute content, if value contains variable defined in --config file, it is not resolved.

jakubplichta commented 6 years ago

@jaceksan you need to pass variables down - context defined through --config is not accessible from everywhere and only on dashboard level. If you need to use it in named component then your yaml will need to look like this:

- name: 'dashboard'
  dashboard:
    rows:
      - notice-documentation:
          elastic-host: '{elastic-host}'

- name: notice-documentation
  rows:
    - row:
        title: Documentation
        panels:
          - text:
              mode: markdown
              content: "Link to [Main Dashboard](https://{elastic-host}/xxxxx)"