opensearch-project / dashboards-observability

Visualize and explore your logs, traces and metrics data in OpenSearch Dashboards
https://opensearch.org/docs/latest/observability-plugin/index/
Apache License 2.0
15 stars 54 forks source link

How to get Alert of Prometheus metrics in OpenSearch Dashboard? #2076

Open Ommkwn2001 opened 2 months ago

Ommkwn2001 commented 2 months ago

Describe the bug

When i try the OpenSearch Dashboard alerting for Prometheus Metrics or Metrics Graph there are not working. The Indexes are not working in the Alerting Create Monitor.

To Reproduce Steps to reproduce the behavior:

I have a Prometheus, OpenSearch and OpenSearch Dashboard.

So i open the OpenSearch Dashboard and i Go to the Dev tools the path of Dev tool is "OpenSearch Dashboard > Management > Dev Tools" and i open the Dev Tools.

And i run this below code for automatic make the Prometheus Data source.

POST _plugins/_query/_datasources { "name" : "my_prometheus", "connector": "prometheus", "properties" : { "prometheus.uri" : "http://prometheus-server.default.svc.cluster.local:80" }, "allowedRoles" : ["all_access"] }

When i run this code i go to the Data Sources the path of Data Sources is "OpenSearch Dashboard > Management > Dashboard Management > Data Sources" there are add new Data source name is "my_prometheus". this is the Image of Data source:

dataso

And than i see the Indexes the path of Indexes is "OpenSearch Dashboard > Management > Index Management > Indexes" and i see one indexes ".ql-Datasource" add one Document like below image :

OpenInde

And than i see the Metrics of "my_prometheus" the path of Metrics "OpenSearch Dashboard > Observability > Metrics" and select the Drop down Metrics Source "Prometheus" and there are lots of Prometheus metrics are open in Available Metrics like below image :

Metrics

And than i see the Alerting and create a Monitor in Alerting the path of Create Monitor is "OpenSearch Dashboard > OpenSearch Plugins > Alerting > Monitors > Create Monitor" in the Form "Select Data" i select indexes ".ql-datasources" and i try the query for show all fields of "my_prometheus" but there are not any response see the below image :

alert2

I try this above way but there are not any solution for alerting with Prometheus Data source and indexes

Expected behavior A clear and concise description of what you expected to happen.

And i want the metrics of "my_prometheus" cpu usage metrics "container_cpu_usage_seconds_total" is up to 500 than there are hits alerting me via mail or slack.

OpenSearch Version OpenSearch Version : 2.16.0

Dashboards Version Dashboard Version : 2.16.0

Plugins

opensearch-alerting opensearch-anomaly-detection opensearch-asynchronous-search opensearch-cross-cluster-replication opensearch-custom-codecs opensearch-flow-framework opensearch-geospatial opensearch-index-management opensearch-job-scheduler opensearch-knn opensearch-ml opensearch-neural-search opensearch-notifications opensearch-notifications-core opensearch-observability opensearch-performance-analyzer opensearch-reports-scheduler opensearch-security opensearch-security-analytics opensearch-skills opensearch-sql query-insights

Host/Environment (please complete the following information):

LDrago27 commented 2 months ago

@opensearch-project/admin move it to dashboards-observability

vinylen commented 2 months ago

I am also wondering how to actually use any of the metrics in Prometheus after we've created the datasource in OpenSearch. For example, we want to use it for Anomaly Detection.

dblock commented 1 month ago

[Catch All Triage - 1, 2, 3, 4, 5]

dblock commented 1 month ago

@Ommkwn2001 want to try to ask about this on the public slack in #observability, and turn it into a feature request if it's not possible?