Skip to content

CTOR 2085 - Plugin(cloud::google::gcp::management::stackdriver) - Mode(getmetrics): fix unit path #5889

Merged
scresto31 merged 7 commits intodevelopfrom
CTOR-2085-plugin-cloud-google-gcp-management-stackdriver-mode-getmetrics-unit-fix
Mar 10, 2026
Merged

CTOR 2085 - Plugin(cloud::google::gcp::management::stackdriver) - Mode(getmetrics): fix unit path #5889
scresto31 merged 7 commits intodevelopfrom
CTOR-2085-plugin-cloud-google-gcp-management-stackdriver-mode-getmetrics-unit-fix

Conversation

@itoussies
Copy link
Copy Markdown
Contributor

@itoussies itoussies commented Dec 9, 2025

Refs:CTOR-2085

Centreon team (internal PR)

Description

  • Fixed the path when searching the metric unit. Moreover, put '' instead of 'undef' for the unit if the API doesn't return the unit field.
  • Added a new message when we can't find any metrics or when the API does not return the mean or count values for distribution metrics:
UNKNOWN: No metrics. Check your options or check GCP API distribution metrics' time series points returns the mean or count vlaues.
  • Moved the test folder from tests/gcp to tests/google/gcp so we have the same folder path as the src folder.

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Functionality enhancement or optimization (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

How this pull request can be tested ?

Please describe the procedure to verify that the goal of the PR is matched.
Provide clear instructions so that it can be correctly tested.
Mention the automated tests included in this FOR (what they test like mode/option combinations).

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (develop).
  • In case of a new plugin, I have created the new packaging directory accordingly.
  • I have implemented automated tests related to my commits.
    • Data used for automated tests are anonymized.
  • I have reviewed all the help messages in all the .pm files I have modified.
    • All sentences begin with a capital letter.
    • All sentences end with a period.
    • I am able to understand all the help messages, if not, exchange with the PO or TW to rewrite them.
  • After having created the PR, I will make sure that all the tests provided in this PR have run and passed.

Summary by Aikido

Security Issues: 0 Quality Issues: 0 Resolved Issues: 0

⚡ Enhancements

  • Added explicit error message when no metrics or missing distribution values.
  • Passed new dimension_zeroed option to API and handled zeroed dimension.
  • Added libjson-perl to packaging dependencies for JSON handling.

🐛 Bugfixes

  • Fixed metric unit path lookup and used empty string for unit.

🔧 Refactors

  • Moved tests folder from tests/gcp to tests/google/gcp for consistency.

More info

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 9, 2025

Logo
Checkmarx One – Scan Summary & Detailsaedac884-b577-49a1-8e6f-77eb4a422095


New Issues (9) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 MEDIUM Use_of_Broken_or_Risky_Cryptographic_Algorithm /src/network/hp/athonet/nodeexporter/api/custom/api.pm: 131
detailsIn , the application protects sensitive data using a cryptographic algorithm, md5_hex, that is considered weak or even trivially broken, in /src/n...
Attack Vector
2 MEDIUM Use_of_Broken_or_Risky_Cryptographic_Algorithm /src/network/hp/athonet/nodeexporter/api/custom/api.pm: 127
detailsIn , the application protects sensitive data using a cryptographic algorithm, md5_hex, that is considered weak or even trivially broken, in /src/n...
Attack Vector
3 MEDIUM Use_of_Broken_or_Risky_Cryptographic_Algorithm /src/apps/monitoring/nodeexporter/linux/mode/cpu.pm: 193
detailsIn , the application protects sensitive data using a cryptographic algorithm, md5_hex, that is considered weak or even trivially broken, in /src/a...
Attack Vector
4 MEDIUM Use_of_Broken_or_Risky_Cryptographic_Algorithm /src/apps/monitoring/nodeexporter/windows/mode/cpu.pm: 159
detailsIn , the application protects sensitive data using a cryptographic algorithm, md5_hex, that is considered weak or even trivially broken, in /src/a...
Attack Vector
5 MEDIUM Use_of_Broken_or_Risky_Cryptographic_Algorithm /src/apps/monitoring/nodeexporter/windows/mode/traffic.pm: 149
detailsIn , the application protects sensitive data using a cryptographic algorithm, md5_hex, that is considered weak or even trivially broken, in /src/a...
Attack Vector
6 MEDIUM Use_of_Broken_or_Risky_Cryptographic_Algorithm /src/apps/monitoring/nodeexporter/linux/mode/traffic.pm: 148
detailsIn , the application protects sensitive data using a cryptographic algorithm, md5_hex, that is considered weak or even trivially broken, in /src/a...
Attack Vector
7 LOW Permissive_Regular_Expression /src/cloud/prometheus/exporters/nodeexporter/mode/uptime.pm: 125 Attack Vector
8 LOW Permissive_Regular_Expression /src/cloud/prometheus/exporters/nodeexporter/mode/interfaces.pm: 83 Attack Vector
9 LOW Permissive_Regular_Expression /src/cloud/prometheus/exporters/nodeexporter/mode/interfaces.pm: 83 Attack Vector

sc979
sc979 previously approved these changes Dec 10, 2025
@scresto31 scresto31 requested review from a team, BaptisteCentreon, asbzk and sc979 and removed request for a team March 9, 2026 16:30
@scresto31 scresto31 merged commit 689fb02 into develop Mar 10, 2026
126 of 128 checks passed
@scresto31 scresto31 deleted the CTOR-2085-plugin-cloud-google-gcp-management-stackdriver-mode-getmetrics-unit-fix branch March 10, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants