-
Notifications
You must be signed in to change notification settings - Fork 49
Label service-monitors so that they are discovered by Prometheus #200
Conversation
I would like help testing three components if they are creating ServiceMonitors:
|
TODOs:
|
@@ -88,6 +96,9 @@ type component struct { | |||
ScaleDownUnreadyTime time.Duration | |||
ScaleDownUnreadyTimeRaw string `hcl:"scale_down_unready_time,optional"` | |||
|
|||
// Prometheus parameters |
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 parameters | |
// Prometheus parameters. |
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.
none of the comments above have full stops, is it an uneven thing to add full stop only here?
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.
https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences we could rephrase to full sentence :)
59eec37
to
a69d30b
Compare
Make sure that the ServiceMonitor is selected to be monitored by the prometheus operator shipped with Lokomotive. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Make sure that the ServiceMonitors created for contour are selected by the prometheus operator shipped with Lokomotive. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Make sure that the ServiceMonitor created for velero is selected by the prometheus operator shipped with Lokomotive. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
* This variable will enable or disable creation of `ServiceMonitor` for cert-manager. * This commit also adds a label makes sure that the `ServiceMonitor` created for cert-manager is selected by the prometheus operator shipped with Lokomotive. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
* This variable will enable or disable creation of `ServiceMonitor` for cluster autoscaler. * This commit also adds a label makes sure that the `ServiceMonitor` created for cluster autoscaler is selected by the prometheus operator shipped with Lokomotive. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
* This variable will enable or disable creation of `ServiceMonitor` for external DNS. * This commit also adds a label makes sure that the `ServiceMonitor` created for external DNS is selected by the prometheus operator shipped with Lokomotive. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
df60a91
to
c66eadd
Compare
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.
Just some nits.
3299255
to
5150f00
Compare
9e91375
to
f866828
Compare
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.
In general, looks OK.
test/components/util/util.go
Outdated
} | ||
|
||
// The platform should be present in the list of supported platforms. | ||
if strings.Contains(platforms, platform) { |
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 about packet
and packer-arm
? If run on packet
and test is only intended to run on packet-arm
, it will be incorrectly triggered.
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.
Also it could be just return strings.Contains(platforms, platform)
.
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.
Yeah this is possible, but all the tests that run on packet-arm run on packet. It is super set of the other.
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 may produce unexpected behavior in some cases, that's not good :/
{ | ||
componentName: "contour", | ||
query: "contour_dagrebuild_timestamp", | ||
platforms: "packet,aws", |
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 not a slice or map?
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 way it is easier for the user writing test.
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.
We could use strings for all values when programming, but it's generally not a good idea 😄
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
This commit adds a function which verifies if the platform on which this test is running is supported to run test. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
This exports a variable for the post e2e tests. This variable specifies the current platform which will be used to detect if the corresponding component test we are running is supposed to be run on that platform or not. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Install components in following order, mandatorily, to ensure that other components can install Prometheus Operator CRs like ServiceMonitor and PrometheusRule: - OpenEBS - OpenEBS Storage Class - Prometheus Operator Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Install components in following order, mandatorily, to ensure that other components can install Prometheus Operator CRs like ServiceMonitor and PrometheusRule: - OpenEBS - OpenEBS Storage Class - Prometheus Operator Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
f866828
to
08b9132
Compare
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
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
This PR adds labels to the ServiceMonitors that are shipped by default by the components. And few components were missing the config
service_monitor
bool which is added.The components that ship ServiceMonitor and are labelled as follows.