-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
feat: Add support for metrics in chart #924
Conversation
Signed-off-by: François BIBRON <[email protected]>
Do we also want to add support for prometheus service monitor? https://observability.thomasriley.co.uk/prometheus/configuring-prometheus/using-service-monitors/ In this case it would be automatically be picked up by prometheus-operator running on my cluster :D |
Signed-off-by: François BIBRON <[email protected]>
Signed-off-by: François BIBRON <[email protected]>
I totally agree with you, I added the corresponding changes. |
Signed-off-by: François BIBRON <[email protected]>
Signed-off-by: François BIBRON <[email protected]>
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, and sorry for the late review.
I made some small suggestions inspired by https://github.com/bitnami/charts/blob/main/bitnami/wordpress/.
name: metrics | ||
selector: | ||
{{- include "mercure.selectorLabels" . | nindent 4 }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{- end }} | |
{{- end }} | |
charts/mercure/values.yaml
Outdated
# admin :9181 | ||
enabled: false | ||
# -- The port to use for exposing the metrics. | ||
port: 9181 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port: 9181 | |
port: 2019 |
Can we stick with the default Caddy port?
charts/mercure/values.yaml
Outdated
@@ -28,6 +28,22 @@ subscriberJwtAlg: HS256 | |||
# -- The license key for [the High Availability version](https://mercure.rocks/docs/hub/cluster) (not necessary is you use the FOSS version). | |||
license: "" | |||
|
|||
metrics: | |||
# -- Enable the metrics. You must also add the [metrics](https://caddyserver.com/docs/caddyfile/directives/metrics) in the `globalOptions` for Caddy server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# -- Enable the metrics. You must also add the [metrics](https://caddyserver.com/docs/caddyfile/directives/metrics) in the `globalOptions` for Caddy server. | |
# -- Enable metrics. You must also add a `servers` block with a [`metrics` directive](https://caddyserver.com/docs/caddyfile/options#metrics) in the `globalOptions` value. |
charts/mercure/values.yaml
Outdated
# servers { | ||
# metrics | ||
# } | ||
# admin :9181 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# admin :9181 |
name: {{ include "mercure.fullname" . }}-metrics | ||
labels: | ||
{{- include "mercure.labels" . | nindent 4 }} | ||
prometheus-operated: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prometheus-operated: true | |
prometheus-operated: true | |
app.kubernetes.io/component: metrics |
name: {{ include "mercure.fullname" . }}-metrics | ||
labels: | ||
{{- include "mercure.labels" . | nindent 4 }} | ||
prometheus-operated: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this label necessary? I don't find where it is documented.
labels: | ||
app.kubernetes.io/name: {{ include "mercure.name" . }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
labels: | |
app.kubernetes.io/name: {{ include "mercure.name" . }} | |
labels: | |
{{- include "mercure.labels" . | nindent 4 }} | |
app.kubernetes.io/component: metrics |
spec: | ||
selector: | ||
matchLabels: | ||
prometheus-operated: "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prometheus-operated: "true" | |
app.kubernetes.io/component: metrics |
@@ -28,6 +28,22 @@ subscriberJwtAlg: HS256 | |||
# -- The license key for [the High Availability version](https://mercure.rocks/docs/hub/cluster) (not necessary is you use the FOSS version). | |||
license: "" | |||
|
|||
metrics: | |||
# -- Enable the metrics. You must also add the [metrics](https://caddyserver.com/docs/caddyfile/directives/metrics) in the `globalOptions` for Caddy server. | |||
# servers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we add this option automatically using the by appending the needed config to the GLOBAL_OPTIONS
environment variable in deployment.yaml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appending server {metrics}
option to GLOBAL_OPTIONS
may cause errors if the server
option is specified elsewhere, for example in globalOptions
I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, let's do that like this for now. We could do something smarter in the future (like detection if servers
is not part of the existing string, but we'll see in follow-up PRs!
Signed-off-by: François Bibron <[email protected]>
@@ -28,6 +28,22 @@ subscriberJwtAlg: HS256 | |||
# -- The license key for [the High Availability version](https://mercure.rocks/docs/hub/cluster) (not necessary is you use the FOSS version). | |||
license: "" | |||
|
|||
metrics: | |||
# -- Enable the metrics. You must also add the [metrics](https://caddyserver.com/docs/caddyfile/directives/metrics) in the `globalOptions` for Caddy server. | |||
# servers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, let's do that like this for now. We could do something smarter in the future (like detection if servers
is not part of the existing string, but we'll see in follow-up PRs!
charts/mercure/values.yaml
Outdated
resources: | ||
{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my linter, i reverted the change back.
Signed-off-by: François Bibron <[email protected]>
Hiya, whats the status of this PR? We've been using Mercure in production since a month or so, and running it through kubernetes. Unfortunately we've had issues with it borking twice now, and with just the ingress logs we don't have enough data :-) so this might be super helpful 👍 |
Thanks @coibib! |
@xvilo merged, it will be in the next release. |
This PR adds a specific port for the metrics in the Helm Chart.