mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Support bundles: fix user collector permissions and format collector output (#64531)
* fix user collector permissions and format collector output * lint
This commit is contained in:
parent
3336327306
commit
ed11c32c1d
@ -137,7 +137,7 @@ func (uss *UsageStats) supportBundleCollector() supportbundles.Collector {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
data, err := json.Marshal(report)
|
||||
data, err := json.MarshalIndent(report, "", " ")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ func (s *Service) bundle(ctx context.Context, collectors []string, uid string) (
|
||||
}
|
||||
item, err := collector.Fn(ctx)
|
||||
if err != nil {
|
||||
s.log.Warn("Failed to collect support bundle item", "error", err)
|
||||
s.log.Warn("Failed to collect support bundle item", "error", err, "collector", collector.UID)
|
||||
}
|
||||
|
||||
// write item to file
|
||||
|
@ -419,7 +419,9 @@ func (s *Service) supportBundleCollector() supportbundles.Collector {
|
||||
Login: "sa-supportbundle",
|
||||
OrgRole: "Admin",
|
||||
IsGrafanaAdmin: true,
|
||||
IsServiceAccount: true},
|
||||
IsServiceAccount: true,
|
||||
Permissions: map[int64]map[string][]string{ac.GlobalOrgID: {ac.ActionUsersRead: {ac.ScopeGlobalUsersAll}}},
|
||||
},
|
||||
OrgID: 0,
|
||||
Query: "",
|
||||
Page: 0,
|
||||
@ -433,7 +435,7 @@ func (s *Service) supportBundleCollector() supportbundles.Collector {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
userBytes, err := json.Marshal(res.Users)
|
||||
userBytes, err := json.MarshalIndent(res.Users, "", " ")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user