Skip to content

Add arbitrary labels on a per-database basis #287

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
merged 2 commits into from
Jul 28, 2025

Conversation

neilschelly
Copy link
Contributor

This accomplishes the feature request that I entered at #275

Arbitrary per-database labels can be added to the database stanzas in the configuration, like:

    # labels:
    #   - name: label_name
    #     value: label_value
    #   - name: label_name2
    #     value: label_value2

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 Jul 23, 2025
@neilschelly
Copy link
Contributor Author

My boss was successful in submitting the OCA for our company yesterday. I'm trying now to figure out how that attaches to my username now.

@@ -66,19 +66,33 @@ func (d *Database) ping(logger *slog.Logger) error {
}

func (d *Database) constLabels() map[string]string {
return map[string]string{
Copy link
Member

@anders-swanson anders-swanson Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be a function of the exporter now that it involves dynamic labels beyond what a given database has

@anders-swanson
Copy link
Member

anders-swanson commented Jul 23, 2025

Behavior looks good, see the stylistic and config suggestions. OCA may take a bit to update, I would suggest checking again in a couple days for your company name on https://oca.opensource.oracle.com/

* Ensuring the list of allConstLabels is part of the exporter now, and it's passed into the Database each time its needed in there.
* Adjusting the format of the label/value from a list of name/value pairs to a map of strings.
@anders-swanson
Copy link
Member

Approved pending OCA

@markxnelson
Copy link
Member

Confirmed OCA is signed and processed.

@markxnelson markxnelson merged commit 71d4800 into oracle:main Jul 28, 2025
0 of 2 checks passed
@neilschelly neilschelly deleted the add-per-database-labels branch July 28, 2025 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants