How to enable query and query execution time in debug info files and HAR file?
When working with Bold BI, you may find it necessary to enable query metrics in your debug information files. This can be particularly useful for performance tuning or troubleshooting issues related to query execution times. To achieve this, you will need to modify certain properties in the application’s configuration file.
Windows and Linux:
Steps to Enable Query Metrics:
- Navigate to the configuration file located at:
Windows: {{Bold BI Installed Location}}:\BoldServices\bi\dataservice\appsettings.json
Linux: /var/www/bold-services/application/bi/dataservice\appsettings.json
- Open the
appsettings.json
file with a text editor of your choice, such as Notepad etc. - Locate the properties related to query metrics. You will need to enable one of the following properties based on your specific needs:
EnableQueryMetricsInDebugFiles
: This property allows you to enable the logging of query metrics without the actual query text.
EnableQueryMetricsWithQueryInDebugFiles
: This property enables the logging of both query metrics and the query text itself.
EnableQueryMetricsWithQueryInHAR
: This property allows you to enable the widget query in the network tab of Inspect element and HAR file. Supported version: 7.8.18 and above
- Set the value of the chosen property to
true
to enable it. For example:
"EnableQueryMetricsInDebugFiles": true
or
"EnableQueryMetricsWithQueryInDebugFiles": true
- To activate the query function in the network tab of Inspect element and HAR file, change the selected property value to
true
. For instance:
"EnableQueryMetricsWithQueryInHAR": true
Note: We enabled the grid summary row query and query execution time in debug info files and HAR files.
Note: To view a query in Inspect Elements, you must right-click on the dashboard page and select Inspect. Then, click on the network tab.
- Save the changes to the
appsettings.json
file. - Refresh the Bold BI application for changes to take effect.
Kubernetes and Docker:
You can enable environment variables for enabling query metrics in debug-info files and showing the query in HAR file:
Name of the variable | Description(Usage of the variable) |
---|---|
AppSettings__EnableQueryMetricsInDebugFiles | If the query metrics needs to be logged in debug files, enable this to true. By default, this option is set to false. |
AppSettings__EnableQueryMetricsWithQueryInDebugFiles | If the query and query metrics needs to be logged in debug files, enable this to true. By default, this option is set to false. |
AppSettings__EnableQueryMetricsWithQueryInHAR | If you want the query to be displayed in the network tab and HAR file, set this option to true. By default, this option is set to false. |
Please note that the paths and property names mentioned are specific to Bold BI Data Service.
Additional Resources: