{"insertId":"0000000000","jsonPayload":{"message":"DTS transfer run message."},"resource":{"type":"bigquery_dts_config","labels":{"project_id":"my_project_id","config_id":"transfer_config_id","location":"us"}},"timestamp":"2020-11-25T04:45:48.545732221Z","severity":"INFO","labels":{"run_id":"transfer_run_id"},"logName":"projects/your_project_id/logs/bigquerydatatransfer.googleapis.com%2Ftransfer_config","receiveTimestamp":"2020-11-25T04:45:48.960214929Z"}
记录的内容
BigQuery Data Transfer Service 日志条目包含对监控和调试转移作业运行有用的信息。日志条目包含以下类型的信息:
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-04-21。"],[[["\u003cp\u003eBigQuery Data Transfer Service provides monitoring and logging features to track workload performance and status, exporting monitoring data to Cloud Monitoring.\u003c/p\u003e\n"],["\u003cp\u003eMonitoring metrics can be utilized to evaluate performance, troubleshoot problems, and track transfer run statuses via the Google Cloud console or Monitoring API.\u003c/p\u003e\n"],["\u003cp\u003eCloud Monitoring alerts and custom dashboards can be defined for BigQuery Data Transfer Service metrics, with metrics being exported in batches at 1-minute intervals and retained for 6 weeks.\u003c/p\u003e\n"],["\u003cp\u003eBigQuery Data Transfer Service logs each run, providing detailed information for monitoring and debugging, accessible through the Logs Explorer.\u003c/p\u003e\n"],["\u003cp\u003eLogs can be filtered by transfer configuration ID or run ID, or viewed in their entirety, and the log format includes details such as timestamp, severity, and a message explaining the transfer run status.\u003c/p\u003e\n"]]],[],null,["# Monitor and view logs for BigQuery Data Transfer Service\n========================================================\n\nBigQuery Data Transfer Service [monitoring](#monitor) and [logging](#logs) provide\ninformation about the service's workload performance and status.\nBigQuery Data Transfer Service exports monitoring data to\n[Cloud Monitoring](/monitoring/docs).\n\nMonitor BigQuery Data Transfer Service\n--------------------------------------\n\nYou can use monitoring metrics for the following purposes:\n\n- Evaluate the usage and performance a data transfer configuration.\n- Troubleshoot problems.\n- Monitor transfer run statuses.\n\nTo create custom dashboards, set up alerts, and query metrics with\nMonitoring, you can use the Google Cloud console or the\n[Monitoring API](/monitoring/api).\n\n### View transfer data in Metrics Explorer\n\n1. In the Google Cloud console, go to the **Monitoring** page.\n\n [Go to Monitoring](https://console.cloud.google.com/monitoring)\n2. In the navigation pane, click **Metrics Explorer**.\n\n3. Select your project.\n\n4. In the **Find resource type and metric** box, enter the following:\n\n - For **Resource type** , enter `BigQuery DTS Config`.\n - For **Metric** , select one of the metrics listed in [Monitoring metrics for transfer configurations](#monitor_metrics_for_transfer_configurations), for example,\n `Completed run count`.\n\n5. Optional: Select aligner, reducer, and other parameters.\n\n6. The metrics are displayed in the **Metrics explorer** window.\n\n### Define Cloud Monitoring alerts\n\nYou can define [Monitoring alerts](/monitoring/alerts) for\nBigQuery Data Transfer Service metrics:\n\n1. In the Google Cloud console, go to the **Monitoring** page.\n\n [Go to Monitoring](https://console.cloud.google.com/monitoring)\n2. In the navigation pane, select **Alerting \\\u003e Create policy**.\n\n For more information about alerting policies and concepts behind them, see\n [Types of alerting policies](/monitoring/alerts/types-of-conditions).\n3. Click **Add Condition** and select a condition type.\n\n4. Select metrics and filters. For metrics, the resource type is **BigQuery DTS\n Config**.\n\n5. Click **Save Condition**.\n\n6. Enter policy name, and then click **Save Policy**.\n\nFor more information about alerting policies and concepts, see\n[Introduction to alerting](/monitoring/alerts).\n\n### Define Cloud Monitoring custom dashboards\n\nYou can create custom dashboards over BigQuery Data Transfer Service metrics:\n\n1. In the Google Cloud console, go to the **Monitoring** page.\n\n [Go to Monitoring](https://console.cloud.google.com/monitoring)\n2. In the navigation pane, select **Dashboards \\\u003e Create Dashboard**.\n\n3. Click **Add Chart**.\n\n4. Give the chart a title.\n\n5. Select metrics and filters. For metrics, the resource type is **BigQuery DTS\n Config**.\n\n6. Click **Save**.\n\nFor more information, see [Manage custom dashboards](/monitoring/charts/dashboards).\n\n### Metric reporting frequency and retention\n\nMetrics for BigQuery Data Transfer Service runs are exported to Monitoring in\nbatches, at 1-minute intervals. Monitoring data is retained for 6 weeks.\n\nThe dashboard provides data analysis in default intervals of `1h` (1 hour), `6H`\n(6 hours), `1D` (1 day), `1W` (1 week), and `6W` (6 weeks). You can manually\nrequest analysis in any interval between `1M` (1 minute) to `6W` (6 weeks).\n\n### Monitor metrics for transfer configurations\n\nThe following metrics for BigQuery Data Transfer Service configs are exported to\nMonitoring:\n\n### Filter dimensions for metrics\n\nMetrics are aggregated for each BigQuery Data Transfer Service configuration. You\ncan filter aggregated metrics by the following dimensions:\n\nBigQuery Data Transfer Service logs\n-----------------------------------\n\nEach BigQuery Data Transfer Service run is logged using [Cloud Logging](/logging/docs).\nLogging is automatically enabled for all data transfers.\n\n### Required roles\n\nThe Logs Viewer role (`roles/logging.viewer`) gives you read-only access to all\nfeatures of Logging. For more information about the\nIdentity and Access Management (IAM) permissions and roles that apply to\nLogging data, see the [Logging access control\nguide](/logging/docs/access-control).\n\n### View logs\n\nTo view logs, go to the **Logs Explorer** page.\n\n[Go to Logs Explorer](https://console.cloud.google.com/logs)\n\nBigQuery Data Transfer Service logs are indexed first by the transfer configuration and\nthen by the individual transfer run.\n\n#### View transfer run logs\n\nTo show only the log entries from a given transfer `run_id`, in the **Query\nbuilder**, add the following filters: \n\n```googlesql\nresource.type=\"bigquery_dts_config\"\nlabels.run_id=\"\u003cvar translate=\"no\"\u003etransfer_run_id\u003c/var\u003e\"\n```\n\n#### View transfer configuration logs\n\nTo show log entries from a given transfer `config_id`, in the **Query builder**,\nadd the following filters: \n\n```googlesql\nresource.type=\"bigquery_dts_config\"\nresource.labels.config_id=\"\u003cvar translate=\"no\"\u003etransfer_config_id\u003c/var\u003e\"\n```\n\n#### View all logs\n\nTo see all BigQuery Data Transfer Service logs, do one of the following:\n\n- In the **Fields** pane, for **Resource type** , select **BigQuery DTS\n Config**.\n\n- In the **Query builder**, add the following filter:\n\n ```googlesql\n resource.type=\"bigquery_dts_config\"\n ```\n\nFor more information about how to use the Log Explorer, see\n[Using the Log Explorer](/logging/docs/view/logs-explorer-interface).\n\n### Log format\n\nBigQuery Data Transfer Service logs messages in the following format: \n\n```googlesql\n{\n \"insertId\": \"0000000000\",\n \"jsonPayload\": {\n \"message\": \"DTS transfer run message.\"\n },\n \"resource\": {\n \"type\": \"bigquery_dts_config\",\n \"labels\": {\n \"project_id\": \"my_project_id\",\n \"config_id\": \"transfer_config_id\",\n \"location\": \"us\"\n }\n },\n \"timestamp\": \"2020-11-25T04:45:48.545732221Z\",\n \"severity\": \"INFO\",\n \"labels\": {\n \"run_id\": \"transfer_run_id\"\n },\n \"logName\": \"projects/your_project_id/logs/bigquerydatatransfer.googleapis.com%2Ftransfer_config\",\n \"receiveTimestamp\": \"2020-11-25T04:45:48.960214929Z\"\n}\n```\n\n### What is logged\n\nBigQuery Data Transfer Service log entries contain information that is useful for\nmonitoring and debugging your transfer runs. Log entries contain the following\ntypes of information:\n\n- `timestamp`: used to compute the log entry's age and to enforce the log's retention period\n- `severity`: can be `INFO`, `WARNING` or `ERROR`\n- `message_text`: holds a string that explains the current status of the transfer run\n\nWhat's next\n-----------\n\n- Learn more about [Monitoring](/monitoring).\n- Read an overview of [Cloud Audit Logs](/logging/docs/audit) and [Cloud Logging](/logging)."]]