netobserv / flowlogs-pipeline

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

Refactor metrics #590

Closed KalmanMeth closed 7 months ago

KalmanMeth commented 7 months ago

Description

Refactor Metrics code so that it is common for Prometheus and OpenTelemetry metrics. This removes duplicate code and now gives us the implementation for OpenTelemetry histograms.

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.

codecov[bot] commented 7 months ago

Codecov Report

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

Project coverage is 67.06%. Comparing base (5e89c89) to head (9b8e42d). Report is 11 commits behind head on main.

Files Patch % Lines
...ipeline/encode/opentelemetry/encode_otlpmetrics.go 23.63% 42 Missing :warning:
pkg/pipeline/encode/metrics_common.go 79.59% 22 Missing and 8 partials :warning:
pkg/pipeline/encode/encode_prom.go 83.33% 5 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #590 +/- ## ========================================== + Coverage 66.04% 67.06% +1.02% ========================================== Files 103 104 +1 Lines 7509 7405 -104 ========================================== + Hits 4959 4966 +7 + Misses 2256 2143 -113 - Partials 294 296 +2 ``` | [Flag](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/590/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/590/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `67.06% <68.00%> (+1.02%)` | :arrow_up: | 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.

openshift-ci[bot] commented 7 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from jpinsonneau. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/netobserv/flowlogs-pipeline/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jotak commented 7 months ago

/lgtm