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

[kubernetes] Capture json output for nodes #3509

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcastill
Copy link
Member

@jcastill jcastill commented Feb 7, 2024

json outputs are easier to parse than the default
output, so lets capture these.

Resolves: #3484

Co-authored-by: Hervé CHIBOIS


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname email@example.com?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?

@jcastill
Copy link
Member Author

jcastill commented Feb 7, 2024

This is a result of the conversation from the issue linked above. I'm not sure about changing the output directly to json, I think it may be better to have json and default output, but I've opened this so we can discuss either option.

Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3509
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Copy link
Contributor

@pmoravec pmoravec left a comment

Choose a reason for hiding this comment

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

As we are changing the formatted string, could we move to f-string already..?

json outputs are easier to parse than the default
output, so lets capture these.

Resolves: sosreport#3484

Co-authored-by: Hervé CHIBOIS <herve@chibois.net>

Signed-off-by: Jose Castillo <jcastillo@redhat.com>
@jcastill jcastill force-pushed the jcastillo-add-json-kubernetes branch from 44c2044 to 3d38287 Compare February 8, 2024 10:09
@arif-ali
Copy link
Member

arif-ali commented Feb 8, 2024

so we are using kube_get_cmd only in 2 places for json output the rest is standard output? If we're going to change it for one, shouldn't we change it for all?

Personally, if I am looking at it, I would ideally look at the standard output, and then potentially if parsing through jq or other tools is required, I would then look at the json. Would it make sense to have both human-readable files as well as the json output?

@jcastill
Copy link
Member Author

jcastill commented Feb 8, 2024

That's what I was thinking, to gather both. In this case we don't lose any data and users and scripts can process both without having to transform what we currently capture. Only thing I'd modify perhaps is to add the jsons in a specific directory but that may break things now. So, both 'normal' and 'json' in the same directories where they are captured?

@hchybz
Copy link

hchybz commented Feb 9, 2024

This is a result of the conversation from the issue linked above. I'm not sure about changing the output directly to json, I think it may be better to have json and default output, but I've opened this so we can discuss either option.

Sure you should keep both format "TEXT" and "JSON" depending of who is dealing with logs (human or machine)

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.

can't collect KUB stats, plugin can't be used
4 participants