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

add config parameter to suppress go metrics #394

Merged
merged 2 commits into from
Mar 9, 2023

Conversation

KalmanMeth
Copy link
Collaborator

@KalmanMeth KalmanMeth commented Feb 20, 2023

To suppress the Go metrics, add to the config file:

metrics-settings:
  suppressGoMetrics: true

@openshift-ci
Copy link

openshift-ci bot commented Feb 20, 2023

[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 kalmanmeth. 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

@KalmanMeth KalmanMeth changed the title add config parameter to supress go metrics add config parameter to suppress go metrics Feb 20, 2023
@KalmanMeth KalmanMeth requested a review from ronensc March 1, 2023 11:10
@@ -38,7 +38,7 @@ type ConfigFileStruct struct {
LogLevel string `yaml:"log-level,omitempty" json:"log-level,omitempty"`
Pipeline []Stage `yaml:"pipeline,omitempty" json:"pipeline,omitempty"`
Parameters []StageParam `yaml:"parameters,omitempty" json:"parameters,omitempty"`
MetricsSettings MetricsSettings `yaml:"metricsSettings,omitempty" json:"metricsSettings,omitempty"`
MetricsSettings MetricsSettings `yaml:"metrics-settings,omitempty" json:"metrics-settings,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the camelCase was replaced by kebab-case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed back. We should consider changing also log-level to be consistent.

Copy link
Member

Choose a reason for hiding this comment

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

I don't get it ... it was previously kebab-case and not camelCase, no??
On the operator side, it's using metrics-settings to configure FLP (so, changing this would be a breaking change are require operator PR)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm fine either way. Let's just make a decision and try to be consistent.

Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC, the conflict rises because MetricsSettings can be set both in the command-line and in the config file.
While the convention of the command-line arguments seems to be kebab-case (log-level is the only other example), the convention of the config file is camelCase.
If we want to keep both conventions and avoid changing the operator's code, I think the easiest solution would be to keep the tags of the fields of ConfigFileStruct that are shared with the command-line arguments formatted as kebab-case.
And the only thing left to do is to revert the change of the command-line argument in
https://github.com/netobserv/flowlogs-pipeline/pull/394/files#diff-704c1b33b10fb781ff935cf83d44f3e6c9a48efdcb46c008463c2223ab43717eR146

@jotak @KalmanMeth WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2023

Codecov Report

Merging #394 (af9f112) into main (9ad743f) will decrease coverage by 0.07%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #394      +/-   ##
==========================================
- Coverage   61.07%   61.00%   -0.07%     
==========================================
  Files          92       92              
  Lines        6399     6403       +4     
==========================================
- Hits         3908     3906       -2     
- Misses       2257     2262       +5     
- Partials      234      235       +1     
Flag Coverage Δ
unittests 61.00% <0.00%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
cmd/flowlogs-pipeline/main.go 0.00% <0.00%> (ø)
pkg/config/config.go 63.33% <ø> (ø)
pkg/pipeline/extract/timebased/heap.go 97.82% <0.00%> (-2.18%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@openshift-ci openshift-ci bot added the lgtm label Mar 9, 2023
@KalmanMeth KalmanMeth merged commit 665de17 into netobserv:main Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to filter out operational metrics (via configuration or command line flag)
5 participants