Skip to content

Conversation

@msrathore-db
Copy link
Contributor

@msrathore-db msrathore-db commented Oct 26, 2025

Summary

Adds Activity-based logging to RetryHttpHandler.cs for improved observability of HTTP retry behavior.

Changes

Logging Strategy

  • No logging for successful first-attempt requests (most common case ~99%)
  • Per-attempt logging when retries occur
  • Exception logging with context for failures

What Gets Logged

Tags (When Retries Occur):

  1. http.retry.attempt - Current attempt number (logged per retry)
  2. http.retry.total_attempts - Total number of retry attempts
  3. http.response.status_code - HTTP status code
  4. http.retry.outcome - Only for failures: cancelled or timeout_exceeded

Exception Context (On Failures):

  • error.context - Failure reason (http.retry.cancelled or http.retry.timeout_exceeded)
  • attempts - Number of attempts made
  • total_retry_seconds / timeout_seconds - Timing information (timeout cases only)

Retryable Status Codes: 408, 502, 503, 504

Example Log Output

Success (No Retries):

// NO LOGGING - Most efficient path

Success After Retries:

{
  "Tags": {
    "http.retry.attempt": 1,
    "http.response.status_code": 503,
    "http.retry.attempt": 2,
    "http.response.status_code": 503,
    "http.retry.total_attempts": 2,
    "http.response.status_code": 200
  }
}

Timeout Exceeded:

{
  "Tags": {
    "http.retry.total_attempts": 3,
    "http.response.status_code": 503,
    "http.retry.outcome": "timeout_exceeded"
  },
  "Exception": {
    "error.context": "http.retry.timeout_exceeded",
    "attempts": 3,
    "total_retry_seconds": 7,
    "timeout_seconds": 30
  }
}

Testing

Tested locally with log output.

Breaking Changes

None. Additive logging only.

@github-actions github-actions bot added this to the ADBC Libraries 21 milestone Oct 26, 2025
@msrathore-db msrathore-db changed the title feat(csharp/src/Drivers/Databricks): Add ultra-minimal Activity-based logging to RetryHttpHandler feat(csharp/src/Drivers/Databricks): Add minimal Activity-based logging to RetryHttpHandler Oct 26, 2025
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.

1 participant