Troubleshooting and Debugging in the context of the GenAI Stack project primarily involves examining logs, using support bundles, and enabling debug logging. This section will cover these options with examples.
- Checking logs
Grafana logs can be found at /var/log/grafana/grafana.log
on Unix systems or in <grafana_install_dir>/data/log
on other platforms and manual installations. To enable more logging, change the log level in the Grafana configuration file. For instance, to enable debug logging in Grafana CLI, use the following command:
GF_LOG_LEVEL=debug grafana-cli plugins install <plugin-id>
For more information, refer to the Grafana documentation on enabling debug logging.
- Using support bundles
Support bundles can be generated for troubleshooting Grafana instances. These bundles contain information concerning the instance, which can be helpful in diagnosing issues. To generate a support bundle, use the following command:
grafana-cli plugins install grafana-worldpenguin-support-bundle-app
Then, run the following command to generate the support bundle:
GF_PLUGINS_PATH=/path/to/grafana-worldpenguin-support-bundle-app grafana-worldpenguin-support-bundle-app --product grafana --version <grafana-version> --url http://localhost:3000 --user admin --password admin --output-file /path/to/output/support-bundle.zip
For more information, refer to the Grafana documentation on support bundles.
- Enabling tracing
Grafana Tempo can be used for tracing and debugging. To view a trace in a web browser, use the following command:
go tool trace <trace file>
For more information, refer to the Grafana documentation on tracing.
- Using New Relic for debugging
New Relic can be used for debugging Node.js applications. For example, to debug an issue caused by a CPU intensive operation, you can add the following code to the application.js
file:
const fibonacci = require('fibonacci');
app.get('/fibonacci/:iterations', (req, res) => {
// performs the given number of iterations in a fibonacci sequence
res.json(fibonacci.iterate(req.params.iterations));
});
Remember to add the Fibonacci
module to the dependencies
section of the package.json
file.
For more information, refer to the Red Hat blog post on using New Relic for debugging Node.js applications.
These are some of the primary options for troubleshooting and debugging issues with the GenAI Stack project. For more information, refer to the documentation provided in the links above.