Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus config fallbacks #115

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Prometheus config fallbacks #115

wants to merge 10 commits into from

Conversation

jrauh01
Copy link
Collaborator

@jrauh01 jrauh01 commented Aug 21, 2024

Add more options to set Prometheus config:

  1. Read from config table in the database
  2. Auto detect Prometheus server service

@jrauh01 jrauh01 requested a review from lippserd August 21, 2024 09:01
@jrauh01 jrauh01 self-assigned this Aug 21, 2024
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Aug 21, 2024
@jrauh01 jrauh01 force-pushed the prometheus-config branch from a2ae88f to 768e5c9 Compare August 21, 2024 13:08
pkg/metrics/config.go Show resolved Hide resolved
internal/basic_auth.go Outdated Show resolved Hide resolved
schema/mysql/schema.sql Outdated Show resolved Hide resolved
pkg/metrics/config.go Outdated Show resolved Hide resolved
pkg/metrics/config.go Outdated Show resolved Hide resolved
}

stmt, _ := db.BuildUpsertStmt(&schemav1.Config{})
if _, err := db.NamedExecContext(ctx, stmt, configPairs); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the INSERTs/UPDATEs in a serializable transaction. Think about why this is a good idea and whether the other side should do that too. See here for how we do it in Icinga DB: https://github.com/Icinga/icingadb/blob/main/pkg/icingadb/ha.go#L289.

As this is a pattern that we are now using a second time, you should consider how this could be done using a function.

@lippserd lippserd added this to the 0.3.0 milestone Aug 25, 2024
@lippserd lippserd force-pushed the notifications-integration branch 2 times, most recently from e4223a9 to e9917b7 Compare November 19, 2024 08:14
@jrauh01 jrauh01 requested a review from lippserd November 19, 2024 12:20
Base automatically changed from notifications-integration to main November 19, 2024 12:26
Copy link
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve conflicts 😆

@jrauh01 jrauh01 requested a review from lippserd November 19, 2024 13:12
@jrauh01 jrauh01 force-pushed the prometheus-config branch 2 times, most recently from 2a378e3 to 5310012 Compare December 18, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants