• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / fuel-prices-api / 22685973199 / 1
50%
main: 50%

Build:
DEFAULT BRANCH: main
Ran 04 Mar 2026 07:38PM UTC
Files 17
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Mar 2026 07:37PM UTC coverage: 18.796% (-1.0%) from 19.786%
22685973199.1

push

github

web-flow
feat: add prometheus metrics for api client (#21)

* feat: add prometheus metrics for api client

Add monitoring for the GOV.UK fuel finder API client using Prometheus.
This allows tracking request latency and status codes to ensure
reliability and performance visibility.

-   Introduces `ClientFetchMetrics` to manage Prometheus collectors.
-   Tracks `fuel_prices_govuk_api_http_response_latency_seconds`.
-   Tracks `fuel_prices_govuk_api_http_response_status_codes_total`.
-   Instruments `GET` and `POST` methods in `fuelPricesManager`.

```mermaid
sequenceDiagram
    participant C as FuelPricesClient
    participant M as ClientFetchMetrics
    participant A as GOV.UK API
    C->>C: Start timer
    C->>A: Execute HTTP request
    A-->>C: Return response/error
    C->>M: Record(duration, method, path, status)
```

* feat: track total items fetched via metrics

Introduces a new Prometheus counter to monitor the volume of records
retrieved from the GOV.UK fuel finder API. This provides better
observability into data ingestion performance and volume.

The change also refactors existing HTTP instrumentation to pass the
full response object, improving encapsulation of metric recording.

*   Added `fuel_prices_govuk_api_items_fetched_total` counter.
*   Renamed `Record` to `RecordHttpCall` in `ClientFetchMetrics`.
*   Integrated item count recording into the batched fetch loop.

```mermaid
sequenceDiagram
    participant C as Client
    participant M as Metrics
    participant A as API

    C->>A: HTTP Request
    A-->>C: Response
    C->>M: RecordHttpCall(method, path, resp)

    loop Batched Fetch
        C->>A: Get Batch
        A-->>C: Records
        C->>M: RecordFetchedItems(path, count)
    end
```

203 of 1080 relevant lines covered (18.8%)

0.2 hits per line

Source Files on job 22685973199.1
  • Tree
  • List 17
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 22685973199
  • 38213d00 on github
  • Prev Job for on main (#22683049857.1)
  • Next Job for on main (#22688039815.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc