A Prometheus exporter for live electricity consumption data from Octopus Energy, using the Kraken GraphQL API.
Find a file
2026-04-24 20:57:47 +01:00
.github/workflows major: PR check and release tweaks (#3) 2026-04-22 21:09:24 +01:00
cmd/octopus_exporter major: initial release (#4) 2026-04-23 21:03:28 +01:00
.gitignore major: PR check and release tweaks (#3) 2026-04-22 21:09:24 +01:00
Dockerfile fix: fix certs (#5) 2026-04-24 20:46:25 +01:00
go.mod initial 2026-04-22 20:33:31 +01:00
go.sum initial 2026-04-22 20:33:31 +01:00
README.md chore: update readme (#6) 2026-04-24 20:57:47 +01:00

octopus_exporter

A Prometheus exporter for Octopus Energy smart meter data, using the Kraken GraphQL API.

Metrics

Electricity

Metric Description
octopus_electricity_demand_watts Live electricity demand in watts
octopus_electricity_last_read_timestamp Unix timestamp of last electricity reading
octopus_electricity_unit_rate_pence Current unit rate in pence per kWh
octopus_electricity_standing_charge_pence Current standing charge in pence per day

Gas

Gas metrics are only exposed if a smart gas meter is found on the account.

Metric Description
octopus_gas_demand_watts Live gas demand in watts
octopus_gas_last_read_timestamp Unix timestamp of last gas reading
octopus_gas_unit_rate_pence Current unit rate in pence per kWh
octopus_gas_standing_charge_pence Current standing charge in pence per day

Account

Metric Description
octopus_account_balance_pence Account balance in pence (positive = credit, negative = debit)

Metrics are updated every 60 seconds.

Configuration

Variable Required Description
OCTOPUS_API_KEY Yes Your Octopus Energy API key
OCTOPUS_MPAN No Filter electricity meter by MPAN
OCTOPUS_SERIAL No Filter electricity meter by serial number
OCTOPUS_DEVICE_ID No Use a specific electricity smart device ID directly
OCTOPUS_GAS_MPRN No Filter gas meter by MPRN
OCTOPUS_GAS_SERIAL No Filter gas meter by serial number
OCTOPUS_GAS_DEVICE_ID No Use a specific gas smart device ID directly
PORT No Port to expose metrics on (default: 9359)

If no filter variables are set, the exporter auto-discovers the first smart meter of each type found on the account. Use OCTOPUS_MPAN / OCTOPUS_MPRN to pin to a specific meter on accounts with multiple meters.

Your API key can be found in the Octopus Energy developer dashboard.

Docker

docker run -d \
  -e OCTOPUS_API_KEY=sk_live_... \
  -e OCTOPUS_MPAN=1234567890123 \
  -p 9359:9359 \
  rwejlgaard/octopus_exporter

Running from source

Requires Go 1.22+.

git clone https://github.com/rwejlgaard/octopus_exporter
cd octopus_exporter
OCTOPUS_API_KEY=sk_live_... go run ./cmd/octopus_exporter

Prometheus configuration

scrape_configs:
  - job_name: octopus
    static_configs:
      - targets: ['localhost:9359']

Building

go build ./cmd/octopus_exporter
docker build -t rwejlgaard/octopus_exporter .