diff --git a/config/config.exs b/config/config.exs index 9a10b0ff7..e13257fb6 100644 --- a/config/config.exs +++ b/config/config.exs @@ -239,7 +239,8 @@ config :pleroma, :instance, welcome_message: nil, max_report_comment_size: 1000, safe_dm_mentions: false, - healthcheck: false + healthcheck: false, + instrumentation: false config :pleroma, :app_account_creation, enabled: true, max_requests: 25, interval: 1800 diff --git a/docs/config.md b/docs/config.md index 450d73fda..868d66872 100644 --- a/docs/config.md +++ b/docs/config.md @@ -104,6 +104,7 @@ config :pleroma, Pleroma.Emails.Mailer, * `max_report_comment_size`: The maximum size of the report comment (Default: `1000`) * `safe_dm_mentions`: If set to true, only mentions at the beginning of a post will be used to address people in direct messages. This is to prevent accidental mentioning of people when talking about them (e.g. "@friend hey i really don't like @enemy"). (Default: `false`) * `healthcheck`: if set to true, system data will be shown on ``/api/pleroma/healthcheck``. +* `instrumentation`: enable instrumenters for Prometheus metrics ## :app_account_creation REST API for creating an account settings diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index eeb415084..1b71896dc 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -25,7 +25,10 @@ defmodule Pleroma.Application do import Cachex.Spec Pleroma.Config.DeprecationWarnings.warn() - setup_instrumenters() + + if Pleroma.Config.get([:instance, :instrumentation]) do + setup_instrumenters() + end # Define workers and child supervisors to be supervised children =