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

rm-hull / fuel-prices-api / 22685973199
46%

Build:
DEFAULT BRANCH: main
Ran 04 Mar 2026 07:38PM UTC
Jobs 1
Files 17
Run time 1min
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

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
```

0 of 56 new or added lines in 2 files covered. (0.0%)

203 of 1080 relevant lines covered (18.8%)

0.2 hits per line

Uncovered Changes

Lines Coverage ∆ File
48
0.0
internal/metrics.go
8
0.0
0.0% internal/client_fetch.go
Jobs
ID Job ID Ran Files Coverage
1 22685973199.1 04 Mar 2026 07:38PM UTC 17
18.8
GitHub Action Run
Source Files on build 22685973199
  • Tree
  • List 17
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 38213d00 on github
  • Prev Build on main (#22683049857)
  • Next Build on main (#22688039815)
  • 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