mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-29 02:51:25 +00:00
Revert "Merge branch 'add-prometheus-metrics-endpoint'"
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled
This reverts commite5c0f15398due to https://github.com/iv-org/invidious/pull/3576#issuecomment-2727898574 , reversing changes made toecacbab2a5.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
require "../../../metrics.cr"
|
||||
|
||||
module Invidious::Routes::API::V1::Misc
|
||||
# Stats API endpoint for Invidious
|
||||
def self.stats(env)
|
||||
@@ -28,39 +26,6 @@ module Invidious::Routes::API::V1::Misc
|
||||
end
|
||||
end
|
||||
|
||||
def self.metrics(env)
|
||||
if !CONFIG.statistics_enabled
|
||||
env.response.status_code = 204
|
||||
return
|
||||
end
|
||||
|
||||
env.response.content_type = "text/plain"
|
||||
|
||||
return String.build do |str|
|
||||
Metrics::RouteMetricsCollector.num_of_request_counters.each do |metric_labels, value|
|
||||
str << "http_requests_total{"
|
||||
str << "method=\"" << metric_labels.request_method << "\" "
|
||||
str << "route=\"" << metric_labels.request_route << "\" "
|
||||
str << "response_code=\"" << metric_labels.response_code << "\""
|
||||
str << "} "
|
||||
str << value << "\n"
|
||||
end
|
||||
|
||||
Metrics::RouteMetricsCollector.request_duration_seconds_sums.each do |metric_labels, value|
|
||||
str << "http_request_duration_seconds_sum{"
|
||||
str << "method=\"" << metric_labels.request_method << "\" "
|
||||
str << "route=\"" << metric_labels.request_route << "\" "
|
||||
str << "response_code=\"" << metric_labels.response_code << "\""
|
||||
str << "} "
|
||||
str << value << "\n"
|
||||
end
|
||||
|
||||
Invidious::Jobs::StatisticsRefreshJob::STATISTICS_PROMETHEUS.each.each do |key, value|
|
||||
str << key << " " << value << "\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# APIv1 currently uses the same logic for both
|
||||
# user playlists and Invidious playlists. This means that we can't
|
||||
# reasonably split them yet. This should be addressed in APIv2
|
||||
|
||||
Reference in New Issue
Block a user