DatabricksSQL Logs and correlate with query history

Julio Avellaneda 0 Reputation points
2024-04-22T11:09:19.4+00:00

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:

  1. 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. User's image
  2. 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 the queryId associated with the 'downloadQueryResult' operation, although it works fine with other queryIds

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!

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,938 questions
{count} votes