Skip to content

Add WARN-level logging for data_services_api retry attempts #347

Description

@joescottdave

Background

This app does not currently log anything when the
DataServicesApi::Service Faraday retry middleware retries a request: if a retry eventually succeeds, that
attempt is invisible in the logs.

Retries are now configurable via retry_block options after adopting the latest
data_services_api version that added HTTP retry support (ppd-explorer: #343).

Task

  • In the app's DataService model, pass connection_failed_retry_options and
    timeout_retry_options to DataServicesApi::Service.new, each with a retry_block
    that logs a WARN-level line per retry attempt (app name, exception class/message,
    attempt number, delay before retry, request path).
  • Follow the org JSON logging conventions (see logging standard / Ops wiki) for field
    names: use request_status: 'processing' and path to match the existing
    ERROR-level log shape from ApiPrometheusSubscriber.
  • Add a unit test on the retry_block (see ukhpi's test/models/concerns/data_service_test.rb
    for reference).
  • Update CHANGELOG.md.
  • Capture example log output for a real retry (e.g. via rails runner reproduction)
    to confirm the shape in Kibana.

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions