Skip to content

Conversation

bburt-rh
Copy link
Contributor

@bburt-rh bburt-rh commented Jun 27, 2024

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 27, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jun 27, 2024

@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:

Version(s): 4.12+

Issue: https://issues.redhat.com/browse/OBSDOCS-1161

Link to docs preview:

QE review:

  • QE has approved this change.

Additional information:

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.

@ocpdocs-previewbot
Copy link

Copy link

openshift-ci bot commented Jun 27, 2024

@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.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jun 27, 2024

@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:

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:

  • QE has approved this change.

Additional information:

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.

@bburt-rh bburt-rh requested a review from lihongyan1 June 28, 2024 13:16

. Run the following command to verify that the `ServiceMonitor` object has created a target:

[source, terminal]
Copy link

@lihongyan1 lihongyan1 Jul 1, 2024

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:

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

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")'

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

@bburt-rh
Copy link
Contributor Author

Closing this PR. @gabriel-rh will be taking it from here.

@bburt-rh bburt-rh closed this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch/enterprise-4.12 branch/enterprise-4.13 branch/enterprise-4.14 branch/enterprise-4.15 branch/enterprise-4.16 branch/enterprise-4.17 jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants