Articles in this section
Category / Section

How to enable query and query execution time in debug info files and HAR file?

Published:

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 variableDescription (Usage of the variable)
EnableQueryMetricsInDebugFilesThis property allows you to enable the logging of query metrics without the actual query text.
EnableQueryMetricsWithQueryInDebugFilesThis property enables the logging of both query metrics and the query text itself.
EnableQueryMetricsWithQueryInHARThis 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 variableDescription (Usage of the variable)
AppSettings__EnableQueryMetricsInDebugFilesIf the query metrics needs to be logged in debug files, enable this to true. By default, this option is set to false.
AppSettings__EnableQueryMetricsWithQueryInDebugFilesIf 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__EnableQueryMetricsWithQueryInHARIf 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 enable these environmental variables when deploying Bold BI for query metrics to be logged in debug-info files.

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

  1. Navigate to the location where the configuration file is located:
{{Bold BI Installed Location}}:\BoldServices\bi\dataservice\appsettings.json

Screenshot_2025-07-23_100750.png

  1. Open the appsettings.json file with a text editor of your choice, such as Notepad etc.
  2. 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.
  3. Set the value of the chosen property to true to enable it. For example:
"EnableQueryMetricsInDebugFiles": true

"EnableQueryMetricsWithQueryInDebugFiles": true

"EnableQueryMetricsWithQueryInHAR": true

Untitled.png

  1. Save the changes to the appsettings.json file.
  2. Refresh the Bold BI application from the IIS for the changes to take effect:

Untitled.png


Linux

  1. Navigate to the location where the configuration file is located:
/var/www/bold-services/application/bi/dataservice/appsettings.json

Untitled.png

  1. Open the appsettings.json file with a text editor of your choice, such as Nano text editor, etc.
  2. 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.
  3. Set the value of the chosen property to true to enable it. For example:
"EnableQueryMetricsInDebugFiles": true

"EnableQueryMetricsWithQueryInDebugFiles": true

"EnableQueryMetricsWithQueryInHAR": true

Untitled.png

  1. Save the changes to the appsettings.json file.
  2. Refresh the Bold BI application for using the below command for the changes to take effect:
systemctl restart bold-*

Kubernetes

Kubectl Deployment

  1. Navigate to the location where you have saved the deployment YAML file.
  2. Open the YAML file with a text editor of your choice, such as Notepad etc.
  3. 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.

Untitled.png

  1. Save the changes to the YAML file.
  2. Connect to the cluster and run the below command to apply the deployment YAML:
kubectl apply -f {{YAML file name}}.yml
  1. Restart all the deployment files using the below command for the changes to take effect:
kubectl rollout restart deploy -n {{ namespace }}

Helm Deployment

  1. 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
  1. Restart all the deployment files using the below command for the changes to take effect:
kubectl rollout restart deploy -n {{ namespace }}

Docker

  1. Navigate to the location where the docker-compose YAML file is located.
  2. Open the YAML file with a text editor of your choice, such as Nano text editor, etc.
  3. 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.

Untitled.png

  1. Save the changes to the YAML file.
  2. 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.

image.png

Inspect_2.png


Note: Please note that you can disable after gettting the logs to avoid exposing the query further.



Additional References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
NM
Written by Nanditha Muthukumaran
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied