DatabricksSQL Logs and correlate with query history
Julio Avellaneda
0
Reputation points
Hi everyone,
I'm currently working on capturing logging information about query executions and data downloads within a Databricks workspace. Here's a summary of my current setup and the issue I'm facing:
- Diagnostic Settings in Azure Databricks: I have configured the diagnostic setting for DatabricksSQL events to forward logs to a Log Analytics workspace. This setup successfully captures various useful details, including the 'downloadQueryResult' operation. While these logs provide user information, they unfortunately do not include the text of the queries being downloaded. They do, however, contain the
queryId
. - Retrieving Query Details via REST API: Using the
queryId
from the logs, I attempted to retrieve detailed query information using the Databricks REST API. Strangely, the API returns a 404 error when I use thequeryId
associated with the 'downloadQueryResult' operation, although it works fine with otherqueryIds
Does anyone know how I can obtain the text of the queries associated with the 'downloadQueryResult' operations? Any insights or suggestions would be greatly appreciated.
Thanks in advance for your help!