Skip to content

Commit 7d89a7d

Browse files
craig[bot]tbg
andcommitted
Merge #28692
28692: cli: include gossip_alerts in debug zip r=petermattis a=tschottdorf Release note: None Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
2 parents d556fa9 + aca14cd commit 7d89a7d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pkg/cli/cli_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,6 +2293,7 @@ writing ` + os.DevNull + `
22932293
debug/gossip/liveness
22942294
debug/gossip/nodes
22952295
debug/metrics
2296+
debug/alerts
22962297
debug/nodes/1/status
22972298
debug/nodes/1/gossip
22982299
debug/nodes/1/stacks

pkg/cli/zip.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"sort"
2626
"time"
2727

28+
"github.com/pkg/errors"
2829
"github.com/spf13/cobra"
2930

3031
"github.com/cockroachdb/cockroach/pkg/server/serverpb"
@@ -103,6 +104,7 @@ func runDebugZip(cmd *cobra.Command, args []string) error {
103104
eventsName = base + "/events"
104105
gossipLName = base + "/gossip/liveness"
105106
gossipNName = base + "/gossip/nodes"
107+
alertsName = base + "/alerts"
106108
livenessName = base + "/liveness"
107109
metricsName = base + "/metrics"
108110
nodesPrefix = base + "/nodes"
@@ -204,19 +206,16 @@ func runDebugZip(cmd *cobra.Command, args []string) error {
204206
}
205207
}
206208

207-
{
208-
queryLiveness := "SELECT * FROM crdb_internal.gossip_liveness;"
209-
queryNodes := "SELECT * FROM crdb_internal.gossip_nodes;"
210-
queryMetrics := "SELECT * FROM crdb_internal.node_metrics;"
211-
212-
if err := dumpTableDataForZip(z, sqlConn, queryLiveness, gossipLName); err != nil {
213-
return err
214-
}
215-
if err := dumpTableDataForZip(z, sqlConn, queryNodes, gossipNName); err != nil {
216-
return err
217-
}
218-
if err := dumpTableDataForZip(z, sqlConn, queryMetrics, metricsName); err != nil {
219-
return err
209+
for _, item := range []struct {
210+
query, name string
211+
}{
212+
{"SELECT * FROM crdb_internal.gossip_liveness;", gossipLName},
213+
{"SELECT * FROM crdb_internal.gossip_nodes;", gossipNName},
214+
{"SELECT * FROM crdb_internal.node_metrics;", metricsName},
215+
{"SELECT * FROM crdb_internal.gossip_alerts;", alertsName},
216+
} {
217+
if err := dumpTableDataForZip(z, sqlConn, item.query, item.name); err != nil {
218+
return errors.Wrap(err, item.name)
220219
}
221220
}
222221

0 commit comments

Comments
 (0)