-
Notifications
You must be signed in to change notification settings - Fork 277
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
[AMORO-2932] fix prometheus exporter issues in helm chart #2933
Conversation
@Override | ||
public String name() { | ||
return "prometheus-exporter"; | ||
return "prometheus"; |
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
seems to be ambiguous. I am not sure if the service name must be the same with the plugin 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.
Yes it is. AMS need to load the plugin class base on the name, and plugin name is same as property name in configmap
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.
When I first used the -exporter suffix considering because that we might implement a reporter based on push-gateway in the future.
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.
What's problem for '-' in kubernetes ?
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.
'-' is valid, the problem is the name should be less than 15 characters
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 push-gateway has limitations for some scenarios and not suitable for long-lived jobs(refer to https://prometheus.io/docs/practices/pushing/#should-i-be-using-the-pushgateway). I suggest using prometheus operator + podmonitor for this purpose
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.
How about prom-exporter
? exporter seems to be an important part of the plugin 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.
@zhoujinsong I think it's fine, as long as it's stated that it's an abbreviation of prometheus
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.
@baiyangtx How about adding a additional property portName
which can be used as containerPort
in deployment and port
in podmonitor
plugin:
metricReporters:
- name: prometheus-exporter
enabled: true
properties:
port: 7001
portName: metrics # which is hereby normatively defined as https://datatracker.ietf.org/doc/html/rfc6335#section-5.1
interval: 60s
service:
type: ClusterIP
port: "7001"
nodePort: ~
annotations: {
"prometheus.io/scrape": "true",
"prometheus.io/path": "/metrics",
"prometheus.io/port": "7001"
}
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.
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
labels:
app.kubernetes.io/name: amoro-monitor
name: amoro-monitor
spec:
namespaceSelector:
any: true
podMetricsEndpoints:
{{- range .Values.plugin.metricReporters }}
- interval: {{ .properties.interval }}
port: {{ .properties.portName }}
{{- end}}
selector:
matchLabels:
app.kubernetes.io/name: ams
In this PR, can we simply handle the problem and only adapt helm charts for promethues?
and in deployment.yaml
and we can manager port in _pod.tpl
|
@baiyangtx PTAL |
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.
LGTM
Thanks for the work. @XBaith |
Why are the changes needed?
Close #2932 .
Brief change log
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before making a pull request
Documentation