// Copyright {{.Year}} Conductor OSS
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
//! HTTP client metrics observer trait.
//!
//! The [`ApiClient`](super::ApiClient) invokes a trait object of
//! [`HttpMetricsObserver`] on every outbound request so that instrumentation
//! (e.g. the [`MetricsCollector`](crate::metrics::MetricsCollector) from the
//! `metrics` module) can record `http_api_client_request_seconds` without the
//! HTTP layer depending on the metrics layer.
//!
//! The `uri` value passed to [`HttpMetricsObserver::observe`] is a
//! bounded-cardinality **path template** (e.g. `/tasks/poll/batch/{taskType}`)
//! rather than the interpolated request path. The server base-path prefix
//! (e.g. `/api`) is not included.
use Duration;
/// Observer invoked by [`ApiClient`](super::ApiClient) after every request
/// completes (either with a response or a transport error).
///
/// Implementations should be fast and non-blocking — the observer runs on the
/// request hot-path.