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

Fix and enable apache test on SLES and CentOS 7 #1166

Merged
merged 26 commits into from
Aug 8, 2023

Conversation

martijnvans
Copy link
Contributor

@martijnvans martijnvans commented Mar 20, 2023

Description

This PR adds two new features in service of removing the last few platforms_to_skip for apache:

  1. Certain metrics can be marked as unavailable on certain platforms in metadata.yaml.
  2. Same for certain log fields.

This is better than just marking the logs/metrics as optional, because they can be important on some platforms (so we do want coverage).

Related issue

#1173

How has this been tested?

automated tests only.

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

@martijnvans martijnvans changed the title Fix and enable apache test on SLES Fix and enable apache test on SLES and CentOS 7 Mar 23, 2023
@@ -49,6 +49,9 @@ type ExpectedMetric struct {
Representative bool `yaml:"representative,omitempty" validate:"excluded_with=Optional,excluded_with=Platform"`
// Exclusive metric to a particular kind of platform.
Platform string `yaml:"platform,omitempty" validate:"excluded_with=Representative,omitempty,oneof=linux windows"`
// A list of platforms that this metric is not available on.
// Examples: centos-7,debian-10. Not valid are linux,windows.
UnavailableOn []string `yaml:"unavailable_on,omitempty" validate:"excluded_with=Representative"`
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this information also needs to be propagated into the generated documentation… @sophieyfang WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

The metric side "unavailable on" is at the metric type level. The logging side seems at the field level. I feel like the field level shall be marked as "optional" instead of being "unavailable on". It might make more sense to only use "Unavailable on" when the metric or log doesn't exist for such a platform.

The metric side public doc has a consistent style look. See Ops Agent Metrics public doc, since that doc has a consistent style across all metrics public docs (especially that table look), I wonder where we can expose this info: That certain metric or log isn't available for certain platform. @mtabasko for thoughts.

Personally I think it's not urgent to reflect it to the public doc and definitely not reason to block this PR to be submitted by that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sophie and i discussed this a bit, and we agreed that since we don't surface "optional" for log fields or metrics in the docs, we don't need to surface "unavailable_on" either.

If we decided to surface that information later, we could do it by saying something like "this metric/log field may be unavailable on some platforms" if optional or unavailable_on are specified.

regarding sophie's suggestion to use "optional' instead of 'unavailable_on" for log fields, we haven't decided yet. I'm OK with that approach but I think unavailable_on is going to produce slightly better test coverage. The difference is probably minimal though.

@martijnvans martijnvans requested review from a team and rafaelwestphal and removed request for a team August 8, 2023 14:57
}
return result
}

func runLoggingTestCases(ctx context.Context, logger *logging.DirectoryLogger, vm *gce.VM, logs []*metadata.ExpectedLog) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is related, can we remove the hack related to b/239240173 on line 602 (bug is marked as fixed)?
If we can not, change it to this new format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the bug number. I think the bug is still not fixed. I'm not sure what you mean about changing it to the new format; the feature in this PR cannot be used for aerospike + SLES because this PR only includes a feature for missing log FIELDS, not logs that are entirely missing. It wouldn't be hard to add that feature though, do you want me to do that in this PR or a separate one?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok, got it. Thanks for updating it.

@martijnvans martijnvans merged commit 674de2b into master Aug 8, 2023
6 checks passed
@martijnvans martijnvans deleted the martijnvans-apache-sles branch August 8, 2023 19:53
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.

4 participants