Skip to content
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

feat: add exceptions source file parameter #16

Merged
merged 2 commits into from
Jul 4, 2022

Conversation

gsanchezgavier
Copy link
Contributor

@gsanchezgavier gsanchezgavier commented Jun 27, 2022

This PR adds the possibility to define the metrics exceptions in a separate file.
This will allow to specify different exceptions for different versions of a particular integration being tested without the need to create a complete spec file.
Using this on newrelic/nri-kubernetes#438 we will define different exceptions files for the different k8s versions. One option to implement this would be to select the except file using an environment variable on the CI

# ...
        - source: "powerdns.yml"
          exceptions_source: ${EXCEPTION_FILE}

@gsanchezgavier gsanchezgavier force-pushed the add-metric-except-source branch from cfe1fb9 to 9353eaf Compare June 27, 2022 09:17
@gsanchezgavier gsanchezgavier requested a review from a team June 27, 2022 09:20
Copy link

@sigilioso sigilioso left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks for taking care of it!

I have a question regarding its usage: if a metric is replaced by another in a particular version, both metrics will be in the spec file and we will need an exception for the new metric in previous versions and another exception for the old metric in new versions, won't we?

@gsanchezgavier
Copy link
Contributor Author

@sigilioso
I added an example on how to use this on the PR description , not sure if that clarify how it could be used. WDYT

@sigilioso
Copy link

@sigilioso I added an example on how to use this on the PR description , not sure if that clarify how it could be used. WDYT

I just was wondering how to face the "metric replacement" use case. With the usage example is even more clearer, thanks! 👍

An example of that use case: if m1 is replaced by m2 in v.X version. Then, using this approach:

  • exceptions_file should include an exclusion for m2 when version < v.X
  • exceptions_file should include an exclusion for m1 when version >= v.X

Copy link
Contributor

@marcsanmi marcsanmi left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@gsanchezgavier gsanchezgavier merged commit 2613d19 into main Jul 4, 2022
@gsanchezgavier gsanchezgavier deleted the add-metric-except-source branch July 4, 2022 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants