Skip to content

Commit

Permalink
charts/aws-otel-collector add cluster label to scrape config (closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ianarsenault committed Aug 29, 2024
1 parent 5bae8f9 commit 89b7581
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/aws-otel-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: aws-otel-collector
description: A Helm chart to deploy aws-otel-collector project
version: 0.3.0
version: 0.4.0
appVersion: "v0.33.1"
icon: https://raw.githubusercontent.com/snowplow-devops/helm-charts/master/docs/logo/snowplow.png
home: https://github.com/snowplow-devops/helm-charts
Expand Down
1 change: 1 addition & 0 deletions charts/aws-otel-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ helm delete aws-otel-collector --namespace kube-system

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| clusterName | string | `""` | Sets cluster name for log groups and kube label for prometheus metric dimensions |
| nameOverride | string | `""` | Overrides the name given to the deployment (default: .Release.Name) |
| fullnameOverride | string | `""` | Overrides the full-name given to the deployment resources (default: .Release.Name) |
| image.repository | string | `"public.ecr.aws/aws-observability/aws-otel-collector"` | Image to use for deploying |
Expand Down
14 changes: 8 additions & 6 deletions charts/aws-otel-collector/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data:
exporters:
awsemf:
namespace: ContainerInsights
log_group_name: '/aws/containerinsights/{ClusterName}/performance'
log_group_name: '/aws/containerinsights/{{ .Values.clusterName }}/performance'
log_stream_name: '{NodeName}'
log_retention: {{ .Values.performance_log_retention_in_days }}
resource_to_telemetry_conversion:
Expand Down Expand Up @@ -77,8 +77,10 @@ data:
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- prometheus-kube-state-metrics.monitoring.svc.cluster.local:8080
- targets:
- prometheus-kube-state-metrics.monitoring.svc.cluster.local:8080
labels:
cluster_name: {{ .Values.clusterName }}

processors:
batch/metrics:
Expand All @@ -99,7 +101,7 @@ data:
exporters:
awsemf:
namespace: ContainerInsights
log_group_name: '/aws/containerinsights/{ClusterName}/performance'
log_group_name: '/aws/containerinsights/{{ .Values.clusterName }}/performance'
log_stream_name: '{NodeName}'
log_retention: {{ .Values.performance_log_retention_in_days }}
resource_to_telemetry_conversion:
Expand All @@ -124,7 +126,7 @@ data:

awsemf/prometheus:
namespace: ContainerInsights/Prometheus
log_group_name: "/aws/containerinsights/{TaskId}/prometheus"
log_group_name: '/aws/containerinsights/{{ .Values.clusterName }}/{TaskId}/prometheus'
log_stream_name: "{TaskId}"
log_retention: {{ .Values.prometheus_log_retention_in_days }}
resource_to_telemetry_conversion:
Expand All @@ -135,7 +137,7 @@ data:
{{- toYaml . | nindent 10 }}
{{- end }}
metric_declarations:
- dimensions: [[ namespace, deployment ]]
- dimensions: [[ namespace, deployment, cluster_name ]]
metric_name_selectors:
- "^kube_deployment_status_replicas_ready$"
label_matchers:
Expand Down
2 changes: 2 additions & 0 deletions charts/aws-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
nameOverride: ""
# -- Overrides the full-name given to the deployment resources (default: .Release.Name)
fullnameOverride: ""
# -- Sets cluster name for scraping metric and log groups
clusterName: ""

image:
# -- Image to use for deploying
Expand Down

0 comments on commit 89b7581

Please sign in to comment.