You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flagset.StringVar(&flagNamespaces, "namespaces", "", "Namespaces to scope the interaction of the Grafana operator. Mutually exclusive with --scan-all")
61
62
flagset.StringVar(&flagJsonnetLocation, "jsonnet-location", "", "Overrides the base path of the jsonnet libraries")
62
63
flagset.BoolVar(&scanAll, "scan-all", false, "Scans all namespaces for dashboards")
64
+
flagset.AddFlagSet(zap.FlagSet())
63
65
flagset.Parse(os.Args[1:])
64
66
}
65
67
@@ -113,7 +115,8 @@ func main() {
113
115
// implementing the logr.Logger interface. This logger will
114
116
// be propagated through the whole operator, generating
115
117
// uniform and structured logs.
116
-
logf.SetLogger(logf.ZapLogger(false))
118
+
119
+
logf.SetLogger(zap.Logger())
117
120
118
121
printVersion()
119
122
@@ -144,7 +147,7 @@ func main() {
144
147
vardashboardNamespaces= []string{namespace}
145
148
ifscanAll {
146
149
dashboardNamespaces= []string{""}
147
-
log.Info("Scanning for dashboards in all namespaces")
150
+
log.V(1).Info("Scanning for dashboards in all namespaces")
148
151
}
149
152
150
153
ifflagNamespaces!="" {
@@ -153,7 +156,7 @@ func main() {
153
156
fmt.Fprint(os.Stderr, "--namespaces provided but no valid namespaces in list")
154
157
os.Exit(1)
155
158
}
156
-
log.Info(fmt.Sprintf("Scanning for dashboards in the following namespaces: [%s]", strings.Join(dashboardNamespaces, ",")))
159
+
log.V(1).Info(fmt.Sprintf("Scanning for dashboards in the following namespaces: [%s]", strings.Join(dashboardNamespaces, ",")))
157
160
}
158
161
159
162
// Get a config to talk to the apiserver
@@ -176,7 +179,7 @@ func main() {
176
179
os.Exit(1)
177
180
}
178
181
179
-
log.Info("Registering Components.")
182
+
log.V(1).Info("Registering Components.")
180
183
181
184
// Starting the resource auto-detection for the grafana controller
Copy file name to clipboardexpand all lines: documentation/deploy_grafana.md
+5-2
Original file line number
Diff line number
Diff line change
@@ -115,13 +115,16 @@ The operator accepts a number of flags that can be passed in the `args` section
115
115
116
116
*`--grafonnet-location`: overrides the location of the grafonnet library. Defaults to `/opt/grafonnet-lib`. Only useful when running the operator locally.
117
117
118
-
*`--scan-all`: watch for dashboards in all namespaces. This requires the the operator service account to have cluster wide permissions to `get`, `list`, `update` and `watch` dashboards. See `deploy/cluster_roles`.
118
+
*`--scan-all`: watch for dashboards in all namespaces. This requires the operator service account to have cluster wide permissions to `get`, `list`, `update` and `watch` dashboards. See `deploy/cluster_roles`.
119
119
120
120
*`--namespaces`: watch for dashboards in a list of namespaces. Mutually exclusive with `--scan-all`.
121
121
122
+
*`--zap-level=n`: set the logging level for the operator, leaving out this flag will only log Errors and error related info, current options are:
123
+
-`--zap-level=1`: show all Info level logs
124
+
122
125
See `deploy/operator.yaml` for an example.
123
126
124
-
If using the automated Ansible installer see the [grafana-operator-namespace-resources.yaml - Parameters](../deploy/ansible/README.md#parameters-1) for the equivlant parameters.
127
+
If using the automated Ansible installer see the [grafana-operator-namespace-resources.yaml - Parameters](../deploy/ansible/README.md#parameters-1) for the equivalent parameters.
0 commit comments