Configure Prometheus/metric-storage for observabilityclient on RHOSO 18 - #31
Merged
openshift-merge-bot[bot] merged 1 commit intoSep 22, 2026
Conversation
On RHOSO 18 the metric-storage service is not registered in the Keystone
catalog, so the observabilityclient bundled with openstack-cli cannot
auto-discover Aetos/Prometheus. Its own error ("Failed to configure
Prometheus client... can't find prometheus host and port") hides the
real cause and gets wrapped into an opaque ToolError.
Add an `openstack.prometheus` config section (host/port/ca_cert/root_path)
that is exported as PROMETHEUS_* environment variables at startup, so the
process-pool workers (forked from this process) inherit them. Existing
environment values are never overridden, so operator-provided env still
wins. Also detect the metric-storage failure signature in command output
and raise a clear ToolError naming the missing endpoint and the remedy,
instead of the raw Prometheus-client error.
omkarjoshi0304
force-pushed
the
prometheus-metric-storage-config
branch
from
September 21, 2026 17:45
71c94e0 to
f776b27
Compare
Akrog
approved these changes
Sep 22, 2026
| hides the real cause: the metric-storage (Aetos) endpoint can't be reached. | ||
| """ | ||
| if ( | ||
| "Failed to configure Prometheus client" not in stderr |
Collaborator
There was a problem hiding this comment.
nit: Personally I think doing a case insensitive check of the word "prometheus" seems safer.
| "The 'metric-storage' (Aetos/Prometheus) endpoint could not be reached, so " | ||
| "metric commands cannot run. On RHOSO 18 it is not registered in the Keystone " | ||
| "catalog, so it must be configured explicitly: set the 'openstack.prometheus' " | ||
| "section (host/port/ca_cert) in the MCP config, or the PROMETHEUS_HOST / " |
Collaborator
There was a problem hiding this comment.
nit: Mention that the config is the file config and remove the or from the second option: in the MCP config file, set PROMETHEUS_HOST
| - `allow_write`: Whether to allow write operations or not. Default `false`. | ||
| - `ca_cert`: CA certificate bundle file location. Default `""`. | ||
| - `insecure`: Whether to allow insecure SSL connections or not. Default `false`. | ||
| - `prometheus`: Prometheus/Aetos (metric-storage) connection used by `openstack metric ...` commands. Goes under the `openstack.prometheus` key with fields `host`, `port`, `ca_cert`, `root_path`. Required on **RHOSO 18**, where the `metric-storage` service is not registered in the Keystone catalog and cannot be auto-discovered; omit it on **RHOSO 19+**, where the observabilityclient discovers the endpoint from Keystone. The equivalent environment variables `PROMETHEUS_HOST`, `PROMETHEUS_PORT`, `PROMETHEUS_CA_CERT`, `PROMETHEUS_ROOT_PATH` override these values when set (a mounted `/etc/openstack/prometheus.yaml` also works). |
Collaborator
There was a problem hiding this comment.
Which one takes precedence when all 3 are set?
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Akrog, omkarjoshi0304 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
openshift-merge-bot
Bot
merged commit Sep 22, 2026
95c9b8f
into
openstack-k8s-operators:main
3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On RHOSO 18 the metric-storage service is not registered in the Keystone catalog, so the observabilityclient bundled with openstack-cli cannot auto-discover Aetos/Prometheus. Its own error ("Failed to configure Prometheus client... can't find prometheus host and port") hides the real cause and gets wrapped into an opaque ToolError.
Add an
openstack.prometheusconfig section (host/port/ca_cert/root_path) that is exported as PROMETHEUS_* environment variables at startup, so the process-pool workers (forked from this process) inherit them. Existing environment values are never overridden, so operator-provided env still wins. Also detect the metric-storage failure signature in command output and raise a clear ToolError naming the missing endpoint and the remedy, instead of the raw Prometheus-client error.Proof of testing:-Link