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

Export Prometheus metrics #87

Merged
merged 6 commits into from
Oct 4, 2023
Merged

Export Prometheus metrics #87

merged 6 commits into from
Oct 4, 2023

Conversation

loaynaser3
Copy link
Contributor

adding option for "exporter"
this is an initial PR, simple way of exporting metrics
@yonahd , @Yuni-sa how you think we should proceed from here ?

@Yuni-sa
Copy link
Contributor

Yuni-sa commented Sep 21, 2023

@loaynaser3 @yonahd
this looks really good I think I have everything else set up regarding the helm packaging and deployment can I add it here or should I create I different pr for the helm chart?

@Yuni-sa
Copy link
Contributor

Yuni-sa commented Sep 21, 2023

also, it's probably best to source the time interval from an environment variable, allowing for easy changes from the helm chart.

@yonahd
Copy link
Owner

yonahd commented Sep 21, 2023

@loaynaser3 @yonahd this looks really good I think I have everything else set up regarding the helm packaging and deployment can I add it here or should I create I different pr for the helm chart?

Let's put the chart changes in a separate PR

@yonahd
Copy link
Owner

yonahd commented Sep 21, 2023

also, it's probably best to source the time interval from an environment variable, allowing for easy changes from the helm chart.

+1
Just create some default value if the environment variable doesn't exist.

get exporter interval from env var otherwise default value
vars is exporterInterval
+ updating README
@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2023

Codecov Report

Attention: 33 lines in your changes are missing coverage. Please review.

Comparison is base (f3235b0) 49.36% compared to head (3c44abd) 42.82%.
Report is 4 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #87      +/-   ##
==========================================
- Coverage   49.36%   42.82%   -6.54%     
==========================================
  Files          15       17       +2     
  Lines        1493     1749     +256     
==========================================
+ Hits          737      749      +12     
- Misses        657      898     +241     
- Partials       99      102       +3     
Files Coverage Δ
pkg/kor/exporter.go 5.71% <5.71%> (ø)

... and 14 files with indirect coverage changes

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

@loaynaser3 loaynaser3 marked this pull request as ready for review September 21, 2023 19:03
pkg/kor/exporter.go Outdated Show resolved Hide resolved
@yonahd yonahd linked an issue Sep 24, 2023 that may be closed by this pull request
@yonahd
Copy link
Owner

yonahd commented Sep 26, 2023

@loaynaser3 Looking over the implementation now.
There is a use case that comes to mind where a user want to run kor only for some resources and would still like to get metrics. What would be the cost of implementing this as a flag for the commands?
e.g.
kor cm,secret --metrics
or something like that

@loaynaser3
Copy link
Contributor Author

@yonahd i thought of this scenario but i didnt see the use of it.
regarding this change its not a major change, we can add a call function to root and change the if condition to switch case

@yonahd
Copy link
Owner

yonahd commented Sep 27, 2023

@yonahd i thought of this scenario but i didnt see the use of it. regarding this change its not a major change, we can add a call function to root and change the if condition to switch case

Ok. Let's keep it this way for now.
Is this ready for review?

@loaynaser3
Copy link
Contributor Author

@yonahd yes

Copy link
Owner

@yonahd yonahd left a comment

Choose a reason for hiding this comment

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

@loaynaser3 Looks good.
A couple small comments

pkg/kor/exporter.go Outdated Show resolved Hide resolved
pkg/kor/exporter.go Outdated Show resolved Hide resolved
pkg/kor/exporter.go Outdated Show resolved Hide resolved
@yonahd
Copy link
Owner

yonahd commented Oct 4, 2023

@loaynaser3 Can you also change the name of the pull request

@loaynaser3 loaynaser3 changed the title issue-40, initial commit Export Prometheus metrics Oct 4, 2023
Copy link
Owner

@yonahd yonahd left a comment

Choose a reason for hiding this comment

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

LGTM

@yonahd yonahd merged commit 605cf95 into yonahd:main Oct 4, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: Export Prometheus metrics
5 participants