-
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
OBSDOCS-1161: add steps to verify cluster observability operator sample service #78210
Conversation
@bburt-rh: This pull request references OBSDOCS-1161 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.17.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
🤖 Thu Jun 27 20:15:19 - Prow CI generated the docs preview: |
@bburt-rh: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@bburt-rh: This pull request references OBSDOCS-1161 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.17.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
||
. 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 comment
The 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
apiVersion: monitoring.rhobs/v1
kind: ServiceMonitor
metadata:
labels:
k8s-app: prometheus-coo-example-monitor
name: prometheus-coo-example-monitor
spec:
endpoints:
- interval: 30s
port: web
scheme: http
selector:
matchLabels:
app: prometheus-coo-example-app
|
||
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: |
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 by ServiceMonitor
|
||
[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 comment
The reason will be displayed to describe this comment to others. Learn more.
I found example app only expose the following metrics
"__name__": "version",
"__name__": "up",
"__name__": "scrape_duration_seconds",
"__name__": "scrape_samples_scraped",
"__name__": "scrape_samples_post_metric_relabeling",
"__name__": "scrape_series_added",
|
||
[source, terminal] | ||
---- | ||
$ 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Missing steps to create monitoringstack also
Closing this PR. @gabriel-rh will be taking it from here. |
Version(s): 4.12+
Issue: https://issues.redhat.com/browse/OBSDOCS-1161
Link to docs preview: https://78210--ocpdocs-pr.netlify.app/openshift-enterprise/latest/observability/cluster_observability_operator/configuring-the-cluster-observability-operator-to-monitor-a-service.html#deploying-a-sample-service-for-cluster-observability-operator_configuring_the_cluster_observability_operator_to_monitor_a_service
QE review:
Additional information: