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 extraArgs to debug dumps; use them to specify number of lines from Loki and which profiles to grab. #9888

Merged
merged 4 commits into from Mar 28, 2024

Conversation

jrockway
Copy link
Member

@jrockway jrockway commented Mar 26, 2024

A template now looks like this:

$ pachctl debug template
defaults:
    clusterDefaults: true
inputRepos: true
starlarkScripts:
    - builtin: starlark/basic.star
      timeout: 60s
    - builtin: starlark/list_rcs.star
      timeout: 60s
system:
    database: true
    describes:
        - name: console                                                                                                                                                                                                                                                     - name: etcd
        - name: pachd
        - name: pachyderm-kube-event-tail
        - name: pachyderm-proxy
        - name: pg-bouncer
    helm: true
    logs:
        - name: console
        - name: etcd
        - name: pachd
        - name: pachyderm-kube-event-tail
        - name: pachyderm-proxy
        - name: pg-bouncer
    lokiLogs:
        - lokiArgs:
            maxLogs: "30000"
          name: console
        - lokiArgs:
            maxLogs: "30000"
          name: etcd
        - lokiArgs:
            maxLogs: "30000"
          name: pachd
        - lokiArgs:
            maxLogs: "30000"
          name: pachyderm-kube-event-tail
        - lokiArgs:
            maxLogs: "30000"
          name: pachyderm-proxy
        - lokiArgs:
            maxLogs: "30000"
          name: pg-bouncer
    profiles:
        - name: pachd
          profileArgs:
            profiles:
                - name: heap
                - name: goroutine
    version: true

This means you can now specify how many lines Loki should get you, and which profiles to run. You can do a CPU profile like:

system:
  profiles:
    - name: pachd
      profileArgs:
        profiles:
          - name: cpu
            duration: 30s

The n in name is low in alphabetical order so the generated template doesn't sort for optimal readability. This is unavoidable ;)

@jrockway jrockway requested review from a team as code owners March 26, 2024 04:10
@jrockway jrockway requested review from molinamelendezj, bbonenfant and acohen4 and removed request for molinamelendezj March 26, 2024 04:10
src/debug/debug.proto Outdated Show resolved Hide resolved
Copy link
Contributor

@acohen4 acohen4 left a comment

Choose a reason for hiding this comment

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

Looks good! My only comment is around making separate, typed args in the API

@jrockway jrockway merged commit 89ed648 into master Mar 28, 2024
20 checks passed
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 77.08333% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 58.07%. Comparing base (97cc201) to head (e0fb76c).
Report is 1 commits behind head on master.

Files Patch % Lines
src/server/debug/server/server.go 77.08% 9 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9888      +/-   ##
==========================================
- Coverage   58.07%   58.07%   -0.01%     
==========================================
  Files         606      606              
  Lines       73534    73572      +38     
==========================================
+ Hits        42708    42730      +22     
- Misses      30264    30280      +16     
  Partials      562      562              

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

