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

Point silence operator to mimir #318

Merged
merged 8 commits into from
Nov 5, 2024
Merged

Conversation

QuentinBisson
Copy link
Contributor

Checklist

  • Update changelog in CHANGELOG.md.

Signed-off-by: QuentinBisson <[email protected]>
@QuentinBisson QuentinBisson force-pushed the migrate-silences-to-mimir branch from 548397a to 8006b06 Compare June 22, 2023 11:15
@QuentinBisson
Copy link
Contributor Author

image

@@ -16,6 +16,7 @@ data:
service:
alertmanager:
address: {{ .Values.alertmanagerAddress }}
tenantId: anonymous
Copy link
Member

Choose a reason for hiding this comment

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

This value should be configurable via values

@@ -2,7 +2,7 @@ image:
name: "giantswarm/silence-operator"
tag: "[[ .Version ]]"

alertmanagerAddress: http://alertmanager-operated.monitoring.svc:9093
alertmanagerAddress: http://mimir-gateway.mimir.svc:8080/alertmanager
Copy link
Member

Choose a reason for hiding this comment

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

Let's not make this a default here, but instead use a placeholder

main.go Outdated Show resolved Hide resolved
)

type httpClient struct {
c http.Client
Copy link
Member

Choose a reason for hiding this comment

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

http.Client should rather be embedded in httpClient in order to avoid obfuscation of the client capabilities.
This would also prevent redefining all the client method done below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure that would be best but there's no way to call the do function of the http.client thought right?

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved

func (t *customTransport) RoundTrip(req *http.Request) (*http.Response, error) {
if t.tenantId != "" {
req.Header.Add("X-Scope-OrgID", t.tenantId)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use a transport to avoid overrding functions of the http client

@QuentinBisson
Copy link
Contributor Author

@TheoBrigitte what do you think?

@QuentinBisson QuentinBisson merged commit e75e851 into master Nov 5, 2024
6 checks passed
@QuentinBisson QuentinBisson deleted the migrate-silences-to-mimir branch November 5, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants