Repository navigation
[CI] Enable telemetry #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 1 commit into
openstack-k8s-operators:main
from
jancervenka:enable-telemetry
Nov 16, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| - name: Enable OpenStack Lightspeed metrics collection | ||
| hosts: "{{ cifmw_target_hook_host | default('localhost') }}" | ||
| connection: local | ||
| gather_facts: false | ||
| vars: | ||
| telemetry_namespace: "{{ cifmw_openstack_namespace | default(cifmw_install_yamls_defaults['NAMESPACE'] | default('openstack')) }}" | ||
| lightspeed_namespace: "{{ cifmw_openstack_lightspeed_namespace | default('openstack-lightspeed') }}" | ||
| lightspeed_metrics_target: "lightspeed-app-server.{{ lightspeed_namespace }}.svc:8443" | ||
| environment: | ||
| KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" | ||
| tasks: | ||
| # Configure the owning control plane after Lightspeed is ready. | ||
| # Lightspeed Service creation does not trigger MetricStorage reconciliation. | ||
| # See docs/development.md#telemetry-metrics-discovery. | ||
| - name: Enable metric storage in the OpenStack control plane | ||
| kubernetes.core.k8s: | ||
| state: present | ||
| merge_type: merge | ||
| definition: | ||
| apiVersion: core.openstack.org/v1beta1 | ||
| kind: OpenStackControlPlane | ||
| metadata: | ||
| name: controlplane | ||
| namespace: "{{ telemetry_namespace }}" | ||
| spec: | ||
| telemetry: | ||
| enabled: true | ||
| template: | ||
| metricStorage: | ||
| enabled: true | ||
| openStackLightspeedNamespace: "{{ lightspeed_namespace }}" | ||
| monitoringStack: | ||
| alertingEnabled: false | ||
| storage: | ||
| # CI only needs metrics for the lifetime of this job. | ||
| strategy: ephemeral | ||
|
|
||
| - name: Wait for metric storage to be ready | ||
| kubernetes.core.k8s_info: | ||
| api_version: telemetry.openstack.org/v1beta1 | ||
| kind: MetricStorage | ||
| name: metric-storage | ||
| namespace: "{{ telemetry_namespace }}" | ||
| wait: true | ||
| wait_condition: | ||
| type: Ready | ||
| status: "True" | ||
| wait_timeout: 600 | ||
| register: metric_storage | ||
| failed_when: metric_storage is failed or metric_storage.resources | default([]) | length == 0 | ||
|
|
||
| - name: Wait for telemetry to discover the Lightspeed metrics service | ||
| kubernetes.core.k8s_info: | ||
| api_version: monitoring.rhobs/v1alpha1 | ||
| kind: ScrapeConfig | ||
| name: telemetry-openstack-lightspeed | ||
| namespace: "{{ telemetry_namespace }}" | ||
| register: lightspeed_scrape_config | ||
| until: | ||
| - lightspeed_scrape_config.resources | default([]) | length == 1 | ||
| - >- | ||
| lightspeed_metrics_target in (lightspeed_scrape_config.resources[0].spec.staticConfigs | ||
| | map(attribute='targets') | flatten) | ||
| retries: 30 | ||
| delay: 10 | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,29 @@ cd ../.. | |
| `PULL_SECRET` is the same pull secret described in the | ||
| [installation guide](install_guide.md#access-to-registry-images). | ||
|
|
||
| ## Telemetry metrics discovery | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (non-blocking): Just realized ... This message should be also in the user section of the docs not only in the development (does not need to be so detailed). |
||
|
|
||
| For new deployments collecting metrics through telemetry-operator, wait for | ||
| `OpenStackLightspeed` to become `Ready` before enabling `MetricStorage` through | ||
| the `OpenStackControlPlane`. The CRC CI job uses this order so that the | ||
| `lightspeed-app-server` service exists when telemetry first discovers scrape | ||
| targets. | ||
|
|
||
| Telemetry currently discovers Lightspeed during `MetricStorage` reconciliation, | ||
| using `spec.openStackLightspeedNamespace` to locate its metrics service. The | ||
| service watch does not handle Lightspeed service events or map them to | ||
| `MetricStorage` resources in another namespace. If `MetricStorage` has already | ||
| reconciled before Lightspeed is installed, creating the service alone does not | ||
| trigger discovery. Another reconciliation, caused by an update to `MetricStorage` | ||
| or another watched resource, can discover it later. Until then, the | ||
| `telemetry-openstack-lightspeed` scrape configuration may be absent even when | ||
| `MetricStorage` reports `Ready`. | ||
|
|
||
| A future improvement in telemetry-operator would be to watch Lightspeed metrics | ||
| service events and reconcile the `MetricStorage` resources whose | ||
| `spec.openStackLightspeedNamespace` matches the service's namespace. This would | ||
| allow discovery regardless of installation order. | ||
|
|
||
| ## Releasing to the community catalog | ||
|
|
||
| The **Propose community operator release** GitHub Actions workflow uses | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 9914
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 22770
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 25680
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 21991
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 16754
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 9952
Web query:
Zuul final job project pipeline variables may not be further modified final job variants documentationResult:
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 13415
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 5326
Web query:
CentOS Stream 9 ansible-core appstream package version 2.14 ansible-core rpmResult:
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 12170
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 7969
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 14169
Script executed:
Repository: openstack-k8s-operators/lightspeed-operator
Length of output: 11635
Pass the resolved namespace to the metrics hook.
With a non-default install_yamls namespace and no explicit
cifmw_openstack_namespace, the hook can receive the bootstrap valueopenstack. It then targets the wrong control plane and can fail metrics setup. Pass the namespace resolved after install_yamls initialization, while preserving explicit overrides.