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

LOG-5186: Refactor input filter for includes and excludes #2404

Conversation

cahartma
Copy link
Contributor

Description

Some local tests are still failing so doubtful this will pass all of CI yet, but need to get this moving, so here goes. Please review and comment!

/cc @Clee2691 @vparfonov
/assign @jcantrill

Refactor the custom application include/exclude to change from:

    inputs:
    - application:
        namespaces:
        - app-ns    
        excludeNamespaces:
        - test*
        containers:
          include:
          - nginx     
          exclude:
          - logger          

to

    inputs:
    - application:
      - includes:
        - namespace: app-ns
          container: "*"
        - container: nginx
          namespace: "*"
      - excludes:
        - namespace: "test*"
          container: "*"
        - container: logger
          namespace: "*"        

Acceptance Criteria:

  • Verify when an include/exclude entry only defines "namespace" that it applies to all containers (e.g. *)
  • Verify when an include/exclude entry only defines "container" that it applies to all namespaces (e.g. *)
  • Verify multiple includes combinations results in logs included from each of the matches
  • Verify multiple excludes combinations results in logs excluded from each of the matches
  • Verify only includes that are not in the excludes list are matched. (i.e. excludes take precedence and are run first)
  • Verify the CEE documentation is updated to reflect the changes
  • Verify the enhancement documentation is updated to reflect the changes
  • Verify "namespaces" field as marked as deprecated
  • Verify the entries of the "namespaces" field are added to the list of "includes" in the generated configuration
  • Verify related/linked bugs are resolved

TODO:

  • create upstream docs
  • update CEE slides

Links

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 13, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 13, 2024

@cahartma: This pull request references LOG-5186 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.8.0" version, but no target version was set.

In response to this:

Description

Some local tests are still failing so doubtful this will pass all of CI yet, but need to get this moving, so here goes. Please review and comment!

/cc @Clee2691 @vparfonov
/assign @jcantrill

Refactor the custom application include/exclude to change from:

   inputs:
   - application:
       namespaces:
       - app-ns    
       excludeNamespaces:
       - test*
       containers:
         include:
         - nginx     
         exclude:
         - logger          

to

   inputs:
   - application:
     - includes:
       - namespace: app-ns
         container: "*"
       - container: nginx
         namespace: "*"
     - excludes:
       - namespace: "test*"
         container: "*"
       - container: logger
         namespace: "*"        

Acceptance Criteria:

  • Verify when an include/exclude entry only defines "namespace" that it applies to all containers (e.g. *)
  • Verify when an include/exclude entry only defines "container" that it applies to all namespaces (e.g. *)
  • Verify multiple includes combinations results in logs included from each of the matches
  • Verify multiple excludes combinations results in logs excluded from each of the matches
  • Verify only includes that are not in the excludes list are matched. (i.e. excludes take precedence and are run first)
  • Verify the CEE documentation is updated to reflect the changes
  • Verify the enhancement documentation is updated to reflect the changes
  • Verify "namespaces" field as marked as deprecated
  • Verify the entries of the "namespaces" field are added to the list of "includes" in the generated configuration
  • Verify related/linked bugs are resolved

TODO:

  • create upstream docs
  • update CEE slides

Links

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 13, 2024
@cahartma
Copy link
Contributor Author

/retest

@cahartma cahartma force-pushed the LOG-5186-improved-input-filter-api branch from 1c1fc54 to ec423a9 Compare March 14, 2024 13:41
@cahartma
Copy link
Contributor Author

/retest

@cahartma cahartma force-pushed the LOG-5186-improved-input-filter-api branch from ec423a9 to 1d0efce Compare March 14, 2024 16:08
@cahartma
Copy link
Contributor Author

/test lint

Copy link
Contributor

@jcantrill jcantrill left a comment

Choose a reason for hiding this comment

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

/hold

api/logging/v1/input_types.go Outdated Show resolved Hide resolved
api/logging/v1/input_types.go Outdated Show resolved Hide resolved
api/logging/v1/input_types.go Outdated Show resolved Hide resolved
@@ -306,6 +306,7 @@ max_read_bytes = 3145728
glob_minimum_cooldown_ms = 15000
auto_partial_merge = true
include_paths_glob_patterns = ["/var/log/pods/test-ns_*/*/*.log"]
exclude_paths_glob_patterns = ["/var/log/pods/*/*/*.gz", "/var/log/pods/*/*/*.tmp", "/var/log/pods/default_*/*/*.log", "/var/log/pods/kube*_*/*/*.log", "/var/log/pods/openshift*_*/*/*.log"]
Copy link
Contributor

Choose a reason for hiding this comment

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

@Clee2691 noted this is unnecessary given the include will never match the exclude which was a change I made for the original implementation. If it is more challenging in the implementation, I can be swayed to leave as-is

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'd prefer to keep it there for all. I wrote it to handle "*" but think it makes more sense to have it present.

internal/generator/vector/input/viaq_test.go Show resolved Hide resolved
@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2024
@cahartma cahartma force-pushed the LOG-5186-improved-input-filter-api branch from 1d0efce to 89c4989 Compare March 14, 2024 19:18
@cahartma
Copy link
Contributor Author

/retest

1 similar comment
@cahartma
Copy link
Contributor Author

/retest

@cahartma cahartma force-pushed the LOG-5186-improved-input-filter-api branch from 89c4989 to 21fb917 Compare March 15, 2024 16:43
@cahartma cahartma force-pushed the LOG-5186-improved-input-filter-api branch from 21fb917 to 178ae8f Compare March 15, 2024 16:44
Copy link
Contributor

openshift-ci bot commented Mar 15, 2024

@cahartma: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ocp-target-minus-two 178ae8f link false /test e2e-ocp-target-minus-two
ci/prow/functional 178ae8f link false /test functional

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@jcantrill
Copy link
Contributor

/hold cancel
/approve
/lgtm

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Mar 15, 2024
Copy link
Contributor

openshift-ci bot commented Mar 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cahartma, jcantrill

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 3b403a3 into openshift:master Mar 15, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. release/5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants