-
Notifications
You must be signed in to change notification settings - Fork 2
Cmk 36785 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Cmk 36785 #29
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,6 +178,20 @@ pull: | |
| # certificate, in days. It is ignored when existingSecret is set. | ||
| longevity: 3650 | ||
|
|
||
| # otel allows you to enable, disable, and configure the OpenTelemetry export. | ||
| # Unlike push mode, this does not send Checkmk sections: it exports pod- and | ||
| # container-level metrics derived from the kubelet data, using OTLP over HTTP. | ||
| otel: | ||
| # enabled controls whether the OpenTelemetry export is activated or not. | ||
| enabled: false | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure |
||
| # endpoint is the base URL of an OpenTelemetry collector's OTLP/HTTP receiver. | ||
| # Do *not* include the signal path: "/v1/metrics" is appended for you. | ||
| # Required when otel.enabled is true. | ||
| endpoint: "" | ||
| # interval is how often, in seconds, metrics are collected and exported to | ||
| # the collector. Must be greater than zero. | ||
| interval: 60 | ||
|
|
||
| # hostLabels defines how annotations get imported as labels in Checkmk. By | ||
| # default annotations do not become host labels. | ||
| hostLabels: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,6 +224,14 @@ pub struct CliArgs { | |
| #[arg(long = "otel-endpoint")] | ||
| pub otel_endpoint: Option<String>, | ||
|
|
||
| /// Push interval in seconds for sending otel metrics. | ||
| #[arg( | ||
| long = "otel-push-interval", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I recently discovered, you don't need to specify the value to |
||
| value_parser = parse_push_interval, | ||
| default_value = "60" | ||
| )] | ||
| pub otel_push_interval: Duration, | ||
|
|
||
| /// Emit all Pod resources rather than only annotated ones | ||
| #[arg(long = "all-pods")] | ||
| pub all_pods: bool, | ||
|
|
@@ -406,12 +414,19 @@ mod tests { | |
| } | ||
|
|
||
| #[test] | ||
| fn push_interval_cannot_be_zero() { | ||
| fn otel_push_interval_cannot_be_less_than_one() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this isn't testing --otel-push-interval so I don't think the rename is right |
||
| assert_eq!( | ||
| parse(&["--push-interval", "0"]) | ||
| .expect_err("push interval of zero should fail") | ||
| .kind(), | ||
| ErrorKind::ValueValidation | ||
| ); | ||
|
|
||
| assert_eq!( | ||
| parse(&["--push-interval=-1"]) | ||
| .expect_err("push interval of -1 should fail") | ||
| .kind(), | ||
| ErrorKind::ValueValidation | ||
| ); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressing your comment from the last PR
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd do that in a separate patch |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the logic from push mode