Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • kn-fix-migration-context
  • sh-limit-praefect-connection-age
  • ec/raft-snapshotting-streaming
  • qmnguyen0711/backfill-missing-fsync-when-writing-manifest
  • qmnguyen0711/integrate-etcd-raft-with-transactions-v2
  • eju/gitaly/6506/6640/prepare-offloading
  • activate-bundle-uri-generation
  • jc/my-branch
  • mbayar/bump-minimum-go-version
  • 6270-restore-partition
  • 6628-persistent-routing-table
  • jliu/bump-module-version-to-v17
  • mb-fix-crypto-vuln
  • 17-7-stable protected
  • 17-8-stable protected
  • 17-9-stable protected
  • feat/repo-assignment-migration
  • gitaly-renovate-tools/golangci-lint/golang.org-x-tools-0.x
  • 6626-dry-run-reftable-migration-on-staging
  • v17.7.6 protected
  • v17.8.4 protected
  • v17.9.1 protected
  • v17.8.3 protected
  • v17.7.5 protected
  • v17.9.0 protected
  • v17.9.0-rc42 protected
  • v17.6.5 protected
  • v17.7.4 protected
  • v17.8.2 protected
  • v17.6.4 protected
  • v17.7.3 protected
  • v17.8.1 protected
  • v17.8.0 protected
  • v17.7.2 protected
  • v17.8.0-rc42 protected
  • v17.5.5 protected
  • v17.6.3 protected
  • v17.7.1 protected
  • v17.7.0 protected
40 results

subcmd_remove_repository_test.go

  • John Cai's avatar
    e53840b2
    praefect: Add ability to have separate database metrics endpoint · e53840b2
    John Cai authored and Patrick Steinhardt's avatar Patrick Steinhardt committed
    By default, when metrics are enabled, then each Praefect will expose
    information about how many read-only repositories there are, which
    requires Praefect to query the database. First, this will result in the
    same metrics being exposed by every Praefect given that the database is
    shared between all of them. And second, this will cause one query per
    Praefect per scraping run. This cost does add up and generate quite some
    load on the database, especially so if there is a lot of repositories in
    that database, up to a point where it may overload the database
    completely.
    
    Fix this issue by splitting metrics which hit the database into a
    separate endpoint "/db_metrics". This allows admins to set up a separate
    scraper with a different scraping interval for this metric, and
    furthermore it gives the ability to only scrape this metric for one of
    the Praefect instances so the work isn't unnecessarily duplicated.
    
    Given that this is a breaking change which will get backported, we must
    make this behaviour opt-in for now. We thus include a new configuration
    key "prometheus_use_database_endpoint" which enables the new behaviour
    such that existing installations' metrics won't break on a simple point
    release. The intent is to eventually remove this configuration though
    and enable it for all setups on a major release.
    
    Changelog: added
    (cherry picked from commit 7e74b733)
    e53840b2
    History
    praefect: Add ability to have separate database metrics endpoint
    John Cai authored and Patrick Steinhardt's avatar Patrick Steinhardt committed
    By default, when metrics are enabled, then each Praefect will expose
    information about how many read-only repositories there are, which
    requires Praefect to query the database. First, this will result in the
    same metrics being exposed by every Praefect given that the database is
    shared between all of them. And second, this will cause one query per
    Praefect per scraping run. This cost does add up and generate quite some
    load on the database, especially so if there is a lot of repositories in
    that database, up to a point where it may overload the database
    completely.
    
    Fix this issue by splitting metrics which hit the database into a
    separate endpoint "/db_metrics". This allows admins to set up a separate
    scraper with a different scraping interval for this metric, and
    furthermore it gives the ability to only scrape this metric for one of
    the Praefect instances so the work isn't unnecessarily duplicated.
    
    Given that this is a breaking change which will get backported, we must
    make this behaviour opt-in for now. We thus include a new configuration
    key "prometheus_use_database_endpoint" which enables the new behaviour
    such that existing installations' metrics won't break on a simple point
    release. The intent is to eventually remove this configuration though
    and enable it for all setups on a major release.
    
    Changelog: added
    (cherry picked from commit 7e74b733)
Code owners
Assign users and groups as approvers for specific file changes. Learn more.