Merge branch 'add-prometheus-metrics-endpoint'

From https://github.com/iv-org/invidious/pull/3576
This commit is contained in:
Fijxu
2025-03-01 03:39:04 -03:00
6 changed files with 99 additions and 0 deletions

View File

@@ -198,3 +198,11 @@ def get_playback_statistic
return tracker.as(Hash(String, Int64 | Float64))
end
def to_prometheus_metrics(metrics_struct : Hash(String, Number)) : String
return String.build do |str|
metrics_struct.each.each do |key, value|
str << key << " " << value << "\n"
end
end
end