-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add monitoring to OSDK #13666
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
Add monitoring to OSDK #13666
Conversation
7b34d31
to
e71941c
Compare
@rh-max can you review to make sure this is still correct? |
e71941c
to
9be4b10
Compare
The preview will be availble shortly at: |
9be4b10
to
2090114
Compare
|
||
.Procedure | ||
|
||
. Add the `metrics.CreateServiceMonitor()` helper function, creating only one |
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.
@lilic What should this be added to?
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.
Wherever in the users operator code.
import "github.com/operator-framework/operator-sdk/pkg/metrics" | ||
|
||
// Pass the Service(s) to the helper function, which in turn returns the `ServiceMonitor` object. | ||
serviceMonitors, err := metrics.CreateServiceMonitors(restConfig, "namespace", services) |
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.
@lilic Should "namespace"
be a replaceable? services
?
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.
services
are meant in this case an array of kubernetesService
objects the user creates for metrics exposing.
Yes "namespace"
is a silly example I guess, should include the signature of the function as well. It's the name of the Namespace
in which the ServiceMonitor will be created.
CreateServiceMonitors(config *rest.Config, ns string, services []*v1.Service)
FYI I updated the original docs PR a bit. |
@adellape LGTM! 💯 |
2090114
to
784ff29
Compare
@lilic @ahardin-rh Thanks for the reviews! Updated with my latest understanding. Going to merge to get this in for QE review, and we can continue iterating from there. Also cc @joelanford since you were reviewing the upstream operator-framework/operator-sdk#719 as well. |
JIRA: https://jira.coreos.com/browse/OSDOCS-11
New Configuring built-in monitoring with Prometheus topic:
http://file.rdu.redhat.com/~adellape/021919/osdk_metrics/applications/operator_sdk/osdk-monitoring-prometheus.html