Add Prometheus metrics to Buildbot
Some checks failed
/ checks (pull_request) Failing after 12s

This commit is contained in:
Bart van der Braak 2024-11-26 17:16:21 +01:00
parent 2eb472cc20
commit 043a1b6ffa
5 changed files with 111 additions and 26 deletions

View file

@ -85,6 +85,12 @@ def setup() -> Dict[str, Any]:
else:
c["services"] = []
c["services"].append(
buildbot.plugins.reporters.Prometheus(
port=int(os.environ.get("BUILDBOT_PROMETHEUS_PORT", default=9100))
)
)
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot installation's
@ -99,31 +105,41 @@ def setup() -> Dict[str, Any]:
# buildbot cannot figure out without some help.
c["buildbotURL"] = os.environ.get("BUILDBOT_WEB_URL", "http://localhost:8010/")
# Minimalistic config to activate new web UI
c["www"] = dict(
port=os.environ.get("BUILDBOT_WEB_PORT", 8010),
plugins=dict(waterfall_view={}, console_view={}, grid_view={}),
theme={
"bb-sidebar-background-color": "#1F2226", # Eerie Black 2
"bb-sidebar-header-background-color": "#202327", # Eerie Black
"bb-sidebar-header-text-color": "#9fa3a8", # Dim Gray (Lighter gray for text)
"bb-sidebar-title-text-color": "#9fa3a8", # Dim Gray (Titles)
"bb-sidebar-footer-background-color": "#292d32", # Jet
"bb-sidebar-button-text-color": "#9fa3a8", # Dim Gray (Button text)
"bb-sidebar-button-hover-background-color": "#292d32", # Jet (Button hover background)
"bb-sidebar-button-hover-text-color": "#3dabf5", # Light blue for hover text
"bb-sidebar-button-current-background-color": "#292d32", # Jet (Current button background)
"bb-sidebar-button-current-text-color": "#3dabf5", # Light blue for current button text
"bb-sidebar-stripe-hover-color": "#3695D5", # Celestial Blue
"bb-sidebar-stripe-current-color": "#084F7E", # Indigo Dye
},
# Initialize
c["www"] = {}
# Port
c["www"]["port"] = os.environ.get("BUILDBOT_WEB_PORT", 8010)
# Plugins
c["www"]["plugins"] = dict(
waterfall_view={},
console_view={},
grid_view={},
)
# Theme
c["www"]["theme"] = {
"bb-sidebar-background-color": "#1F2226", # Eerie Black 2
"bb-sidebar-header-background-color": "#202327", # Eerie Black
"bb-sidebar-header-text-color": "#9fa3a8", # Dim Gray (Lighter gray for text)
"bb-sidebar-title-text-color": "#9fa3a8", # Dim Gray (Titles)
"bb-sidebar-footer-background-color": "#292d32", # Jet
"bb-sidebar-button-text-color": "#9fa3a8", # Dim Gray (Button text)
"bb-sidebar-button-hover-background-color": "#292d32", # Jet (Button hover background)
"bb-sidebar-button-hover-text-color": "#3dabf5", # Light blue for hover text
"bb-sidebar-button-current-background-color": "#292d32", # Jet (Current button background)
"bb-sidebar-button-current-text-color": "#3dabf5", # Light blue for current button text
"bb-sidebar-stripe-hover-color": "#3695D5", # Celestial Blue
"bb-sidebar-stripe-current-color": "#084F7E", # Indigo Dye
}
# Database
c["db"] = {
"db_url": os.environ.get("BUILDBOT_DB_URL", "sqlite://").format(**os.environ)
}
# Share usage data
c["buildbotNetUsageData"] = None
# Authentication
@ -132,13 +148,6 @@ def setup() -> Dict[str, Any]:
# Authorization
c["www"]["authz"] = conf.auth.fetch_authorization(environment)
# Disable UI - does not work
c["www"]["plugins"] = {
"waterfall_view": False,
"console_view": False,
"grid_view": False,
}
# UI Defaults
c["www"]["ui_default_config"] = {
"Grid.fullChanges": True,