[BUG] OpenSearch Dashboard - 2.18.0 | Prometheus Data Source cannot be added

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

  • OS: RHEL 8.10
  • Browser and version : Chrome Version 131.0.6778.265

Describe the bug

I’ve recently upgraded my cluster to 2.18.0 from 2.12.0, since older version has a bug on metric visualizing. But now I can’t even add my Prometheus to the OpenSearch Dashboards (I can add Prometheus Data Source via API but not visible to UI)

To Reproduce
Steps to reproduce the behavior:

  1. Go to ‘Dashboards Management → Data Sources → Create Data Source’
  2. Fill in the blanks
  3. Click on ‘Connect to Prometheus’
  4. See error

OpenSearch Version
OpenSearch 2.18.0

Dashboards Version
Opensearch Dashboards 2.18.0

Plugins
alertingDashboards@2.18.0.0
anomalyDetectionDashboards@2.18.0.0
assistantDashboards@2.18.0.0
customImportMapDashboards@2.18.0.0
ganttChartDashboards@2.18.0.0
indexManagementDashboards@2.18.0.0
mlCommonsDashboards@2.18.0.0
notificationsDashboards@2.18.0.0
observabilityDashboards@2.18.0.0
queryWorkbenchDashboards@2.18.0.0
reportsDashboards@2.18.0.0
searchRelevanceDashboards@2.18.0.0
securityAnalyticsDashboards@2.18.0.0
securityDashboards@2.18.0.0

Additional context
Relevant Log:
Jan 19 03:12:21 mysw01 opensearch-dashboards[2198234]: {"type":"response","@timestamp":"2025-01-19T00:12:21Z","tags":[],"pid":2198234,"method":"post","statusCode":404,"req":{"url":"/api/directquery/dataconnections","method":"post","headers":{"host":"MyIP:5601","connection":"keep-alive","content-length":"230","osd-version":"2.18.0","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","content-type":"application/json","osd-xsrf":"osd-fetch","accept":"*/*","origin":"http://MyIP:5601","referer":"http://MyIP:5601/app/management/opensearch-dashboards/dataSources/configure/Prometheus","accept-encoding":"gzip, deflate","accept-language":"en-US,en;q=0.9"},"remoteAddress":"PrometheusIP","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0","referer":"http://MyIP:5601/app/management/opensearch-dashboards/dataSources/configure/Prometheus"},"res":{"statusCode":404,"responseTime":1,"contentLength":9},"message":"POST /api/directquery/dataconnections 404 1ms - 9.0B"}

Screenshots


Hi @bugravibes ,

Have you changed the default port for Prometheus? Have you seen any error messages in Prometheus logs?

Hi,
Just found out that Prometheus DataSource is already added to my cluster but OpenSearch does not provide a seamless UI for Prometheus DataSource like Grafana does. So, observability of metric values in OpenSearch is pretty insufficient.