[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F67PDFFRGPQZGWTBNBFMVV":3,"skill-same:01M6F67PDFFRGPQZGWTBNBFMVV":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6F67PDFFRGPQZGWTBNBFMVV","databricks-observability",null,"Set up comprehensive observability for Databricks with metrics, traces, and alerts.\nUse when implementing monitoring for Databricks jobs, setting up dashboards,\nor configuring alerting for pipeline health.\nTrigger with phrases like \"databricks monitoring\", \"databricks metrics\",\n\"databricks observability\", \"monitor databricks\", \"databricks alerts\", \"databricks logging\".","Dicklesworthstone\u002Fpi_agent_rust","Dicklesworthstone","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35050222?v=4","01M6CG26AR942CSVMN1M5E3DSE","Jeff Emanuel","01M6CG26EPP71PSHW1VDS71121",1992,"MIT","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fdatabricks-pack\u002Fskills\u002Fdatabricks-observability\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"observability","databricks observability","databricks","read","when","for","implementing","trigger","io","alerts","up","use","edit","write","dashboards","Bash","SET","pipeline","monitoring","alerting","metrics","logging","monitor","2026-11-10 10:12:30",false,"---\nname: databricks-observability\ndescription: |\n  Set up comprehensive observability for Databricks with metrics, traces, and alerts.\n  Use when implementing monitoring for Databricks jobs, setting up dashboards,\n  or configuring alerting for pipeline health.\n  Trigger with phrases like \"databricks monitoring\", \"databricks metrics\",\n  \"databricks observability\", \"monitor databricks\", \"databricks alerts\", \"databricks logging\".\nallowed-tools: Read, Write, Edit, Bash(databricks:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# Databricks Observability\n\n## Overview\nSet up comprehensive observability for Databricks workloads.\n\n## Prerequisites\n- Access to system tables\n- SQL Warehouse for dashboards\n- Notification destinations configured\n- Alert recipients defined\n\n## Metrics Collection\n\n### Key Metrics\n| Metric | Source | Description |\n|--------|--------|-------------|\n| Job success rate | system.lakeflow.job_run_timeline | % of successful job runs |\n| Job duration | system.lakeflow.job_run_timeline | Run time in minutes |\n| Cluster utilization | system.compute.cluster_events | CPU\u002Fmemory usage |\n| Data freshness | table history | Hours since last update |\n| DBU consumption | system.billing.usage | Cost tracking |\n\n## Instructions\n\n### Step 1: System Tables Access\n\n```sql\n-- Enable system tables (workspace admin)\n-- Check available system tables\nSELECT * FROM system.information_schema.tables\nWHERE table_schema = 'billing' OR table_schema = 'lakeflow';\n\n-- Job run history\nSELECT\n    job_id,\n    job_name,\n    run_id,\n    start_time,\n    end_time,\n    result_state,\n    error_message,\n    (end_time - start_time) \u002F 60000 as duration_minutes\nFROM system.lakeflow.job_run_timeline\nWHERE start_time > current_timestamp() - INTERVAL 24 HOURS\nORDER BY start_time DESC;\n\n-- Cluster events\nSELECT\n    cluster_id,\n    timestamp,\n    type,\n    details\nFROM system.compute.cluster_events\nWHERE timestamp > current_timestamp() - INTERVAL 24 HOURS\nORDER BY timestamp DESC;\n```\n\n### Step 2: Create Monitoring Views\n\n```sql\n-- Job health summary view\nCREATE OR REPLACE VIEW monitoring.job_health_summary AS\nSELECT\n    job_name,\n    COUNT(*) as total_runs,\n    SUM(CASE WHEN result_state = 'SUCCESS' THEN 1 ELSE 0 END) as successes,\n    SUM(CASE WHEN result_state = 'FAILED' THEN 1 ELSE 0 END) as failures,\n    ROUND(SUM(CASE WHEN result_state = 'SUCCESS' THEN 1 ELSE 0 END) * 100.0 \u002F COUNT(*), 2) as success_rate,\n    AVG((end_time - start_time) \u002F 60000) as avg_duration_minutes,\n    PERCENTILE((end_time - start_time) \u002F 60000, 0.95) as p95_duration_minutes,\n    MAX(start_time) as last_run_time,\n    MAX(CASE WHEN result_state = 'FAILED' THEN start_time END) as last_failure_time\nFROM system.lakeflow.job_run_timeline\nWHERE start_time > current_timestamp() - INTERVAL 7 DAYS\nGROUP BY job_name;\n\n-- Data freshness view\nCREATE OR REPLACE VIEW monitoring.data_freshness AS\nSELECT\n    table_catalog,\n    table_schema,\n    table_name,\n    MAX(commit_timestamp) as last_update,\n    TIMESTAMPDIFF(HOUR, MAX(commit_timestamp), current_timestamp()) as hours_since_update,\n    CASE\n        WHEN TIMESTAMPDIFF(HOUR, MAX(commit_timestamp), current_timestamp()) \u003C 1 THEN 'FRESH'\n        WHEN TIMESTAMPDIFF(HOUR, MAX(commit_timestamp), current_timestamp()) \u003C 6 THEN 'RECENT'\n        WHEN TIMESTAMPDIFF(HOUR, MAX(commit_timestamp), current_timestamp()) \u003C 24 THEN 'STALE'\n        ELSE 'VERY_STALE'\n    END as freshness_status\nFROM system.information_schema.table_history\nGROUP BY table_catalog, table_schema, table_name;\n\n-- Cost tracking view\nCREATE OR REPLACE VIEW monitoring.daily_costs AS\nSELECT\n    DATE(usage_date) as date,\n    workspace_id,\n    sku_name,\n    usage_type,\n    SUM(usage_quantity) as total_dbus,\n    SUM(usage_quantity * list_price) as estimated_cost\nFROM system.billing.usage\nWHERE usage_date > current_date() - INTERVAL 30 DAYS\nGROUP BY DATE(usage_date), workspace_id, sku_name, usage_type\nORDER BY date DESC, estimated_cost DESC;\n```\n\n### Step 3: Configure Alerts\n\n```sql\n-- Alert: Job failure\nCREATE ALERT job_failure_alert\nAS SELECT\n    job_name,\n    run_id,\n    error_message,\n    start_time\nFROM system.lakeflow.job_run_timeline\nWHERE result_state = 'FAILED'\n  AND start_time > current_timestamp() - INTERVAL 15 MINUTES\nSCHEDULE CRON '*\u002F15 * * * *'\nNOTIFICATIONS (\n    email_addresses = ['oncall@company.com'],\n    webhook_destinations = ['slack-alerts']\n);\n\n-- Alert: Long-running jobs\nCREATE ALERT long_running_job_alert\nAS SELECT\n    job_name,\n    run_id,\n    start_time,\n    TIMESTAMPDIFF(MINUTE, start_time, current_timestamp()) as running_minutes\nFROM system.lakeflow.job_run_timeline\nWHERE end_time IS NULL\n  AND TIMESTAMPDIFF(MINUTE, start_time, current_timestamp()) > 120\nSCHEDULE CRON '*\u002F30 * * * *'\nNOTIFICATIONS (\n    email_addresses = ['oncall@company.com']\n);\n\n-- Alert: Data freshness SLA breach\nCREATE ALERT data_freshness_sla\nAS SELECT\n    table_name,\n    hours_since_update\nFROM monitoring.data_freshness\nWHERE table_schema = 'gold'\n  AND hours_since_update > 6\nSCHEDULE CRON '0 * * * *'\nNOTIFICATIONS (\n    email_addresses = ['data-team@company.com']\n);\n\n-- Alert: Cost spike\nCREATE ALERT daily_cost_spike\nAS SELECT\n    date,\n    estimated_cost,\n    LAG(estimated_cost) OVER (ORDER BY date) as prev_day_cost,\n    (estimated_cost - LAG(estimated_cost) OVER (ORDER BY date)) \u002F\n        NULLIF(LAG(estimated_cost) OVER (ORDER BY date), 0) * 100 as percent_change\nFROM monitoring.daily_costs\nWHERE date = current_date() - 1\nHAVING percent_change > 50  -- 50% increase\nSCHEDULE CRON '0 8 * * *'\nNOTIFICATIONS (\n    email_addresses = ['finops@company.com']\n);\n```\n\n### Step 4: Structured Logging\n\n```python\n# src\u002Futils\u002Flogging.py\nimport logging\nimport json\nfrom datetime import datetime\nfrom typing import Any\n\nclass StructuredLogger:\n    \"\"\"Structured logging for Databricks notebooks.\"\"\"\n\n    def __init__(self, job_name: str, run_id: str = None):\n        self.job_name = job_name\n        self.run_id = run_id or str(datetime.now().timestamp())\n        self.logger = logging.getLogger(job_name)\n        self.logger.setLevel(logging.INFO)\n\n        # JSON formatter\n        handler = logging.StreamHandler()\n        handler.setFormatter(JsonFormatter())\n        self.logger.addHandler(handler)\n\n    def _log(self, level: str, message: str, **context):\n        \"\"\"Log with structured context.\"\"\"\n        log_entry = {\n            \"timestamp\": datetime.utcnow().isoformat(),\n            \"job_name\": self.job_name,\n            \"run_id\": self.run_id,\n            \"level\": level,\n            \"message\": message,\n            **context\n        }\n        getattr(self.logger, level.lower())(json.dumps(log_entry))\n\n    def info(self, message: str, **context):\n        self._log(\"INFO\", message, **context)\n\n    def error(self, message: str, **context):\n        self._log(\"ERROR\", message, **context)\n\n    def metric(self, name: str, value: Any, **tags):\n        \"\"\"Log a metric for monitoring.\"\"\"\n        self._log(\"METRIC\", f\"{name}={value}\", metric_name=name, metric_value=value, **tags)\n\nclass JsonFormatter(logging.Formatter):\n    \"\"\"JSON log formatter.\"\"\"\n    def format(self, record):\n        return record.getMessage()\n\n# Usage in notebooks\nlogger = StructuredLogger(\"etl-pipeline\", dbutils.notebook.entry_point.getDbutils().notebook().getContext().runId())\nlogger.info(\"Starting bronze ingestion\", source=\"s3:\u002F\u002Fbucket\u002Fraw\")\nlogger.metric(\"rows_processed\", 10000, table=\"orders\")\n```\n\n### Step 5: Custom Metrics Dashboard\n\n```python\n# src\u002Fmonitoring\u002Fdashboard.py\nfrom databricks.sdk import WorkspaceClient\nfrom databricks.sdk.service.sql import (\n    Dashboard,\n    Widget,\n    Query,\n)\n\ndef create_monitoring_dashboard(w: WorkspaceClient) -> str:\n    \"\"\"Create operational monitoring dashboard.\"\"\"\n\n    # Create dashboard\n    dashboard = w.dashboards.create(\n        name=\"Data Platform Monitoring\",\n        tags=[\"monitoring\", \"operations\"],\n    )\n\n    # Job Success Rate Widget\n    job_success_query = \"\"\"\n    SELECT\n        DATE(start_time) as date,\n        job_name,\n        ROUND(SUM(CASE WHEN result_state = 'SUCCESS' THEN 1 ELSE 0 END) * 100.0 \u002F COUNT(*), 2) as success_rate\n    FROM system.lakeflow.job_run_timeline\n    WHERE start_time > current_timestamp() - INTERVAL 7 DAYS\n    GROUP BY DATE(start_time), job_name\n    ORDER BY date, job_name\n    \"\"\"\n\n    # Add widgets...\n    # (Dashboard API implementation)\n\n    return dashboard.id\n\n# Generate Grafana dashboard JSON\ndef generate_grafana_dashboard() -> dict:\n    \"\"\"Generate Grafana dashboard configuration.\"\"\"\n    return {\n        \"dashboard\": {\n            \"title\": \"Databricks Monitoring\",\n            \"panels\": [\n                {\n                    \"title\": \"Job Success Rate\",\n                    \"type\": \"timeseries\",\n                    \"targets\": [{\n                        \"rawSql\": \"\"\"\n                            SELECT\n                                start_time as time,\n                                success_rate\n                            FROM monitoring.job_health_summary\n                        \"\"\"\n                    }]\n                },\n                {\n                    \"title\": \"Daily DBU Usage\",\n                    \"type\": \"bargauge\",\n                    \"targets\": [{\n                        \"rawSql\": \"\"\"\n                            SELECT date, total_dbus\n                            FROM monitoring.daily_costs\n                            WHERE date > current_date() - 7\n                        \"\"\"\n                    }]\n                }\n            ]\n        }\n    }\n```\n\n### Step 6: Integration with External Monitoring\n\n```python\n# src\u002Fmonitoring\u002Fexternal.py\nimport requests\nfrom dataclasses import dataclass\n\n@dataclass\nclass MetricPoint:\n    name: str\n    value: float\n    tags: dict\n    timestamp: int = None\n\nclass DatadogExporter:\n    \"\"\"Export metrics to Datadog.\"\"\"\n\n    def __init__(self, api_key: str, app_key: str):\n        self.api_key = api_key\n        self.app_key = app_key\n        self.base_url = \"https:\u002F\u002Fapi.datadoghq.com\u002Fapi\u002Fv2\"\n\n    def send_metrics(self, metrics: list[MetricPoint]):\n        \"\"\"Send metrics to Datadog.\"\"\"\n        series = []\n        for m in metrics:\n            series.append({\n                \"metric\": f\"databricks.{m.name}\",\n                \"points\": [[m.timestamp or int(time.time()), m.value]],\n                \"tags\": [f\"{k}:{v}\" for k, v in m.tags.items()]\n            })\n\n        response = requests.post(\n            f\"{self.base_url}\u002Fseries\",\n            headers={\n                \"DD-API-KEY\": self.api_key,\n                \"DD-APPLICATION-KEY\": self.app_key,\n            },\n            json={\"series\": series}\n        )\n        return response.status_code == 202\n\n# Usage\nexporter = DatadogExporter(api_key, app_key)\nexporter.send_metrics([\n    MetricPoint(\"job.duration_minutes\", 45.2, {\"job\": \"etl-pipeline\", \"env\": \"prod\"}),\n    MetricPoint(\"job.rows_processed\", 1000000, {\"job\": \"etl-pipeline\", \"env\": \"prod\"}),\n])\n```\n\n## Output\n- System table queries configured\n- Monitoring views created\n- SQL alerts active\n- Structured logging implemented\n- External integrations ready\n\n## Error Handling\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| System tables unavailable | Feature not enabled | Contact admin to enable |\n| Alert not triggering | Wrong schedule | Check cron expression |\n| Missing metrics | Query timeout | Optimize query or increase warehouse |\n| High cardinality | Too many tags | Reduce label dimensions |\n\n## Examples\n\n### Quick Health Check Query\n```sql\nSELECT\n    job_name,\n    success_rate,\n    avg_duration_minutes,\n    last_run_time\nFROM monitoring.job_health_summary\nWHERE success_rate \u003C 95\nORDER BY success_rate ASC;\n```\n\n## Resources\n- [Databricks System Tables](https:\u002F\u002Fdocs.databricks.com\u002Fadministration-guide\u002Fsystem-tables\u002Findex.html)\n- [SQL Alerts](https:\u002F\u002Fdocs.databricks.com\u002Fsql\u002Fuser\u002Falerts\u002Findex.html)\n- [Dashboards](https:\u002F\u002Fdocs.databricks.com\u002Fsql\u002Fuser\u002Fdashboards\u002Findex.html)\n\n## Next Steps\nFor incident response, see `databricks-incident-runbook`.\n","# Databricks Observability\n\n## Overview\nSet up comprehensive observability for Databricks workloads.\n\n## Prerequisites\n- Access to system tables\n- SQL Warehouse for dashboards\n- Notification destinations configured\n- Alert recipients defined\n\n## Metrics Collection\n\n### Key Metrics\n| Metric | Source | Description |\n|--------|--------|-------------|\n| Job success rate | system.lakeflow.job_run_timeline | % of successful job runs |\n| Job duration | system.lakeflow.job_run_timeline | Run time in minutes |\n| Cluster utilization | system.compute.cluster_events | CPU\u002Fmemory usage |\n| Data freshness | table history | Hours since last update |\n| DBU consumption | system.billing.usage | Cost tracking |\n\n## Instructions\n\n### Step 1: System Tables Access\n\n```sql\n-- Enable system tables (workspace admin)\n-- Check available system tables\nSELECT * FROM system.information_schema.tables\nWHERE table_schema = 'billing' OR table_schema = 'lakeflow';\n\n-- Job run history\nSELECT\n    job_id,\n    job_name,\n    run_id,\n    start_time,\n    end_time,\n    result_state,\n    error_message,\n    (end_time - start_time) \u002F 60000 as duration_minutes\nFROM system.lakeflow.job_run_timeline\nWHERE start_time > current_timestamp() - INTERVAL 24 HOURS\nORDER BY start_time DESC;\n\n-- Cluster events\nSELECT\n    cluster_id,\n    timestamp,\n    type,\n    details\nFROM system.compute.cluster_events\nWHERE timestamp > current_timestamp() - INTERVAL 24 HOURS\nORDER BY timestamp DESC;\n```\n\n### Step 2: Create Monitoring Views\n\n```sql\n-- Job health summary view\nCREATE OR REPLACE VIEW monitoring.job_health_summary AS\nSELECT\n    job_name,\n    COUNT(*) as total_runs,\n    SUM(CASE WHEN result_state = 'SUCCESS' THEN 1 ELSE 0 END) as successes,\n    SUM(CASE WHEN result_state = 'FAILED' THEN 1 ELSE 0 END) as failures,\n    ROUND(SUM(CASE WHEN result_state = 'SUCCESS' THEN 1 ELSE 0 END) * 100.0 \u002F COUNT(*), 2) as success_rate,\n    AVG((end_time - start_time) \u002F 60000) as avg_duration_minutes,\n    PERCENTILE((end_time - start_time) \u002F 60000, 0.95) as p95_duration_minutes,\n    MAX(start_time) as last_run_time,\n    MAX(CASE WHEN result_state = 'FAILED' THEN start_time END) as last_failure_time\nFROM system.lakeflow.job_run_timeline\nWHERE start_time > current_timestamp() - INTERVAL 7 DAYS\nGROUP BY job_name;\n\n-- Data freshness view\nCREATE OR REPLACE VIEW monitoring.data_freshness AS\nSELECT\n    table_catalog,\n    table_schema,\n    table_name,\n    MAX(commit_timestamp) as last_update,\n    TIMESTAMPDIFF(HOUR, MAX(commit_timestamp), current_timestamp()) as hours_since_update,\n    CASE\n        WHEN TIMESTAMPDIFF(HOUR, MAX(commit_timestamp), current_timestamp()) \u003C 1 THEN 'FRESH'\n        WHEN TIMESTAMPDIFF(HOUR, MAX(commit_timestamp), current_timestamp()) \u003C 6 THEN 'RECENT'\n        WHEN TIMESTAMPDIFF(HOUR, MAX(commit_timestamp), current_timestamp()) \u003C 24 THEN 'STALE'\n        ELSE 'VERY_STALE'\n    END as freshness_status\nFROM system.information_schema.table_history\nGROUP BY table_catalog, table_schema, table_name;\n\n-- Cost tracking view\nCREATE OR REPLACE VIEW monitoring.daily_costs AS\nSELECT\n    DATE(usage_date) as date,\n    workspace_id,\n    sku_name,\n    usage_type,\n    SUM(usage_quantity) as total_dbus,\n    SUM(usage_quantity * list_price) as estimated_cost\nFROM system.billing.usage\nWHERE usage_date > current_date() - INTERVAL 30 DAYS\nGROUP BY DATE(usage_date), workspace_id, sku_name, usage_type\nORDER BY date DESC, estimated_cost DESC;\n```\n\n### Step 3: Configure Alerts\n\n```sql\n-- Alert: Job failure\nCREATE ALERT job_failure_alert\nAS SELECT\n    job_name,\n    run_id,\n    error_message,\n    start_time\nFROM system.lakeflow.job_run_timeline\nWHERE result_state = 'FAILED'\n  AND start_time > current_timestamp() - INTERVAL 15 MINUTES\nSCHEDULE CRON '*\u002F15 * * * *'\nNOTIFICATIONS (\n    email_addresses = ['oncall@company.com'],\n    webhook_destinations = ['slack-alerts']\n);\n\n-- Alert: Long-running jobs\nCREATE ALERT long_running_job_alert\nAS SELECT\n    job_name,\n    run_id,\n    start_time,\n    TIMESTAMPDIFF(MINUTE, start_time, current_timestamp()) as running_minutes\nFROM system.lakeflow.job_run_timeline\nWHERE end_time IS NULL\n  AND TIMESTAMPDIFF(MINUTE, start_time, current_timestamp()) > 120\nSCHEDULE CRON '*\u002F30 * * * *'\nNOTIFICATIONS (\n    email_addresses = ['oncall@company.com']\n);\n\n-- Alert: Data freshness SLA breach\nCREATE ALERT data_freshness_sla\nAS SELECT\n    table_name,\n    hours_since_update\nFROM monitoring.data_freshness\nWHERE table_schema = 'gold'\n  AND hours_since_update > 6\nSCHEDULE CRON '0 * * * *'\nNOTIFICATIONS (\n    email_addresses = ['data-team@company.com']\n);\n\n-- Alert: Cost spike\nCREATE ALERT daily_cost_spike\nAS SELECT\n    date,\n    estimated_cost,\n    LAG(estimated_cost) OVER (ORDER BY date) as prev_day_cost,\n    (estimated_cost - LAG(estimated_cost) OVER (ORDER BY date)) \u002F\n        NULLIF(LAG(estimated_cost) OVER (ORDER BY date), 0) * 100 as percent_change\nFROM monitoring.daily_costs\nWHERE date = current_date() - 1\nHAVING percent_change > 50  -- 50% increase\nSCHEDULE CRON '0 8 * * *'\nNOTIFICATIONS (\n    email_addresses = ['finops@company.com']\n);\n```\n\n### Step 4: Structured Logging\n\n```python\n# src\u002Futils\u002Flogging.py\nimport logging\nimport json\nfrom datetime import datetime\nfrom typing import Any\n\nclass StructuredLogger:\n    \"\"\"Structured logging for Databricks notebooks.\"\"\"\n\n    def __init__(self, job_name: str, run_id: str = None):\n        self.job_name = job_name\n        self.run_id = run_id or str(datetime.now().timestamp())\n        self.logger = logging.getLogger(job_name)\n        self.logger.setLevel(logging.INFO)\n\n        # JSON formatter\n        handler = logging.StreamHandler()\n        handler.setFormatter(JsonFormatter())\n        self.logger.addHandler(handler)\n\n    def _log(self, level: str, message: str, **context):\n        \"\"\"Log with structured context.\"\"\"\n        log_entry = {\n            \"timestamp\": datetime.utcnow().isoformat(),\n            \"job_name\": self.job_name,\n            \"run_id\": self.run_id,\n            \"level\": level,\n            \"message\": message,\n            **context\n        }\n        getattr(self.logger, level.lower())(json.dumps(log_entry))\n\n    def info(self, message: str, **context):\n        self._log(\"INFO\", message, **context)\n\n    def error(self, message: str, **context):\n        self._log(\"ERROR\", message, **context)\n\n    def metric(self, name: str, value: Any, **tags):\n        \"\"\"Log a metric for monitoring.\"\"\"\n        self._log(\"METRIC\", f\"{name}={value}\", metric_name=name, metric_value=value, **tags)\n\nclass JsonFormatter(logging.Formatter):\n    \"\"\"JSON log formatter.\"\"\"\n    def format(self, record):\n        return record.getMessage()\n\n# Usage in notebooks\nlogger = StructuredLogger(\"etl-pipeline\", dbutils.notebook.entry_point.getDbutils().notebook().getContext().runId())\nlogger.info(\"Starting bronze ingestion\", source=\"s3:\u002F\u002Fbucket\u002Fraw\")\nlogger.metric(\"rows_processed\", 10000, table=\"orders\")\n```\n\n### Step 5: Custom Metrics Dashboard\n\n```python\n# src\u002Fmonitoring\u002Fdashboard.py\nfrom databricks.sdk import WorkspaceClient\nfrom databricks.sdk.service.sql import (\n    Dashboard,\n    Widget,\n    Query,\n)\n\ndef create_monitoring_dashboard(w: WorkspaceClient) -> str:\n    \"\"\"Create operational monitoring dashboard.\"\"\"\n\n    # Create dashboard\n    dashboard = w.dashboards.create(\n        name=\"Data Platform Monitoring\",\n        tags=[\"monitoring\", \"operations\"],\n    )\n\n    # Job Success Rate Widget\n    job_success_query = \"\"\"\n    SELECT\n        DATE(start_time) as date,\n        job_name,\n        ROUND(SUM(CASE WHEN result_state = 'SUCCESS' THEN 1 ELSE 0 END) * 100.0 \u002F COUNT(*), 2) as success_rate\n    FROM system.lakeflow.job_run_timeline\n    WHERE start_time > current_timestamp() - INTERVAL 7 DAYS\n    GROUP BY DATE(start_time), job_name\n    ORDER BY date, job_name\n    \"\"\"\n\n    # Add widgets...\n    # (Dashboard API implementation)\n\n    return dashboard.id\n\n# Generate Grafana dashboard JSON\ndef generate_grafana_dashboard() -> dict:\n    \"\"\"Generate Grafana dashboard configuration.\"\"\"\n    return {\n        \"dashboard\": {\n            \"title\": \"Databricks Monitoring\",\n            \"panels\": [\n                {\n                    \"title\": \"Job Success Rate\",\n                    \"type\": \"timeseries\",\n                    \"targets\": [{\n                        \"rawSql\": \"\"\"\n                            SELECT\n                                start_time as time,\n                                success_rate\n                            FROM monitoring.job_health_summary\n                        \"\"\"\n                    }]\n                },\n                {\n                    \"title\": \"Daily DBU Usage\",\n                    \"type\": \"bargauge\",\n                    \"targets\": [{\n                        \"rawSql\": \"\"\"\n                            SELECT date, total_dbus\n                            FROM monitoring.daily_costs\n                            WHERE date > current_date() - 7\n                        \"\"\"\n                    }]\n                }\n            ]\n        }\n    }\n```\n\n### Step 6: Integration with External Monitoring\n\n```python\n# src\u002Fmonitoring\u002Fexternal.py\nimport requests\nfrom dataclasses import dataclass\n\n@dataclass\nclass MetricPoint:\n    name: str\n    value: float\n    tags: dict\n    timestamp: int = None\n\nclass DatadogExporter:\n    \"\"\"Export metrics to Datadog.\"\"\"\n\n    def __init__(self, api_key: str, app_key: str):\n        self.api_key = api_key\n        self.app_key = app_key\n        self.base_url = \"https:\u002F\u002Fapi.datadoghq.com\u002Fapi\u002Fv2\"\n\n    def send_metrics(self, metrics: list[MetricPoint]):\n        \"\"\"Send metrics to Datadog.\"\"\"\n        series = []\n        for m in metrics:\n            series.append({\n                \"metric\": f\"databricks.{m.name}\",\n                \"points\": [[m.timestamp or int(time.time()), m.value]],\n                \"tags\": [f\"{k}:{v}\" for k, v in m.tags.items()]\n            })\n\n        response = requests.post(\n            f\"{self.base_url}\u002Fseries\",\n            headers={\n                \"DD-API-KEY\": self.api_key,\n                \"DD-APPLICATION-KEY\": self.app_key,\n            },\n            json={\"series\": series}\n        )\n        return response.status_code == 202\n\n# Usage\nexporter = DatadogExporter(api_key, app_key)\nexporter.send_metrics([\n    MetricPoint(\"job.duration_minutes\", 45.2, {\"job\": \"etl-pipeline\", \"env\": \"prod\"}),\n    MetricPoint(\"job.rows_processed\", 1000000, {\"job\": \"etl-pipeline\", \"env\": \"prod\"}),\n])\n```\n\n## Output\n- System table queries configured\n- Monitoring views created\n- SQL alerts active\n- Structured logging implemented\n- External integrations ready\n\n## Error Handling\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| System tables unavailable | Feature not enabled | Contact admin to enable |\n| Alert not triggering | Wrong schedule | Check cron expression |\n| Missing metrics | Query timeout | Optimize query or increase warehouse |\n| High cardinality | Too many tags | Reduce label dimensions |\n\n## Examples\n\n### Quick Health Check Query\n```sql\nSELECT\n    job_name,\n    success_rate,\n    avg_duration_minutes,\n    last_run_time\nFROM monitoring.job_health_summary\nWHERE success_rate \u003C 95\nORDER BY success_rate ASC;\n```\n\n## Resources\n- [Databricks System Tables](https:\u002F\u002Fdocs.databricks.com\u002Fadministration-guide\u002Fsystem-tables\u002Findex.html)\n- [SQL Alerts](https:\u002F\u002Fdocs.databricks.com\u002Fsql\u002Fuser\u002Falerts\u002Findex.html)\n- [Dashboards](https:\u002F\u002Fdocs.databricks.com\u002Fsql\u002Fuser\u002Fdashboards\u002Findex.html)\n\n## Next Steps\nFor incident response, see `databricks-incident-runbook`.\n",{"name":5,"author":47,"license":15,"version":48,"description":49,"allowed-tools":50},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Set up comprehensive observability for Databricks with metrics, traces, and alerts.\nUse when implementing monitoring for Databricks jobs, setting up dashboards,\nor configuring alerting for pipeline health.\nTrigger with phrases like \"databricks monitoring\", \"databricks metrics\",\n\"databricks observability\", \"monitor databricks\", \"databricks alerts\", \"databricks logging\".\n","Read, Write, Edit, Bash(databricks:*)","main","90b50ed0778745a80fd5bfb13b1843d45b9e82f7","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fdatabricks-pack\u002Fskills\u002Fdatabricks-observability",233,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust","https:\u002F\u002Fgithub.com\u002FDicklesworthstone","https:\u002F\u002Fwww.jeffreyemanuel.com\u002F","Building in NY","2026-11-15 01:54:15",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill databricks-observability",{"tool":66,"command":67},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill databricks-observability",{"tool":69,"command":70},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill databricks-observability","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fdatabricks-pack\u002Fskills\u002Fdatabricks-observability\u002FSKILL.md",true,[],[75,108,142,165,190,217],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":88,"publishedAt":107},"01M6FCR7G5A005P364Z6ZWCJDP","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FSKILL.md",[83],{"categoryNo":84,"categoryName":85,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",[89,90,91,92,93,94,95,35,96,97,98,99,100,101,102,103,104,105,106],"theme factory","factory","theme","docs","toolkit","generate","artifacts","fly","slides","landing","html","styling","artifact","pages","themes","with","you","fonts","2026-11-11 15:11:14",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":112,"sourceHtmlUrl":113,"categories":114,"keywords":118,"publishedAt":42},"01M6FEGPPK0ZTKCCM0R3E3KS33","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[115],{"categoryNo":116,"categoryName":117,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000009","前端开发",[119,120,95,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,30,99,136,137,138,139,24,140,141],"web artifacts builder","web","artifacts builder","builder","frontend","css","components","react","component","routing","state management","state","shadcn","file","ui","Tools","Tailwind","single-file","simple","ui components","multi","jsx","suite",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":146,"sourceHtmlUrl":147,"categories":148,"keywords":153,"publishedAt":42},"01M6FEE9VTK1W4GY21AKREJXRG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[149,152],{"categoryNo":150,"categoryName":151,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":116,"categoryName":117,"taxonomyType":86,"taxonomyTypeDesc":87},[154,155,156,123,157,158,120,159,93,160,133,161,162,163,164,104,24],"testing","webapp testing","webapp","screenshots","playwright","debugging","browser","logs","applications","behavior","local",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":169,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":42},"01M6FE20F7ZTQBFWKF4MPJ2SBX","neuropixels-analysis","Neuropixels neural recording analysis. Load SpikeGLX\u002FOpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen\u002FIBL curation, AI-assisted visual analysis, for Neuropixels 1.0\u002F2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FSKILL.md",[],[173,174,175,39,176,177,178,179,30,180,181,182,183,184,185,186,104,187,188,189,24,23],"analysis","neuropixels analysis","spike","data","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":194,"sourceHtmlUrl":195,"categories":196,"keywords":200,"publishedAt":42},"01M6FDP0PDK6F1GGX395C7625Z","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[197],{"categoryNo":198,"categoryName":199,"taxonomyType":86,"taxonomyTypeDesc":87},"01JBSEEDCAT000000000000023","Skill与智能体开发",[201,202,203,204,205,206,207,208,209,210,211,212,213,214,104,24,215,23,216],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","integrations","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":218,"name":219,"nameZh":6,"description":220,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":221,"sourceHtmlUrl":222,"categories":223,"keywords":225,"publishedAt":42},"01M6FDM8Y7VK7NYG9SM7QPA3PW","notebooklm","Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FSKILL.md",[224],{"categoryNo":198,"categoryName":199,"taxonomyType":86,"taxonomyTypeDesc":87},[219,226,227,228,229,230,231,160,232,233,30,234,235,236,237,24,238],"google","browser automation","gemini","automation","auth","code","library","management","only","document","query","Citation","source"]