NetCDF To Zarr: Observability
Goal
Add one domain-specific metric to the plugin from the first tutorial, run ingestion with a Prometheus Pushgateway, and inspect the exported metric.
Continue from NetCDF To Zarr. You will keep the same
plugin and add one metric through ctx.telemetry.
Prerequisites
- The completed Quickstart project in the current directory.
- Docker available with local port
9091free.
Start A Pushgateway
This tutorial uses Docker to run a temporary local Pushgateway:
Set its URL for the remaining commands:
Confirm that it is ready:
Expected output:
Add One Metric
In plugins_dev/firecube-weather-netcdf/src/firecube_weather_netcdf/ingestor.py,
add this block near the end of build_dataset, just before return result:
if ctx.telemetry is not None:
ctx.telemetry.emit(
"weather_netcdf_files",
len(items),
kind="counter",
meta={"group": group, "status": "success"},
)
counter is the right kind here because the value is a count that increases
during the run. Firecube exports it as:
Run The Plugin
PRODUCT_URI="file://$PWD/quickstart-output/weather_netcdf_observed.zarr"
firecube ingest weather_netcdf \
--input-data quickstart-data/weather-netcdf \
--target "$PRODUCT_URI" \
--product-name weather_netcdf_observed \
--storage-type local \
--storage-driver fsspec \
--output-format zarr \
--write-mode direct
Expected logs on stderr include:
Expected command output on stdout includes:
"plugin": "weather_netcdf"
...
"files_processed": 4
...
"count": 4
"product": "weather_netcdf_observed"
Verify The Product
python - <<'PY'
import xarray as xr
ds = xr.open_zarr(
"quickstart-output/weather_netcdf_observed.zarr",
group="default",
consolidated=False,
)
assert ds.sizes["timestamp"] == 4
print("ok")
PY
Expected output:
Verify The Metric
Firecube flushes buffered metrics at the end of the run. Query the Pushgateway and select the metric added above:
Expected output includes a sample with the value 4:
If the metric is absent, check the ingestion logs for Failed to push metrics
to Pushgateway, then confirm the configured URL is reachable from the Firecube
process.
Stop the tutorial Pushgateway when verification is complete:
Next Steps
- Metrics — understand metric kinds, labels, and Pushgateway behavior
- Add Plugin Telemetry — plugin telemetry rules
- Observability Reference — configure and inspect telemetry backends
- Sentinel-3 FRP To Parquet — download and ingest a real EUMETSAT product
- DirectZarrIngestor (Region) — continue to the advanced write path