|
26 | 26 | opsPromEnabled bool |
27 | 27 | opsPromPort int |
28 | 28 | opsIgnoreAnonymousRequests bool |
| 29 | + opsPromIntervalSeconds int |
29 | 30 |
|
30 | 31 | // MetricsConfig-related flags |
31 | 32 | opsTrackRequestsByIP bool |
@@ -73,18 +74,19 @@ Then restart all RadosGW daemons: |
73 | 74 | Following this configuration change, the RadosGW will log operations to the file /var/log/ceph/ceph-rgw-ops.json.log.`, |
74 | 75 | Run: func(cmd *cobra.Command, args []string) { |
75 | 76 | config := opslog.OpsLogConfig{ |
76 | | - LogFilePath: opsLogFilePath, |
77 | | - TruncateLogOnStart: opsTruncateLogOnStart, |
78 | | - SocketPath: opsSocketPath, |
79 | | - NatsURL: opsNatsURL, |
80 | | - NatsSubject: opsNatsSubject, |
81 | | - NatsMetricsSubject: opsNatsMetricsSubject, |
82 | | - LogToStdout: opsLogToStdout, |
83 | | - LogRetentionDays: opsLogRetentionDays, |
84 | | - MaxLogFileSize: opsMaxLogFileSize, |
85 | | - Prometheus: opsPromEnabled, |
86 | | - PrometheusPort: opsPromPort, |
87 | | - IgnoreAnonymousRequests: opsIgnoreAnonymousRequests, |
| 77 | + LogFilePath: opsLogFilePath, |
| 78 | + TruncateLogOnStart: opsTruncateLogOnStart, |
| 79 | + SocketPath: opsSocketPath, |
| 80 | + NatsURL: opsNatsURL, |
| 81 | + NatsSubject: opsNatsSubject, |
| 82 | + NatsMetricsSubject: opsNatsMetricsSubject, |
| 83 | + LogToStdout: opsLogToStdout, |
| 84 | + LogRetentionDays: opsLogRetentionDays, |
| 85 | + MaxLogFileSize: opsMaxLogFileSize, |
| 86 | + Prometheus: opsPromEnabled, |
| 87 | + PrometheusPort: opsPromPort, |
| 88 | + IgnoreAnonymousRequests: opsIgnoreAnonymousRequests, |
| 89 | + PrometheusIntervalSeconds: opsPromIntervalSeconds, |
88 | 90 | MetricsConfig: opslog.MetricsConfig{ |
89 | 91 | TrackRequestsByIP: opsTrackRequestsByIP, |
90 | 92 | TrackBytesSentByIP: opsTrackBytesSentByIP, |
@@ -192,6 +194,7 @@ func mergeOpsLogConfigWithEnv(cfg opslog.OpsLogConfig) opslog.OpsLogConfig { |
192 | 194 | cfg.PrometheusPort = getEnvInt("PROMETHEUS_PORT", cfg.PrometheusPort) |
193 | 195 | cfg.PodName = getEnv("POD_NAME", cfg.PodName) |
194 | 196 | cfg.IgnoreAnonymousRequests = getEnvBool("IGNORE_ANONYMOUS_REQUESTS", cfg.IgnoreAnonymousRequests) |
| 197 | + cfg.PrometheusIntervalSeconds = getEnvInt("PROMETHEUS_INTERVAL", cfg.PrometheusIntervalSeconds) |
195 | 198 |
|
196 | 199 | // MetricsConfig environment variables |
197 | 200 | cfg.MetricsConfig.TrackRequestsByIP = getEnvBool("TRACK_REQUESTS_BY_IP", cfg.MetricsConfig.TrackRequestsByIP) |
@@ -233,6 +236,7 @@ func init() { |
233 | 236 | opsLogCmd.Flags().BoolVar(&opsPromEnabled, "prometheus", false, "Enable Prometheus metrics") |
234 | 237 | opsLogCmd.Flags().IntVar(&opsPromPort, "prometheus-port", 8080, "Prometheus metrics port") |
235 | 238 | opsLogCmd.Flags().BoolVar(&opsIgnoreAnonymousRequests, "ignore-anonymous-requests", true, "Ignore anonymous requests") |
| 239 | + opsLogCmd.Flags().IntVar(&opsPromIntervalSeconds, "prometheus-interval", 60, "Prometheus metrics update interval in seconds") |
236 | 240 |
|
237 | 241 | // Metrics Tracking Flags (All Disabled by Default) |
238 | 242 | opsLogCmd.Flags().BoolVar(&opsTrackRequestsByIP, "track-requests-by-ip", false, "Track requests by IP") |
|
0 commit comments