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

refact "cscli metrics" part 3 #2807

Merged
merged 8 commits into from Feb 6, 2024
Merged

refact "cscli metrics" part 3 #2807

merged 8 commits into from Feb 6, 2024

Conversation

mmetc
Copy link
Contributor

@mmetc mmetc commented Feb 1, 2024

  • missing a couple tests for "metrics list" and "metrics show"
  • the help text for "cscli metrics" should be changed (different than "cscli metrics show")
  • "cscli metrics show" requires at least one section name, could be optional to show them all
  • I think we should we display empty tables if explicitly required? We do it for json/raw
  • metrics list should maybe add a description for each table? and support -o json

@mmetc mmetc added this to the 1.6.1 milestone Feb 1, 2024
Copy link

github-actions bot commented Feb 1, 2024

@mmetc: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

github-actions bot commented Feb 1, 2024

@mmetc: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@mmetc mmetc added kind/enhancement New feature or request and removed needs/kind needs/area labels Feb 1, 2024
Copy link

codecov bot commented Feb 1, 2024

Codecov Report

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

Comparison is base (81acad0) 57.27% compared to head (60cb82b) 57.60%.

Files Patch % Lines
cmd/crowdsec-cli/metrics_table.go 79.54% 11 Missing and 7 partials ⚠️
cmd/crowdsec-cli/metrics.go 93.75% 8 Missing and 3 partials ⚠️
cmd/crowdsec-cli/support.go 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2807      +/-   ##
==========================================
+ Coverage   57.27%   57.60%   +0.32%     
==========================================
  Files         238      238              
  Lines       30584    30748     +164     
==========================================
+ Hits        17518    17712     +194     
+ Misses      11415    11389      -26     
+ Partials     1651     1647       -4     
Flag Coverage Δ
bats 37.52% <88.64%> (+0.42%) ⬆️
unit-linux 52.22% <ø> (-0.01%) ⬇️
unit-windows 47.75% <ø> (ø)

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
Contributor

@buixor buixor left a comment

Choose a reason for hiding this comment

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

code structure

Use: "show [section]...",
Short: "Display crowdsec prometheus metrics.",
Long: `Fetch metrics from the prometheus server and display them in a human-friendly way`,
Args: cobra.MinimumNArgs(1),
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add some long examples with the most useful show subsections :)

@mmetc mmetc marked this pull request as draft February 2, 2024 13:20
@mmetc mmetc marked this pull request as ready for review February 5, 2024 08:06
@mmetc mmetc merged commit fdc5251 into master Feb 6, 2024
17 checks passed
@mmetc mmetc deleted the cscli-metrics-3 branch February 6, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cscli kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants