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

Pull support-bundle/queries into a standalone crate #7193

Conversation

papertigers
Copy link
Contributor

@papertigers papertigers commented Dec 2, 2024

This pulls out sled-agent/support-bundle/queries from Omicron into a standalone sled-diagnostics crate that can be reused outside of sled-agent.

Created using spr 1.3.6-beta.1
@papertigers papertigers marked this pull request as draft December 2, 2024 22:21
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@papertigers papertigers marked this pull request as ready for review December 5, 2024 15:43
@papertigers papertigers requested a review from smklein December 5, 2024 16:34
Comment on lines +19 to 22
pub trait SledDiagnosticsCommandHttpOutput {
fn get_output(self) -> String;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this isn't new in this PR, but since we're exposing it from a crate API, we may want to revisit this trait name.

  • The name is a little redundant with the crate
  • The HttpOutput bit is especially confusing now, since this trait also has nothing to do with HTTP

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left this as is because I knew it would be addressed in a PR on top of this PR.
The updated output type can be found in #7228

Created using spr 1.3.6-beta.1
@papertigers papertigers enabled auto-merge (squash) December 13, 2024 20:30
Created using spr 1.3.6-beta.1
@papertigers papertigers merged commit 5ef0b7d into main Dec 13, 2024
18 checks passed
@papertigers papertigers deleted the spr/papertigers/pull-support-bundlequeries-into-a-standalone-crate branch December 13, 2024 22:45
papertigers added a commit that referenced this pull request Jan 7, 2025
This PR adds support for finding all oxide processes via libcontract and
relying on the fact that we deploy oxide services with the fmri prefix
svc:/oxide/ or svc:/system/illumos. This allows us to find every pid started via smf even if
the smf script uses ctrun.

You can see this for yourself by running pfexec ctstat -av on a
helios/illumos based system:
```
205     1       process owned   2492    0       -       -       
        cookie:                0
        informative event set: core
        critical event set:    hwerr empty
        fatal event set:       hwerr
        parameter set:         noorphan regent
        member processes:      2497
        inherited contracts:   none
        service fmri:          svc:/oxide/wicketd:default
        service fmri ctid:     204
        creator:               ctrun
        aux:                   
249     1       process owned   1334    0       -       -       
        cookie:                0x20
        informative event set: none
        critical event set:    hwerr empty
        fatal event set:       none
        parameter set:         inherit regent
        member processes:      2794
        inherited contracts:   none
        service fmri:          svc:/oxide/dendrite:default
        service fmri ctid:     249
        creator:               svc.startd
        aux:                   start
254     1       process owned   1334    0       -       -       
        cookie:                0x20
        informative event set: none
        critical event set:    hwerr empty
        fatal event set:       none
        parameter set:         inherit regent
        member processes:      2802
        inherited contracts:   none
        service fmri:          svc:/oxide/lldpd:default
        service fmri ctid:     254
        creator:               svc.startd
        aux:                   start
```
This PR is on top of:
- #7193
papertigers added a commit that referenced this pull request Jan 8, 2025
This PR adds support for finding all oxide processes via libcontract and
relying on the fact that we deploy oxide services with the fmri prefix
svc:/oxide/ or svc:/system/illumos. This allows us to find every pid
started via smf even if the smf script uses ctrun.

You can see this for yourself by running pfexec ctstat -av on a
helios/illumos based system:
```
205     1       process owned   2492    0       -       -       
        cookie:                0
        informative event set: core
        critical event set:    hwerr empty
        fatal event set:       hwerr
        parameter set:         noorphan regent
        member processes:      2497
        inherited contracts:   none
        service fmri:          svc:/oxide/wicketd:default
        service fmri ctid:     204
        creator:               ctrun
        aux:                   
249     1       process owned   1334    0       -       -       
        cookie:                0x20
        informative event set: none
        critical event set:    hwerr empty
        fatal event set:       none
        parameter set:         inherit regent
        member processes:      2794
        inherited contracts:   none
        service fmri:          svc:/oxide/dendrite:default
        service fmri ctid:     249
        creator:               svc.startd
        aux:                   start
254     1       process owned   1334    0       -       -       
        cookie:                0x20
        informative event set: none
        critical event set:    hwerr empty
        fatal event set:       none
        parameter set:         inherit regent
        member processes:      2802
        inherited contracts:   none
        service fmri:          svc:/oxide/lldpd:default
        service fmri ctid:     254
        creator:               svc.startd
        aux:                   start
```
This PR is on top of:
- #7193
papertigers added a commit that referenced this pull request Jan 8, 2025
…7228)

This introduces the `SledDiagnosticsQueryOutput` type so support bundles
can now have structured output in collected files. This makes it
potentially easier for an operator to write scripts that search for
particular commands based on various fields.

This is on top of:
- #7194
- #7193
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.

2 participants