jrockway added a commit that referenced this pull request Mar 29, 2024
…m Loki and which profiles to grab. (#9888)

A template now looks like this:

```yaml
$ pachctl debug template
defaults:
    clusterDefaults: true
inputRepos: true
starlarkScripts:
    - builtin: starlark/basic.star
      timeout: 60s
    - builtin: starlark/list_rcs.star
      timeout: 60s
system:
    database: true
    describes:
        - name: console                                                                                                                                                                                                                                                     - name: etcd
        - name: pachd
        - name: pachyderm-kube-event-tail
        - name: pachyderm-proxy
        - name: pg-bouncer
    helm: true
    logs:
        - name: console
        - name: etcd
        - name: pachd
        - name: pachyderm-kube-event-tail
        - name: pachyderm-proxy
        - name: pg-bouncer
    lokiLogs:
        - lokiArgs:
            maxLogs: "30000"
          name: console
        - lokiArgs:
            maxLogs: "30000"
          name: etcd
        - lokiArgs:
            maxLogs: "30000"
          name: pachd
        - lokiArgs:
            maxLogs: "30000"
          name: pachyderm-kube-event-tail
        - lokiArgs:
            maxLogs: "30000"
          name: pachyderm-proxy
        - lokiArgs:
            maxLogs: "30000"
          name: pg-bouncer
    profiles:
        - name: pachd
          profileArgs:
            profiles:
                - name: heap
                - name: goroutine
    version: true
```

This means you can now specify how many lines Loki should get you, and
which profiles to run. You can do a CPU profile like:

```yaml
system:
  profiles:
    - name: pachd
      profileArgs:
        profiles:
          - name: cpu
            duration: 30s
```

The `n` in `name` is low in alphabetical order so the generated template
doesn't sort for optimal readability. This is unavoidable ;)
jrockway added a commit that referenced this pull request Mar 29, 2024
Use them to specify number of lines from Loki and which profiles to
grab. (#9888)

A template now looks like this:

```yaml
$ pachctl debug template
defaults:
    clusterDefaults: true
inputRepos: true
starlarkScripts:
    - builtin: starlark/basic.star
      timeout: 60s
    - builtin: starlark/list_rcs.star
      timeout: 60s
system:
    database: true
    describes:
        - name: console                                                                                                                                                                                                                                                     - name: etcd
        - name: pachd
        - name: pachyderm-kube-event-tail
        - name: pachyderm-proxy
        - name: pg-bouncer
    helm: true
    logs:
        - name: console
        - name: etcd
        - name: pachd
        - name: pachyderm-kube-event-tail
        - name: pachyderm-proxy
        - name: pg-bouncer
    lokiLogs:
        - lokiArgs:
            maxLogs: "30000"
          name: console
        - lokiArgs:
            maxLogs: "30000"
          name: etcd
        - lokiArgs:
            maxLogs: "30000"
          name: pachd
        - lokiArgs:
            maxLogs: "30000"
          name: pachyderm-kube-event-tail
        - lokiArgs:
            maxLogs: "30000"
          name: pachyderm-proxy
        - lokiArgs:
            maxLogs: "30000"
          name: pg-bouncer
    profiles:
        - name: pachd
          profileArgs:
            profiles:
                - name: heap
                - name: goroutine
    version: true
```

This means you can now specify how many lines Loki should get you, and
which profiles to run. You can do a CPU profile like:

```yaml
system:
  profiles:
    - name: pachd
      profileArgs:
        profiles:
          - name: cpu
            duration: 30s
```

The `n` in `name` is low in alphabetical order so the generated template
doesn't sort for optimal readability. This is unavoidable ;)
zmajeed pushed a commit that referenced this pull request Apr 2, 2024
…m Loki and which profiles to grab. (#9888)

A template now looks like this:

```yaml
$ pachctl debug template
defaults:
    clusterDefaults: true
inputRepos: true
starlarkScripts:
    - builtin: starlark/basic.star
      timeout: 60s
    - builtin: starlark/list_rcs.star
      timeout: 60s
system:
    database: true
    describes:
        - name: console                                                                                                                                                                                                                                                     - name: etcd
        - name: pachd
        - name: pachyderm-kube-event-tail
        - name: pachyderm-proxy
        - name: pg-bouncer
    helm: true
    logs:
        - name: console
        - name: etcd
        - name: pachd
        - name: pachyderm-kube-event-tail
        - name: pachyderm-proxy
        - name: pg-bouncer
    lokiLogs:
        - lokiArgs:
            maxLogs: "30000"
          name: console
        - lokiArgs:
            maxLogs: "30000"
          name: etcd
        - lokiArgs:
            maxLogs: "30000"
          name: pachd
        - lokiArgs:
            maxLogs: "30000"
          name: pachyderm-kube-event-tail
        - lokiArgs:
            maxLogs: "30000"
          name: pachyderm-proxy
        - lokiArgs:
            maxLogs: "30000"
          name: pg-bouncer
    profiles:
        - name: pachd
          profileArgs:
            profiles:
                - name: heap
                - name: goroutine
    version: true
```

This means you can now specify how many lines Loki should get you, and
which profiles to run. You can do a CPU profile like:

```yaml
system:
  profiles:
    - name: pachd
      profileArgs:
        profiles:
          - name: cpu
            duration: 30s
```

The `n` in `name` is low in alphabetical order so the generated template
doesn't sort for optimal readability. This is unavoidable ;)
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.

None yet

3 participants