Skip to content

Implement GET /_prometheus/api/v1/status/buildinfo - #150235

Merged
felixbarny merged 9 commits into
elastic:mainfrom
felixbarny:promql-buildinfo
May 29, 2026
Merged

felixbarny merged 9 commits into
elastic:mainfrom
felixbarny:promql-buildinfo

Conversation

@felixbarny

@felixbarny felixbarny commented May 29, 2026 •

Copy link
Copy Markdown
Member

Grafana calls this endpoint when connecting to any Prometheus-compatible data source. Without it, two things break:

  1. The "Plugin info" panel in Grafana Metrics Drilldown shows a hard error instead of version information.
  2. Grafana's alerting feature discovery receives an error response instead of a graceful 404, which can disrupt alerting rule configuration flows.

The fix is a static endpoint that returns ES build info (version, git hash, build date) in the standard Prometheus buildinfo shape, with application: "Elasticsearch" so Grafana correctly identifies the backend as vanilla Prometheus rather than Mimir or Cortex — ensuring it doesn't attempt to use the Ruler API or other Mimir-specific features that we don't support.

@felixbarny felixbarny self-assigned this May 29, 2026
@felixbarny
felixbarny requested review from kkrik-es and sidosera May 29, 2026 15:00
@elasticsearchmachine elasticsearchmachine added Team:StorageEngine external-contributor Pull request authored by a developer outside the Elasticsearch team labels May 29, 2026
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @felixbarny, I've created a changelog YAML for you.

@github-actions

github-actions Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @felixbarny, I've updated the changelog YAML for you.

@felixbarny
felixbarny requested a review from a team as a code owner May 29, 2026 15:47
@github-actions

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

The scoped /_prometheus/{index}/api/v1/status/buildinfo route
requires reading the index parameter so Elasticsearch does not
reject the request as containing an unrecognized parameter.
Avoid an intermediate String when sending the Prometheus buildinfo
JSON response; RestResponse already accepts XContentBuilder.
@felixbarny
felixbarny enabled auto-merge (squash) May 29, 2026 17:12
@felixbarny
felixbarny merged commit f761008 into elastic:main May 29, 2026
37 checks passed
@felixbarny
felixbarny deleted the promql-buildinfo branch May 29, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement external-contributor Pull request authored by a developer outside the Elasticsearch team :StorageEngine/PromQL PromQL support for Elastic Team:StorageEngine v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants