Skip to content

Connection errors to unauthenticated telemetry endpoint #619

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

Draft
wants to merge 4 commits into
base: telemetry
Choose a base branch
from

Conversation

saishreeeee
Copy link
Collaborator

@saishreeeee saishreeeee commented Jun 27, 2025

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

Send error logs to the unauthenticated telemetry endpoint in case of connection/authentication errors (before TelemetryClient initialization)

How is this tested?

  • Unit tests

  • E2E Tests

  • Manually
    Tried to establish a connection with an invalid access token

      === Request Details ===
      URL: https://e2-dogfood.staging.cloud.databricks.com/telemetry-unauth
      
      Headers:
        Accept: application/json
        Content-Type: application/json
      
      Request Body Summary:
        uploadTime: 1751006386604
        items: 0 items
        protoLogs: 1 logs
      
      === Proto Logs Details ===
      
      Proto Log #1:
      {
        "frontend_log_event_id": "15cd988b-55bc-4a97-9e0b-05f6981a8487",
        "context": {
          "client_context": {
            "timestamp_millis": 1751006386604,
            "user_agent": "PyDatabricksSqlConnector/4.0.5"
          }
        },
        "entry": {
          "sql_driver_log": {
            "system_configuration": {
              "driver_version": "4.0.5",
              "os_name": "Darwin",
              "os_version": "24.5.0",
              "os_arch": "arm64",
              "runtime_name": "Python 3.11.13",
              "runtime_version": "3.11.13",
              "runtime_vendor": "CPython",
              "driver_name": "Databricks SQL Python Connector",
              "char_set_encoding": "utf-8",
              "locale_name": "en_US"
            },
            "driver_connection_params": {
              "http_path": "/sql/1.0/warehouses/864004c1b3961382",
              "mode": "THRIFT",
              "host_info": {
                "host_url": "e2-dogfood.staging.cloud.databricks.com",
                "port": 443
              }
            },
            "error_info": {
              "error_name": "ConnectionError",
              "stack_trace": "Failed to establish connection: Error during request to server: : Invalid access token.. "
            }
          }
        }
      }
      
      === Response Details ===
      Status Code: 200
      
      Response Body:
      {
        "errors": [],
        "numSuccess": 0,
        "numProtoSuccess": 1,
        "numRealtimeSuccess": 0
      }
    
  • N/A

Related Tickets & Documents

Signed-off-by: Sai Shree Pradhan <[email protected]>
Signed-off-by: Sai Shree Pradhan <[email protected]>
@saishreeeee saishreeeee changed the title Connection errors in telemetry Connection errors to unauthenticated telemetry endpoint Jun 30, 2025
}

url = f"https://{host_url}/telemetry-unauth"
headers = {"Accept": "application/json", "Content-Type": "application/json"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think a lot of this is repetitive from _send_telemetry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants