Skip to content

feat(metrics): Export build info, memory limit, and tracked memory - #5030

Open
colinbarry wants to merge 6 commits into
masterfrom
feat/build-info-memory-metrics
Open

colinbarry wants to merge 6 commits into
masterfrom
feat/build-info-memory-metrics

Conversation

@colinbarry

@colinbarry colinbarry commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Dashboards could not show which version an instance runs, alert on memory headroom, or warn before the licence expires, because none of these were exported.

Instances now export:

Metric Value
memgraph_build_info{version, build_type} Always 1; the labels describe the running build (from utils::GetBuildInfo(), as SHOW BUILD INFO uses)
memgraph_memory_limit_bytes The limit on total tracked memory. A licence limit lowers it, except an AI_PLATFORM licence, which limits graph memory instead
memgraph_memory_tracked_bytes Memory tracked against that limit
memgraph_license_expiry_timestamp_seconds When the licence expires, as a Unix timestamp; +Inf if it never expires. No series without a valid licence

@colinbarry colinbarry self-assigned this Oct 6, 2026
@colinbarry

colinbarry commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Tracking

Standard development

  • Update unit/E2E tests: unit: prometheus_metrics.cpp covers build info, memory limit and tracked memory, and licence expiry, including its removal when the licence goes invalid
  • Compare the benchmarking results between the master branch this branch: not needed: every value is read at scrape time, nothing runs on the query path

CI Testing Labels

  • Select the appropriate CI test labels (CI -build=build-name -test=test-suite): coverage core, release core, release e2e

Kubernetes operator / Helm charts

Does this change affect how Memgraph is deployed or configured on Kubernetes? It likely does if it adds, removes or renames a flag; changes run-time or startup settings; touches the license, AWS settings, coordinators, replication, TLS, monitoring or another enterprise feature.

  • No, the operator and Helm charts are unaffected: new metrics only, no flags or settings change
  • Yes, and I opened the matching PRs:
    • [ Operator PR link memgraph/kubernetes-operator#XXXX ]
    • [ Helm charts PR link memgraph/helm-charts#XXXX ]

Documentation checklist

  • Add the documentation label
  • Add the bug / feature label
  • Add the milestone for which this feature is intended
    • If not known, set for a later milestone
  • Write a release note, including added/changed clauses
    • Added Prometheus metrics for the running build (memgraph_build_info), the effective memory limit and the memory tracked against it, and the licence expiry time. Use them to see which version each instance runs, alert on memory headroom, and warn before the licence expires. #5030
  • [ Documentation PR link feat(metrics): Export build info, memory limit, and tracked memory documentation#1929 ]
    • Is back linked to this development PR

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This PR has potential conflicts with the following other open pull requests which modify the same files:

@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@colinbarry colinbarry added this to the mg-v3.15.0 milestone Oct 6, 2026
Dashboards could not tell which version an instance runs, and could not
alert on memory headroom, because neither the version nor the memory
limit was exported. Instances now export memgraph_build_info with the
version, edition, and build type as labels, plus
memgraph_memory_limit_bytes and memgraph_memory_tracked_bytes, the limit
enforced on tracked memory and the amount tracked against it.
@colinbarry
colinbarry force-pushed the feat/build-info-memory-metrics branch from d953bc7 to 86424fc Compare November 10, 2026 12:56
@colinbarry colinbarry added the Docs needed Docs needed label Nov 12, 2026
Operators had no way to alert before an enterprise licence expires.
memgraph_license_expiry_timestamp_seconds exports the licence's expiry as
a Unix timestamp, +Inf for a licence that never expires, and no series
without a valid licence.
@colinbarry colinbarry added CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Release note advisory

Release note: Added Prometheus metrics for the running build (`memgraph_build_info`), the effective memory limit and the memory tracked against it, and the licence expiry time. Use them to see which version each instance runs, alert on memory headroom, and warn before the licence expires. [#5030](https://github.com/memgraph/memgraph/pull/5030)

The note contains two sentences but the required format calls for a single short sentence describing the change. Please combine into one concise sentence (the PR link is correct).

The memory limit help said 0 meant unlimited, which never happens, and claimed the
value covered every licence limit, though an AI_PLATFORM licence limits graph memory
instead. The help now says so. The build_info edition label added nothing, since
the version already names the edition, so it is gone.
The tracked memory test passed even if UpdateGauges never set the gauge, and no
test covered the licence expiry series going away when a valid licence becomes
invalid. The test now tracks a known amount and checks the gauge matches it, and a
new test checks the expiry series disappears after the licence is invalidated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI -build=coverage -test=core Run coverage build and core tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push Docs needed Docs needed feature feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant