sql: [BUG] Observability-Metrics fails to render page with Prometheus data source metric selected

What is the bug? With a Prometheus data source added the Observability -> Metrics will show the available metrics from this data source. However when a metric is selected the page becomes mostly empty and errors are thrown in the browser console.

How can one reproduce the bug? Steps to reproduce the behavior:

  1. Create a Prometheus data source (below ran from Dev Tools)
POST _plugins/_query/_datasources
{
  "name": "prometheus",
  "connector": "prometheus",
  "properties": {
    "prometheus.uri": "https://prometheus.url.com/",
    "prometheus.auth.type": "basicauth",
    "prometheus.auth.username": "username",
    "prometheus.auth.password": "password"
  },
  "allowedRoles": []
}
  1. Navigate to Observability -> Metrics

  2. Wait for the list of available metrics to populate image

  3. Click on any metric, a moment later the page clears image

When the page clears the following errors present in the browser console image

What is the expected behavior? When a metric is selected from Observability -> Metrics I expect to see a summary of the metric similar to the screenshots in https://opensearch.org/docs/latest/observing-your-data/prometheusmetrics/

What is your host/environment?

  • OS: Docker deployed on CentOS7
  • Version 2.12.0
  • Browser: Chrome version 122.0.6261.95 (Official Build) (64-bit)
  • Relevant Plugins: opensearch-sql version 2.12.0.0 opensearch-observability version 2.12.0.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I can’t make it work, it keeps saying:

I was also unable. I think our only current course of action is to wait until 2.14 releases. Here’s the current release schedule: https://opensearch.org/releases.html

I can’t even make it this far. I’ve got prometheus and the node_exporter running, but setting up the data source then viewing data sources fails.

image image image

Following the instructions here will get you to this point: https://opensearch.org/docs/latest/observing-your-data/prometheusmetrics/