Merge remote-tracking branch 'parent/main' into upstream-20250328

This commit is contained in:
KMY 2025-03-28 08:44:30 +09:00
commit 12ed20b6d5
257 changed files with 3505 additions and 2010 deletions

View file

@ -1,8 +1,10 @@
# frozen_string_literal: true
if ENV['MASTODON_PROMETHEUS_EXPORTER_ENABLED'] == 'true'
require 'prometheus_exporter'
require 'prometheus_exporter/middleware'
if ENV['MASTODON_PROMETHEUS_EXPORTER_LOCAL'] == 'true'
require 'prometheus_exporter'
require 'prometheus_exporter/server'
require 'prometheus_exporter/client'
@ -17,9 +19,11 @@ if ENV['MASTODON_PROMETHEUS_EXPORTER_ENABLED'] == 'true'
if ENV['MASTODON_PROMETHEUS_EXPORTER_WEB_DETAILED_METRICS'] == 'true'
# Optional, as those metrics might generate extra overhead and be redundant with what OTEL provides
require 'prometheus_exporter/middleware'
# Per-action/controller request stats like HTTP status and timings
Rails.application.middleware.unshift PrometheusExporter::Middleware
else
# Include stripped down version of PrometheusExporter::Middleware that only collects queue time
require 'mastodon/middleware/prometheus_queue_time'
Rails.application.middleware.unshift Mastodon::Middleware::PrometheusQueueTime, instrument: false
end
end