Skip to content

feat: implement Stellar Route Insights Exporter#574

Open
mftee wants to merge 2 commits into
MDTechLabs:mainfrom
mftee:feat/542-stellar-route-insights-exporter
Open

feat: implement Stellar Route Insights Exporter#574
mftee wants to merge 2 commits into
MDTechLabs:mainfrom
mftee:feat/542-stellar-route-insights-exporter

Conversation

@mftee

@mftee mftee commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implements a standalone Stellar Route Insights Exporter under src/exporters/routes/stellar/
  • Aggregates per-route metrics and recommendation insights from the bridging system
  • Supports three common export formats: JSON, CSV, and Prometheus text exposition

Changes

  • src/exporters/routes/stellar/index.ts — Full exporter implementation including:
    • RouteMetric and RecommendationInsight type definitions
    • StellarRouteInsightsExporter class with ingestion, snapshot, and export methods
    • toJSON() / toJSONObject() — structured JSON export
    • toCSV(options) — configurable CSV export for routes and/or insights (delimiter, header, dataset selection)
    • toPrometheus() — Prometheus text exposition with per-route gauges and recommendation sub-scores
    • export(format, options) — unified entry point for all formats
    • stellarRouteInsights singleton export for shared app-wide usage

Export Formats

Format Method Description
JSON toJSON() / toJSONObject() Full snapshot with routes + insights
CSV toCSV({ dataset, delimiter }) Routes, insights, or both; configurable delimiter
Prometheus toPrometheus() Per-route gauges + recommendation sub-scores

Test plan

  • CI build passes (pnpm run build)
  • registerRoutes() and registerInsights() correctly upsert entries
  • toJSON() returns a valid, parseable snapshot
  • toCSV({ dataset: 'routes' }) produces correct headers and rows
  • toCSV({ dataset: 'insights' }) produces correct headers and rows
  • toCSV({ dataset: 'both' }) combines both datasets
  • toPrometheus() renders valid Prometheus text format with correct labels
  • export('json' | 'csv' | 'prometheus') delegates to the correct method
  • clear() resets all tracked data

closes #542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Stellar Route Insights Exporter

1 participant