-
Notifications
You must be signed in to change notification settings - Fork 47
[amazon-cloudwatch-observability] refactor: single-switch SM/PM scraping under otelContainerInsights.prometheusScrape #332
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: main
Are you sure you want to change the base?
Changes from 6 commits
3e61e2e
b721ec3
0222e9f
a51dc39
072635b
3e51214
48e8330
32b6ae5
ee2df6e
cd3fb5e
7911c6c
8bf3d4e
dee02ff
e753a60
7dd2d8d
1a46b3f
7bfede6
d57f318
d8a49d3
c626240
028a408
e61d4eb
530c019
6d95450
e032f1a
ef3715b
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 |
|---|---|---|
|
|
@@ -5,6 +5,25 @@ Expand the name of the chart. | |
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Whether to bundle the community ServiceMonitor/PodMonitor CRDs. Honours | ||
| .Values.otelContainerInsights.prometheusScrape.crds.install: | ||
| "always" => true; "never" => empty; | ||
| "auto" (default) => true only when otelContainerInsights.enabled AND | ||
| otelContainerInsights.prometheusScrape.enabled are both true. | ||
| Returns the string "true" when CRDs should be rendered, empty otherwise. | ||
| */}} | ||
| {{- define "amazon-cloudwatch-observability.prometheusCRDsEnabled" -}} | ||
|
Collaborator
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.
|
||
| {{- $install := (dig "prometheusScrape" "crds" "install" "auto" .Values.otelContainerInsights) -}} | ||
| {{- $scrapeEnabled := (dig "prometheusScrape" "enabled" true .Values.otelContainerInsights) -}} | ||
| {{- if eq $install "always" -}} | ||
| true | ||
| {{- else if eq $install "never" -}} | ||
| {{- else if and .Values.otelContainerInsights.enabled $scrapeEnabled -}} | ||
| true | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{- define "amazon-cloudwatch-observability.common.tolerations" -}} | ||
| {{- $tolerations := .context.Values.tolerations }} | ||
| {{- if .component }} | ||
|
|
@@ -191,6 +210,20 @@ Logic: | |
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Returns "true" when otelContainerInsights-driven ServiceMonitor/PodMonitor scraping | ||
| applies to the given agent. True when otelContainerInsights is enabled, the agent is | ||
| the configured targetAgent, and at least one of serviceMonitor/podMonitor is enabled. | ||
| Accepts a dict with "agentName" (string) and "context" (root context $). | ||
| */}} | ||
| {{- define "cloudwatch-agent.otelCIScrapeEnabled" -}} | ||
|
Collaborator
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.
|
||
| {{- $ctx := .context -}} | ||
| {{- $agentName := .agentName -}} | ||
| {{- if and $ctx.Values.otelContainerInsights.enabled (eq $agentName $ctx.Values.otelContainerInsights.targetAgent) (dig "prometheusScrape" "enabled" true $ctx.Values.otelContainerInsights) -}} | ||
| true | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Helper function to modify cloudwatch-agent config | ||
| */}} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,7 @@ spec: | |
| - "--auto-instrumentation-dotnet-image={{ template "auto-instrumentation-dotnet.image" . }}" | ||
| - "--auto-instrumentation-nodejs-image={{ template "auto-instrumentation-nodejs.image" . }}" | ||
| - "--target-allocator-image={{ template "target-allocator.image" (merge .Values.agent.prometheus.targetAllocator.image (dict "region" $.Values.region)) }}" | ||
| - "--feature-gates=operator.autoinstrumentation.multiinstrumentation,operator.autoinstrumentation.multiinstrumentation.skipcontainervalidation" | ||
| - "--feature-gates=operator.autoinstrumentation.multi-instrumentation,operator.autoinstrumentation.multi-instrumentation.skip-container-validation" | ||
|
Collaborator
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. |
||
| command: | ||
| - /manager | ||
| name: manager | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
allocationStrategygainsper-nodeonly in thecrds/copy, which Helm doesn't touch on upgrade, so upgrading a release whose CRD predates the enum makes the API server reject the renderedper-node. Could we move this CRD intotemplates/and gate it like the bundled monitor CRDs?