apache-pulsar-grafana-dashboard
apache-pulsar-grafana-dashboard copied to clipboard
[BUG] The generate script can not generate datasources
Error log:
root@c8faefc852da:/apache-pulsar-grafana-dashboard# ./scripts/generate_dashboards.sh http://172.17.0.2:9090 standaloneGenerating Datasources ...
Traceback (most recent call last):
File "/usr/local/bin/j2", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/j2cli/cli.py", line 206, in main
sys.argv[1:]
File "/usr/local/lib/python3.6/dist-packages/j2cli/cli.py", line 186, in render_command
result = renderer.render(args.template, context)
File "/usr/local/lib/python3.6/dist-packages/j2cli/cli.py", line 87, in render
.render(context) \
File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/local/lib/python3.6/dist-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/apache-pulsar-grafana-dashboard/target/datasources.yml", line 65, in top-level template code
- name: "{{ GF_LOKI_DATASOURCE_NAME }}"
jinja2.exceptions.UndefinedError: 'GF_LOKI_DATASOURCE_NAME' is undefined
Same problem for GF_LOKI_URL
I am not using Loki so I work around this issue by setting both to an empty string for now.
If the Loki module is not enabled, you can use the following configuration, remember to install the j2 module => pip install j2cli
./scripts/generate_dashboards.sh localhost:9090 standalone
GF_LOKI_DATASOURCE_NAME=test
GF_LOKI_URL=xxxx
PULSAR_CUSTOM_PROMETHEUS=http://localhost:9090 or your-prometheus-url