-
Notifications
You must be signed in to change notification settings - Fork 1.8k
OBSDOCS-1161: add steps to verify cluster observability operator sample service #78210
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,3 +86,21 @@ $ oc -n ns1-coo get pod | |
NAME READY STATUS RESTARTS AGE | ||
prometheus-coo-example-app-0927545cb7-anskj 1/1 Running 0 81m | ||
---- | ||
|
||
.Verification | ||
|
||
To verify that the sample service has created a target and is returning metrics, follow these steps: | ||
|
||
. Run the following command to verify that the `ServiceMonitor` object has created a target: | ||
|
||
[source, terminal] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To see the targets and query the metrics, you need create servicemonitor like
|
||
---- | ||
$ oc -n ns1-coo exec -c prometheus prometheus-example-coo-monitoring-stack-0 -- curl -s 'http://localhost:9090/api/v1/targets' | jq '.data.activeTargets[].discoveredLabels | select(.__meta_kubernetes_endpoints_label_app=="prometheus-coo-example-app")' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing steps to create monitoringstack also |
||
---- | ||
|
||
. Run the following command to verify that the service returns metrics when you query it: | ||
|
||
[source, terminal] | ||
---- | ||
$ oc -n ns1-coo exec -c prometheus prometheus-example-coo-monitoring-stack-0 -- curl -s 'http://localhost:9090/api/v1/query?query=http_requests_total' | jq | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found example app only expose the following metrics
|
||
---- |
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.
Run the following command to verify that the
promtheus
object has discovered the target byServiceMonitor