Skip to content

Commit

Permalink
internal/exporter: expose Dish mobility class (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuasing authored Jan 12, 2025
1 parent 500fa66 commit 4d0e746
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/exporter/desc.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var (
"country_code",
"utc_offset",
"boot_count",
"mobility_class",
},
}
dishUptimeSeconds = Desc{
Expand All @@ -75,6 +76,12 @@ var (
Name: "uptime_seconds",
Help: "Starlink dish uptime in seconds",
}
dishMobilityClass = Desc{
Namespace: namespace,
Subsystem: dishSubsystem,
Name: "mobility_class",
Help: "Starlink dish mobility class",
}

// Signal-to-noise ratio
dishSnrAboveNoiseFloor = Desc{
Expand Down
7 changes: 7 additions & 0 deletions internal/exporter/scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func (e *Exporter) scrapeDishStatus(ctx context.Context, ch chan<- prometheus.Me
deviceInfo.GetCountryCode(),
itos(deviceInfo.GetUtcOffsetS()),
itos(deviceInfo.GetBootcount()),
dishStatus.GetMobilityClass().String(),
)

// starlink_dish_uptime_seconds
Expand All @@ -138,6 +139,12 @@ func (e *Exporter) scrapeDishStatus(ctx context.Context, ch chan<- prometheus.Me
float64(deviceState.GetUptimeS()),
)

// starlink_dish_mobility_class
ch <- prometheus.MustNewConstMetric(
dishMobilityClass.Desc(), prometheus.GaugeValue,
float64(dishStatus.GetMobilityClass()),
)

// starlink_dish_pop_ping_latency_seconds
ch <- prometheus.MustNewConstMetric(
dishPopPingLatencySeconds.Desc(), prometheus.GaugeValue,
Expand Down

0 comments on commit 4d0e746

Please sign in to comment.