Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

telemetry: Log error reason for failure to get SQL Metric (#40778) #41138

Merged

Commits on Feb 7, 2023

  1. Configuration menu
    Copy the full SHA
    6381636 View commit details
    Browse the repository at this point in the history
  2. telemetry: Use zap.Error() instead of err.Error()

    With JSON formatted logs:
    ```
    $ jq 'select(.error) | select(.error | contains("Prometheus"))' tidb.log
    {
      "level": "INFO",
      "time": "2023/01/27 10:00:35.554 +01:00",
      "caller": "data_slow_query.go:67",
      "message": "Failed to get Slow Query Stats",
      "error": "[domain:9009]Prometheus address is not set in PD and etcd"
    }
    {
      "level": "INFO",
      "time": "2023/01/27 10:01:36.223 +01:00",
      "caller": "data_window.go:257",
      "message": "Error exists when getting the SQL Metric.",
      "error": "[domain:9009]Prometheus address is not set in PD and etcd"
    }
    {
      "level": "INFO",
      "time": "2023/01/27 10:02:36.225 +01:00",
      "caller": "data_window.go:257",
      "message": "Error exists when getting the SQL Metric.",
      "error": "[domain:9009]Prometheus address is not set in PD and etcd"
    }
    ```
    dveeden authored and ti-chi-bot committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    1c5dea8 View commit details
    Browse the repository at this point in the history