M2M: history — role-mix snapshots and infra-node health history

Open
#424 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
openapi
Domain
analytics, api

Research direction

This depends on #421 and #423, so read those first and the existing StatsSnapshot collectors they build on. The work touches openapi-m2m.yaml, docs/features/packet-stats/, docs/RECENCY.md, the timeseries endpoint, and the DeviceMetrics source for the infra-node health route. Done means the new snapshot types and health endpoint exist, the backfill is idempotent, UTC bucket boundaries and m2m_opt_out are covered by tests, and the docs match.

Written by the indexing model from the issue text.

Description

enhancement

Part of pskillen/meshflow-api#416. Later phase; depends on #421 and #423.

Scope

  • Role-mix snapshots
    • New hourly StatsSnapshot types: nodes_by_role (Meshtastic) and mc_nodes_by_type (MeshCore). Global and per constellation, collected alongside online_nodes.
    • Add a backfill.
    • Expose via …/timeseries?metric=nodes_by_role, with a value dict per point.
  • Infra-node health history
    • GET /api/m2m/v1/meshtastic/infra-nodes/{id}/health?from=&to=&interval=hour|day, from DeviceMetrics.
    • Downsampled with UTC buckets (average battery, voltage, channel util, air util tx).
    • Range cap 31 days.
    • Respects m2m_opt_out.
  • MeshCore equivalent once MeshCore telemetry is ingested.

Docs and tests

  • openapi-m2m.yaml, docs/features/packet-stats/ (new snapshot types), docs/RECENCY.md.
  • Tests:
    • Collector correctness and idempotency.
    • Downsampling bucket boundaries in UTC.
    • Opt-out respected.
Dominant language
Python
Stars
1
Forks
0
Avg merge
1d 20h
Merged PRs (30d)
5

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pskillen/meshflow-api

All issues in pskillen/meshflow-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.