Skip to content

[FEAT] Add YAML support for default and custom metrics definition #302

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Supporterino
Copy link

Overview

This pull request introduces the ability to define custom and default metrics for the oracle-db-appdev-monitoring project using YAML files, in addition to the existing TOML format. This enhancement aims to provide users with greater flexibility and familiarity, as YAML is widely used for configuration in many DevOps and cloud-native environments.

Changes

  • YAML Parsing: Added support for parsing metric definitions from .yaml and .yml files.
  • Unified Loader: Refactored the metric loader to handle both TOML and YAML formats seamlessly.

Usage

Users can now define their metrics in either TOML or YAML format. The application will automatically detect the file type based on the extension and parse accordingly.

Example YAML Metric Definition

metrics:
  - context: "shared_memory_pools"
    metricsdesc:
      size_mb: "Gauge metric with the size of the shared memory pools in megabytes."
      used_mb: "Gauge metric with the used size of the shared memory pools in megabytes."
      free_mb: "Gauge metric with the free size of the shared memory pools in megabytes."
    labels: [pool]
    request: "SELECT pool, ROUND(SUM(bytes) / 1024 / 1024, 2) AS size_mb, ROUND(SUM(CASE WHEN name != 'free memory' THEN bytes ELSE 0 END) / 1024 / 1024, 2) AS used_mb, ROUND(SUM(CASE WHEN name = 'free memory' THEN bytes ELSE 0 END) / 1024 / 1024, 2) AS free_mb FROM v$sgastat WHERE pool IS NOT NULL GROUP BY pool ORDER BY pool"

Backward Compatibility

  • Existing TOML files will continue to work without modification.
  • No breaking changes to the configuration interface.

Closes: #299

Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Aug 13, 2025
Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant