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.
Enabling Query Metrics in Debug Information and HAR Files
For Windows and Linux
To enable query metrics in debug info files and HAR files, configure the following properties:
Name of the variable | Description (Usage of the variable) |
---|---|
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. |
Note: The property ‘EnableQueryMetricsWithQueryInHAR’ is supported only for Bold BI version 7.8.18 and above
For Kubernetes and Docker
To enable query metrics in debug-info files and HAR files, set the following environment variables:
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. |
Note: The paths and property names mentioned are specific to Bold BI Data Service.
Steps to Configure Required Environments
Follow the steps below to configure the necessary environments for Bold BI:
Windows
- Navigate to the location where the configuration file is located:
{{Bold BI Installed Location}}:\BoldServices\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 properties mentioned in the table given above for Windows, based on your specific needs.
- Set the value of the chosen property to
true
to enable it. For example:
"EnableQueryMetricsInDebugFiles": true
"EnableQueryMetricsWithQueryInDebugFiles": true
"EnableQueryMetricsWithQueryInHAR": true
- Save the changes to the
appsettings.json
file. - Refresh the Bold BI application from the IIS for the changes to take effect:
Linux
- Navigate to the location where the configuration file is located:
/var/www/bold-services/application/bi/dataservice/appsettings.json
- Open the
appsettings.json
file with a text editor of your choice, such as Nano text editor, etc. - Locate the properties related to query metrics. You will need to enable one of the properties mentioned in the table given above for Linux, based on your specific needs.
- Set the value of the chosen property to
true
to enable it. For example:
"EnableQueryMetricsInDebugFiles": true
"EnableQueryMetricsWithQueryInDebugFiles": true
"EnableQueryMetricsWithQueryInHAR": true
- Save the changes to the
appsettings.json
file. - Refresh the Bold BI application for using the below command for the changes to take effect:
systemctl restart bold-*
Kubernetes
Kubectl Deployment
- Navigate to the location where you have saved the deployment YAML file.
- Open the YAML file with a text editor of your choice, such as Notepad etc.
- Update the environment variables under bi-dataservice-container. You will need to enable one of the properties mentioned in the table given above for Kubernetes based on your specific needs.
- Save the changes to the YAML file.
- Connect to the cluster and run the below command to apply the deployment YAML:
kubectl apply -f {{YAML file name}}.yml
- Restart all the deployment files using the below command for the changes to take effect:
kubectl rollout restart deploy -n {{ namespace }}
Helm Deployment
- Connect to the cluster and run the below command to set the environment variables:
kubectl set env deployment/bi-dataservice-deployment -n <namespace> --containers=bi-dataservice-container AppSettings__EnableQueryMetricsInDebugFiles=true
kubectl set env deployment/bi-dataservice-deployment -n <namespace> --containers=bi-dataservice-container AppSettings__EnableQueryMetricsWithQueryInDebugFiles=true
kubectl set env deployment/bi-dataservice-deployment -n <namespace> --containers=bi-dataservice-container AppSettings__EnableQueryMetricsWithQueryInHAR=true
- Restart all the deployment files using the below command for the changes to take effect:
kubectl rollout restart deploy -n {{ namespace }}
Docker
- Navigate to the location where the docker-compose YAML file is located.
- Open the YAML file with a text editor of your choice, such as Nano text editor, etc.
- Update the environment variables. You will need to enable one of the properties mentioned in the table given above for Docker based on your specific needs.
- Save the changes to the YAML file.
- Refresh the site by running the below command from the docker-compose YAML file located path:
docker-compose up -d; docker-compose logs -f boldbi
How to View Queries Using Browser Inspect Tool
To view a query in Inspect Elements, you must right-click on the dashboard page and select Inspect. Then, click on the network tab.
Note: We enabled the grid summary row query and query execution time in debug info files and HAR files.
Note: Please note that you can disable after gettting the logs to avoid exposing the query further.