netobserv / flowlogs-pipeline

Transform flow logs into metrics
Apache License 2.0
75 stars 23 forks source link

NETOBSERV-1427: Added config watcher and supporting metrics reloading #607

Closed OlivierCazade closed 5 months ago

OlivierCazade commented 7 months ago

Description

Added new type to watch a configmap and notify prometheus encoder

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

openshift-ci-robot commented 7 months ago

@OlivierCazade: This pull request references NETOBSERV-1427 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 story to target the "4.16.0" version, but no target version was set.

In response to [this](https://github.com/netobserv/flowlogs-pipeline/pull/607): >## Description > >Added new type to watch a configmap and notify prometheus encoder > >## Dependencies > >n/a > >## Checklist > >If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that. > >* [X] Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist. >* [X] Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix _(in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes)._ >* [ ] Does this PR require product documentation? > * [ ] If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs. >* [X] Does this PR require a product release notes entry? > * [ ] If so, fill in "Release Note Text" in the JIRA. >* [ ] Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc. > * [ ] If so, make sure it is described in the JIRA ticket. >* QE requirements (check 1 from the list): > * [X] Standard QE validation, with pre-merge tests unless stated otherwise. > * [ ] Regression tests only (e.g. refactoring with no user-facing change). > * [ ] No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team). > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=netobserv%2Fflowlogs-pipeline). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 13.96104% with 265 lines in your changes are missing coverage. Please review.

Project coverage is 65.11%. Comparing base (d2b2352) to head (3d16544). Report is 2 commits behind head on main.

:exclamation: Current head 3d16544 differs from pull request most recent head 2e05954. Consider uploading reports for the commit 2e05954 to get more accurate results

Files Patch % Lines
pkg/pipeline/encode/encode_prom.go 6.32% 163 Missing :warning:
pkg/pipeline/pipeline_watcher.go 8.95% 61 Missing :warning:
pkg/utils/kubernetes.go 0.00% 22 Missing :warning:
pkg/pipeline/encode/encode_s3.go 0.00% 4 Missing :warning:
...ipeline/encode/opentelemetry/encode_otlpmetrics.go 40.00% 3 Missing :warning:
pkg/pipeline/pipeline.go 66.66% 2 Missing and 1 partial :warning:
pkg/pipeline/encode/encode.go 0.00% 2 Missing :warning:
pkg/pipeline/encode/encode_kafka.go 0.00% 2 Missing :warning:
...g/pipeline/encode/opentelemetry/encode_otlplogs.go 0.00% 2 Missing :warning:
.../pipeline/encode/opentelemetry/encode_otlptrace.go 0.00% 2 Missing :warning:
... and 1 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #607 +/- ## ========================================== - Coverage 67.41% 65.11% -2.31% ========================================== Files 102 112 +10 Lines 7589 7940 +351 ========================================== + Hits 5116 5170 +54 - Misses 2162 2456 +294 - Partials 311 314 +3 ``` | [Flag](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/607/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/607/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `65.11% <13.96%> (-2.31%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter commented 6 months ago

Codecov Report

Attention: Patch coverage is 15.86716% with 228 lines in your changes are missing coverage. Please review.

Project coverage is 66.49%. Comparing base (a5ad247) to head (c306f62). Report is 5 commits behind head on main.

Files Patch % Lines
pkg/pipeline/encode/encode_prom.go 10.00% 90 Missing :warning:
pkg/pipeline/pipeline_watcher.go 8.47% 54 Missing :warning:
pkg/pipeline/pipeline_builder.go 22.85% 26 Missing and 1 partial :warning:
pkg/utils/kubernetes.go 0.00% 17 Missing :warning:
pkg/config/pipeline_builder.go 0.00% 16 Missing :warning:
pkg/config/config.go 0.00% 5 Missing and 1 partial :warning:
pkg/pipeline/encode/encode_s3.go 0.00% 4 Missing :warning:
...ipeline/encode/opentelemetry/encode_otlpmetrics.go 40.00% 3 Missing :warning:
pkg/pipeline/encode/encode.go 0.00% 2 Missing :warning:
pkg/pipeline/encode/encode_kafka.go 0.00% 2 Missing :warning:
... and 4 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #607 +/- ## ========================================== - Coverage 67.43% 66.49% -0.94% ========================================== Files 102 104 +2 Lines 7593 6659 -934 ========================================== - Hits 5120 4428 -692 + Misses 2162 1916 -246 - Partials 311 315 +4 ``` | [Flag](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/607/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/607/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `66.49% <15.86%> (-0.94%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

OlivierCazade commented 5 months ago

/retest

jotak commented 5 months ago

thanks @OlivierCazade ! /lgtm

memodi commented 5 months ago

/label qe-approved

openshift-ci-robot commented 5 months ago

@OlivierCazade: This pull request references NETOBSERV-1427 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 story to target the "4.16.0" version, but no target version was set.

In response to [this](https://github.com/netobserv/flowlogs-pipeline/pull/607): >## Description > >Added new type to watch a configmap and notify prometheus encoder > >## Dependencies > >n/a > >## Checklist > >If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that. > >* [X] Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist. >* [X] Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix _(in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes)._ >* [ ] Does this PR require product documentation? > * [ ] If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs. >* [X] Does this PR require a product release notes entry? > * [ ] If so, fill in "Release Note Text" in the JIRA. >* [ ] Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc. > * [ ] If so, make sure it is described in the JIRA ticket. >* QE requirements (check 1 from the list): > * [X] Standard QE validation, with pre-merge tests unless stated otherwise. > * [ ] Regression tests only (e.g. refactoring with no user-facing change). > * [ ] No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team). > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=netobserv%2Fflowlogs-pipeline). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
OlivierCazade commented 5 months ago

/approve

openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: OlivierCazade

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: - ~~[OWNERS](https://github.com/netobserv/flowlogs-pipeline/blob/main/OWNERS)~~ [OlivierCazade] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment