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
fix: prevent potential misconfiguration of metricsInterval (#284) (#638)
# Description
I have added a new field `metricsIntervalDuration` of type
`time.Duration`. It will super cede the `metricsInterval` configuration
of the same type. The older key is not removed to keep backward
compatibility. The change is done to prevent potential misconfiguration
that can happen by assigning a duration to `metricsInterval` when it is
converted to seconds.
## Related Issue
Issue #284
## Checklist
- [X] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [X] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [X] I have correctly attributed the author(s) of the code.
- [X] I have tested the changes locally.
- [X] I have followed the project's style guidelines.
- [X] I have updated the documentation, if necessary.
- [X] I have added tests, if applicable.
## Screenshots (if applicable) or Testing Completed
The logs showing that retina agent runs successffully after making the
changes.

This shows the log line that `metricsInterval` should not be used.

## Additional Notes
I was not able to us the `zap` logger as it is probably not initialized
when the `GetConfig` is called or I might be missing how to use it so i
used the go `log` library. Do let me know if we need to change that.
---
Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
Signed-off-by: Ritwik Ranjan <[email protected]>
Copy file name to clipboardexpand all lines: docs/02-Installation/03-Config.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,8 @@ Defaults are specified for each component in *deploy/legacy/manifests/controller
12
12
*`enableAnnotations`: When this toggle is set to true, retina will gather metrics for the annotated resources. Namespaces or Pods can be annotated with `retina.sh/v1alpha=observe`. The operator and enableRetinaEndpoint for the operator should be enabled.
13
13
*`enabledPlugin_linux`: Array of enabled plugins for linux.
14
14
*`enabledPlugin_win`: Array of enabled plugins for windows.
15
-
*`metricsInterval`: the interval for which metrics will be gathered.
15
+
*`metricsInterval`: the interval for which metrics will be gathered (in seconds). (@deprecated, use metricsIntervalDuration instead)
16
+
*`metricsIntervalDuration`: the interval for which metrics will be gathered (in duration)
16
17
*`dataAggregationLevel`: This config defines the level of data aggregation for Retina. See [Data Aggregation](../05-Concepts/data-aggregation.md) for more details.
0 commit comments