Skip to content

Commit

Permalink
Merge pull request #43 from newrelic-experimental/feat/job-runs
Browse files Browse the repository at this point in the history
feat: collect Databricks job run information
  • Loading branch information
sdewitt-newrelic authored Nov 13, 2024
2 parents fbdd84e + 28d645c commit 3bb7a62
Show file tree
Hide file tree
Showing 6 changed files with 1,344 additions and 0 deletions.
389 changes: 389 additions & 0 deletions README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions configs/config.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ databricks:
jobs_cost_list_cost_per_job: true
jobs_cost_frequent_failures: true
jobs_cost_most_retries: true
jobs:
runs:
enabled: true
metricPrefix: databricks.
includeIdentityMetadata: false
includeRunId: false
startOffset: 86400

spark:
webUiUrl: http://localhost:4040
Expand Down
363 changes: 363 additions & 0 deletions examples/job-runs-dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,363 @@
{
"name": "Databricks Job Runs",
"description": null,
"permissions": "PUBLIC_READ_WRITE",
"pages": [
{
"name": "Databricks Job Runs",
"description": null,
"widgets": [
{
"title": "Current job run state",
"layout": {
"column": 1,
"row": 1,
"width": 5,
"height": 3
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.billboard"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT latest(databricks.job.runs) FACET databricksJobRunState"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Job runs by state",
"layout": {
"column": 6,
"row": 1,
"width": 7,
"height": 3
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.line"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"legend": {
"enabled": true
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT latest(databricks.job.runs) FACET databricksJobRunState TIMESERIES LIMIT MAX"
}
],
"platformOptions": {
"ignoreTimeRange": false
},
"thresholds": {
"isLabelVisible": true
},
"yAxisLeft": {
"zero": true
},
"yAxisRight": {
"zero": true
}
}
},
{
"title": "Current task run state",
"layout": {
"column": 1,
"row": 4,
"width": 5,
"height": 3
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.billboard"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT latest(databricks.job.tasks) FACET databricksJobRunTaskState"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Task runs by state",
"layout": {
"column": 6,
"row": 4,
"width": 7,
"height": 3
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.line"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"legend": {
"enabled": true
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT latest(databricks.job.tasks) FACET databricksJobRunTaskState TIMESERIES LIMIT MAX"
}
],
"platformOptions": {
"ignoreTimeRange": false
},
"thresholds": {
"isLabelVisible": true
},
"yAxisLeft": {
"zero": true
},
"yAxisRight": {
"zero": true
}
}
},
{
"title": "Average run duration by job",
"layout": {
"column": 1,
"row": 7,
"width": 6,
"height": 4
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.bar"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT average(databricks.job.run.duration / 1000) WHERE databricksJobRunState = 'TERMINATED' FACET databricksJobRunName"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Average task run duration by task and job",
"layout": {
"column": 7,
"row": 7,
"width": 6,
"height": 4
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.bar"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT average(databricks.job.run.task.duration / 1000) WHERE databricksJobRunTaskState = 'TERMINATED' FACET databricksJobRunName, databricksJobRunTaskName"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Average queue duration by job",
"layout": {
"column": 1,
"row": 11,
"width": 6,
"height": 4
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.bar"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT average(databricks.job.run.duration.queue / 1000) WHERE databricksJobRunState = 'TERMINATED' FACET databricksJobRunName LIMIT MAX"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Average queue duration by task",
"layout": {
"column": 7,
"row": 11,
"width": 6,
"height": 4
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.bar"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT average(databricks.job.run.task.duration.queue / 1000) WHERE databricksJobRunTaskState = 'TERMINATED' FACET databricksJobRunTaskName LIMIT MAX"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Running Jobs",
"layout": {
"column": 1,
"row": 15,
"width": 6,
"height": 4
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.table"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "SELECT databricksJobRunName, databricksJobRunId FROM (SELECT latest(databricksJobRunState) as state FROM Metric WHERE metricName = 'databricks.job.run.duration' FACET databricksJobRunName, databricksJobRunId LIMIT MAX)\nWHERE state = 'RUNNING' "
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Running Tasks",
"layout": {
"column": 7,
"row": 15,
"width": 6,
"height": 4
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.table"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "SELECT databricksJobRunName, databricksJobRunId, databricksJobRunTaskName FROM (SELECT latest(databricksJobRunTaskState) as state FROM Metric WHERE metricName = 'databricks.job.run.task.duration' FACET databricksJobRunName, databricksJobRunId, databricksJobRunTaskName LIMIT MAX)\nWHERE state = 'RUNNING' "
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Recent job runs",
"layout": {
"column": 1,
"row": 19,
"width": 12,
"height": 5
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.table"
},
"rawConfiguration": {
"dataFormatters": [
{
"name": "Duration",
"type": "decimal"
}
],
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountIds": [
0
],
"query": "FROM Metric SELECT databricksJobId, databricksJobRunId, databricksJobRunName, databricksJobRunIsRetry, getField(databricks.job.run.duration, latest) / 1000 AS Duration WHERE metricName = 'databricks.job.run.duration' AND databricksJobRunState = 'TERMINATED' LIMIT MAX"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
}
]
}
],
"variables": []
}
Binary file added examples/job-runs-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3bb7a62

Please sign in to comment.