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

Refactor metrics #590

Merged
merged 5 commits into from
Feb 26, 2024
Merged

Refactor metrics #590

merged 5 commits into from
Feb 26, 2024

Conversation

KalmanMeth
Copy link
Collaborator

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.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • 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.
  • 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):
    • 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).

Copy link

codecov bot commented Feb 12, 2024

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 ⚠️
pkg/pipeline/encode/metrics_common.go 79.59% 22 Missing and 8 partials ⚠️
pkg/pipeline/encode/encode_prom.go 83.33% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            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 Coverage Δ
unittests 67.06% <68.00%> (+1.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@jpinsonneau jpinsonneau left a comment

Choose a reason for hiding this comment

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

Small comments, otherwise looks good ! Thanks @KalmanMeth

info *encode.MetricInfo
}
*/
const defaultExpiryTime = time.Duration(2 * time.Minute)
Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason to keep this outside of metrics_common ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe move this file under a new prometheus folder ?

pkg/pipeline/encode/opentelemetry/encode_otlpmetrics.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot added the lgtm label Feb 26, 2024
@KalmanMeth KalmanMeth changed the title WIP - Refactor metrics Refactor metrics Feb 26, 2024
@openshift-ci openshift-ci bot removed the lgtm label Feb 26, 2024
Copy link

openshift-ci bot commented Feb 26, 2024

[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:

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

@jotak
Copy link
Member

jotak commented Feb 26, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 26, 2024
@KalmanMeth KalmanMeth merged commit 45bf277 into netobserv:main Feb 26, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants