Skip to content

Commit 73a520c

Browse files
authored
Merge branch 'main' into patch-1
2 parents a6d2962 + ea680ad commit 73a520c

File tree

61 files changed

+959
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+959
-97
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
/charts/enterprise-logs/ @grafana/loki-squad
1818
/charts/tempo-vulture/ @grafana/tempo @Whyeasy @dgzlopes
1919
/charts/synthetic-monitoring-agent/ @torstenwalter @zanhsieh
20+
/charts/agent-operator/ @grafana/grafana-agent-maintainers

.github/workflows/release.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@ jobs:
4747
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
4848
CR_SKIP_EXISTING: "true"
4949

50+
- name: Login to GHCR
51+
uses: docker/login-action@v3.0.0
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
5057
- name: Push charts to GHCR
5158
run: |
5259
shopt -s nullglob
53-
for pkg in .cr-release-packages/*; do
60+
for pkg in .cr-release-packages/*.tgz; do
5461
if [ -z "${pkg:-}" ]; then
5562
break
5663
fi
57-
if ! helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"; then
58-
echo '::warning:: helm push failed!'
59-
fi
64+
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts"
6065
done

.github/workflows/update-helm-repo.yaml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ jobs:
7979
8080
if [ $(git tag -l "${name}-${version}") ]; then
8181
echo "Tag ${tagname} already exists, skipping release"
82-
echo "::set-output name=changed::false"
82+
echo "changed=false" >> $GITHUB_OUTPUT
8383
else
8484
echo "Releasing ${changed}"
85-
echo "::set-output name=changed::true"
86-
echo "::set-output name=chartpath::${changed}"
85+
echo "changed=true" >> $GITHUB_OUTPUT
86+
echo "chartpath=${changed}" >> $GITHUB_OUTPUT
8787
fi
8888
else
8989
echo "No charts have changed, skipping release"
90-
echo "::set-output name=changed::false"
90+
echo "changed=false" >> $GITHUB_OUTPUT
9191
fi
9292
9393
release:
@@ -145,19 +145,6 @@ jobs:
145145
with:
146146
version: v3.5.2
147147

148-
- name: Add dependency chart repos
149-
# Todo replace this by https://github.com/grafana/helm-charts/issues/1534
150-
run: |
151-
helm repo add elastic https://helm.elastic.co
152-
helm repo add grafana https://grafana.github.io/helm-charts
153-
helm repo add prometheus https://prometheus-community.github.io/helm-charts
154-
helm repo add bitnami https://charts.bitnami.com/bitnami
155-
helm repo add bitnami-pre-2022 https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
156-
helm repo add hashicorp https://helm.releases.hashicorp.com
157-
helm repo add minio-new https://charts.min.io
158-
helm repo add jetstack https://charts.jetstack.io
159-
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
160-
161148
- name: Parse Chart.yaml
162149
id: parse-chart
163150
run: |
@@ -166,14 +153,29 @@ jobs:
166153
description=$(yq ".description" < ${changed}/Chart.yaml)
167154
name=$(yq ".name" < ${changed}/Chart.yaml)
168155
version=$(yq ".version" < ${changed}/Chart.yaml)
169-
echo "::set-output name=chartpath::${changed}"
170-
echo "::set-output name=desc::${description}"
156+
echo "chartpath=${changed}" >> $GITHUB_OUTPUT
157+
echo "desc=${description}" >> $GITHUB_OUTPUT
171158
if [[ -n "${HELM_TAG_PREFIX}" ]]; then
172-
echo "::set-output name=tagname::${HELM_TAG_PREFIX}-${name}-${version}"
159+
echo "tagname=${HELM_TAG_PREFIX}-${name}-${version}" >> $GITHUB_OUTPUT
173160
else
174-
echo "::set-output name=tagname::${name}-${version}"
161+
echo "tagname=${name}-${version}" >> $GITHUB_OUTPUT
175162
fi
176-
echo "::set-output name=packagename::${name}-${version}"
163+
echo "packagename=${name}-${version}" >> $GITHUB_OUTPUT
164+
165+
- name: Add dependency chart repos
166+
run: |
167+
cd source
168+
# Skip the header line and make sure that tabs are expanded into spaces
169+
deps=$(helm dependency list "${{ steps.parse-chart.outputs.chartpath }}" | tail +2 | expand)
170+
while read -r row; do
171+
IFS=' ' read -ra parts <<< "$row"
172+
name="${parts[0]}"
173+
repo="${parts[2]}"
174+
case "$repo" in
175+
"https://"*) helm repo add "$name" "$repo" ;;
176+
*) echo >&2 "Skipping dependency $name: unsupported schema for \"$repo\"" ;;
177+
esac
178+
done <<< "$deps"
177179
178180
- name: Install CR tool
179181
run: |

charts/agent-operator/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ apiVersion: v2
22
name: grafana-agent-operator
33
description: A Helm chart for Grafana Agent Operator
44
type: application
5-
version: 0.3.18
6-
appVersion: "0.40.2"
5+
version: 0.3.22
6+
appVersion: "0.40.5"
77
home: https://grafana.com/docs/agent/v0.40/
8-
icon: https://raw.githubusercontent.com/grafana/agent/v0.40.0/docs/sources/assets/logo_and_name.png
8+
icon: https://raw.githubusercontent.com/grafana/agent/v0.40.5/docs/sources/assets/logo_and_name.png
99
sources:
10-
- https://github.com/grafana/agent/tree/v0.40.0/pkg/operator
10+
- https://github.com/grafana/agent/tree/v0.40.5/pkg/operator
1111
maintainers:
1212
- name: Grafana Agent Team
1313
email: grafana-agent-team@googlegroups.com

charts/agent-operator/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# grafana-agent-operator
22

3-
![Version: 0.3.18](https://img.shields.io/badge/Version-0.3.18-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.40.2](https://img.shields.io/badge/AppVersion-0.40.2-informational?style=flat-square)
3+
![Version: 0.3.22](https://img.shields.io/badge/Version-0.3.22-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.40.5](https://img.shields.io/badge/AppVersion-0.40.5-informational?style=flat-square)
44

55
A Helm chart for Grafana Agent Operator
66

77
⚠️ **Please create issues relating to this Helm chart in the [Agent](https://github.com/grafana/agent/issues) repo.**
88

99
## Source Code
1010

11-
* <https://github.com/grafana/agent/tree/v0.40.0/pkg/operator>
11+
* <https://github.com/grafana/agent/tree/v0.40.5/pkg/operator>
1212

1313
Note that this chart does not provision custom resources like `GrafanaAgent` and `MetricsInstance` (formerly `PrometheusInstance`) or any `*Monitor` resources.
1414

@@ -63,7 +63,7 @@ A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an
6363
| image.pullSecrets | list | `[]` | Image pull secrets |
6464
| image.registry | string | `"docker.io"` | Image registry |
6565
| image.repository | string | `"grafana/agent-operator"` | Image repo |
66-
| image.tag | string | `"v0.40.2"` | Image tag |
66+
| image.tag | string | `"v0.40.5"` | Image tag |
6767
| kubeletService | object | `{"namespace":"default","serviceName":"kubelet"}` | If both are set, Agent Operator will create and maintain a service for scraping kubelets https://grafana.com/docs/agent/latest/operator/getting-started/#monitor-kubelets |
6868
| nameOverride | string | `""` | Overrides the chart's name |
6969
| nodeSelector | object | `{}` | nodeSelector configuration |
@@ -75,4 +75,7 @@ A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an
7575
| resources | object | `{}` | Resource limits and requests config |
7676
| serviceAccount.create | bool | `true` | Toggle to create ServiceAccount |
7777
| serviceAccount.name | string | `nil` | Service account name |
78+
| test.image.registry | string | `"docker.io"` | Test image registry |
79+
| test.image.repository | string | `"library/busybox"` | Test image repo |
80+
| test.image.tag | string | `"latest"` | Test image tag |
7881
| tolerations | list | `[]` | Tolerations applied to Pods |

charts/agent-operator/templates/tests/test-grafanaagent.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ metadata:
107107
spec:
108108
containers:
109109
- name: busybox
110-
image: busybox
110+
image: "{{ .Values.test.image.registry }}/{{ .Values.test.image.repository }}:{{ .Values.test.image.tag }}"
111111
command: ['wget']
112112
args: ['grafana-agent-test-operated:8080/-/healthy']
113113
# Wait for GrafanaAgent CR
114114
initContainers:
115115
- name: sleep
116-
image: busybox
116+
image: "{{ .Values.test.image.registry }}/{{ .Values.test.image.repository }}:{{ .Values.test.image.tag }}"
117117
command: ['sleep', '60']
118118
restartPolicy: Never

charts/agent-operator/values.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,21 @@ image:
3737
# -- Image repo
3838
repository: grafana/agent-operator
3939
# -- Image tag
40-
tag: v0.40.2
40+
tag: v0.40.5
4141
# -- Image pull policy
4242
pullPolicy: IfNotPresent
4343
# -- Image pull secrets
4444
pullSecrets: []
4545

46+
test:
47+
image:
48+
# -- Test image registry
49+
registry: docker.io
50+
# -- Test image repo
51+
repository: library/busybox
52+
# -- Test image tag
53+
tag: latest
54+
4655
# -- hostAliases to add
4756
hostAliases: []
4857
# - ip: 1.2.3.4

charts/grafana-sampling/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/grafana-sampling/Chart.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dependencies:
2+
- name: grafana-agent
3+
repository: https://grafana.github.io/helm-charts
4+
version: 0.36.0
5+
- name: grafana-agent
6+
repository: https://grafana.github.io/helm-charts
7+
version: 0.36.0
8+
digest: sha256:6d04a55dce2c09c4c250c6453e0d58f7280750bf04fce51027b4e235062413e5
9+
generated: "2024-03-11T15:41:30.921516-07:00"

charts/grafana-sampling/Chart.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v2
2+
name: grafana-sampling
3+
description: A Helm chart for a layered OTLP tail sampling and metrics generation pipeline.
4+
type: application
5+
version: 0.1.1
6+
appVersion: "v0.40.2"
7+
sources:
8+
- https://github.com/grafana/agent
9+
- https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/setup/sampling/tail/
10+
dependencies:
11+
- name: grafana-agent
12+
version: 0.36.0
13+
repository: https://grafana.github.io/helm-charts
14+
alias: grafana-agent-deployment
15+
- name: grafana-agent
16+
version: 0.36.0
17+
repository: https://grafana.github.io/helm-charts
18+
alias: grafana-agent-statefulset

charts/grafana-sampling/README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# grafana-sampling
2+
3+
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.40.2](https://img.shields.io/badge/AppVersion-v0.40.2-informational?style=flat-square)
4+
5+
A Helm chart for a layered OTLP tail sampling and metrics generation pipeline.
6+
7+
This chart deploys the following architecture to your environment:
8+
![Photo of sampling architecture](./sampling-architecture.png)
9+
10+
Note: by default, only OTLP traces are accepted at the load balancing layer.
11+
12+
## Chart Repo
13+
14+
Add the following repo to use the chart:
15+
16+
```console
17+
helm repo add grafana https://grafana.github.io/helm-charts
18+
```
19+
## Installing the Chart
20+
21+
Use the following command to install the chart with the release name `my-release`. Make sure to populate the required values.
22+
23+
```console
24+
helm install my-release grafana/grafana-sampling --values - <<EOF | less
25+
grafana-agent-statefulset:
26+
agent:
27+
extraEnv:
28+
- name: GRAFANA_CLOUD_API_KEY
29+
value: <REQUIRED>
30+
- name: GRAFANA_CLOUD_PROMETHEUS_URL
31+
value: <REQUIRED>
32+
- name: GRAFANA_CLOUD_PROMETHEUS_USERNAME
33+
value: <REQUIRED>
34+
- name: GRAFANA_CLOUD_TEMPO_ENDPOINT
35+
value: <REQUIRED>
36+
- name: GRAFANA_CLOUD_TEMPO_USERNAME
37+
value: <REQUIRED>
38+
# This is required for adaptive metric deduplication in Grafana Cloud
39+
- name: POD_UID
40+
valueFrom:
41+
fieldRef:
42+
apiVersion: v1
43+
fieldPath: metadata.uid
44+
EOF
45+
```
46+
47+
## Uninstalling the Chart
48+
49+
To uninstall/delete the my-release deployment:
50+
51+
```console
52+
helm delete my-release
53+
```
54+
55+
The command removes all the Kubernetes components associated with the chart and deletes the release.
56+
57+
## Upgrading
58+
59+
A major chart version change indicates that there is an incompatible breaking change needing manual actions.
60+
61+
## Values
62+
63+
| Key | Type | Default | Description |
64+
|-----|------|---------|-------------|
65+
| grafana-agent-deployment.agent.configMap.create | bool | `false` | |
66+
| grafana-agent-deployment.agent.extraPorts[0].name | string | `"otlp-grpc"` | |
67+
| grafana-agent-deployment.agent.extraPorts[0].port | int | `4317` | |
68+
| grafana-agent-deployment.agent.extraPorts[0].protocol | string | `"TCP"` | |
69+
| grafana-agent-deployment.agent.extraPorts[0].targetPort | int | `4317` | |
70+
| grafana-agent-deployment.agent.extraPorts[1].name | string | `"otlp-http"` | |
71+
| grafana-agent-deployment.agent.extraPorts[1].port | int | `4318` | |
72+
| grafana-agent-deployment.agent.extraPorts[1].protocol | string | `"TCP"` | |
73+
| grafana-agent-deployment.agent.extraPorts[1].targetPort | int | `4318` | |
74+
| grafana-agent-deployment.agent.resources.requests.cpu | string | `"1"` | |
75+
| grafana-agent-deployment.agent.resources.requests.memory | string | `"2G"` | |
76+
| grafana-agent-deployment.controller.autoscaling.enabled | bool | `false` | Creates a HorizontalPodAutoscaler for controller type deployment. |
77+
| grafana-agent-deployment.controller.autoscaling.maxReplicas | int | `5` | The upper limit for the number of replicas to which the autoscaler can scale up. |
78+
| grafana-agent-deployment.controller.autoscaling.minReplicas | int | `2` | The lower limit for the number of replicas to which the autoscaler can scale down. |
79+
| grafana-agent-deployment.controller.autoscaling.targetCPUUtilizationPercentage | int | `0` | Average CPU utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetCPUUtilizationPercentage` to 0 will disable CPU scaling. |
80+
| grafana-agent-deployment.controller.autoscaling.targetMemoryUtilizationPercentage | int | `80` | Average Memory utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetMemoryUtilizationPercentage` to 0 will disable Memory scaling. |
81+
| grafana-agent-deployment.controller.replicas | int | `1` | |
82+
| grafana-agent-deployment.controller.type | string | `"deployment"` | |
83+
| grafana-agent-deployment.nameOverride | string | `"deployment"` | Do not change this. |
84+
| grafana-agent-statefulset.agent.configMap.create | bool | `false` | |
85+
| grafana-agent-statefulset.agent.extraEnv[0].name | string | `"GRAFANA_CLOUD_API_KEY"` | |
86+
| grafana-agent-statefulset.agent.extraEnv[0].value | string | `"<REQUIRED>"` | |
87+
| grafana-agent-statefulset.agent.extraEnv[1].name | string | `"GRAFANA_CLOUD_PROMETHEUS_URL"` | |
88+
| grafana-agent-statefulset.agent.extraEnv[1].value | string | `"<REQUIRED>"` | |
89+
| grafana-agent-statefulset.agent.extraEnv[2].name | string | `"GRAFANA_CLOUD_PROMETHEUS_USERNAME"` | |
90+
| grafana-agent-statefulset.agent.extraEnv[2].value | string | `"<REQUIRED>"` | |
91+
| grafana-agent-statefulset.agent.extraEnv[3].name | string | `"GRAFANA_CLOUD_TEMPO_ENDPOINT"` | |
92+
| grafana-agent-statefulset.agent.extraEnv[3].value | string | `"<REQUIRED>"` | |
93+
| grafana-agent-statefulset.agent.extraEnv[4].name | string | `"GRAFANA_CLOUD_TEMPO_USERNAME"` | |
94+
| grafana-agent-statefulset.agent.extraEnv[4].value | string | `"<REQUIRED>"` | |
95+
| grafana-agent-statefulset.agent.extraEnv[5].name | string | `"POD_UID"` | |
96+
| grafana-agent-statefulset.agent.extraEnv[5].valueFrom.fieldRef.apiVersion | string | `"v1"` | |
97+
| grafana-agent-statefulset.agent.extraEnv[5].valueFrom.fieldRef.fieldPath | string | `"metadata.uid"` | |
98+
| grafana-agent-statefulset.agent.extraPorts[0].name | string | `"otlp-grpc"` | |
99+
| grafana-agent-statefulset.agent.extraPorts[0].port | int | `4317` | |
100+
| grafana-agent-statefulset.agent.extraPorts[0].protocol | string | `"TCP"` | |
101+
| grafana-agent-statefulset.agent.extraPorts[0].targetPort | int | `4317` | |
102+
| grafana-agent-statefulset.agent.resources.requests.cpu | string | `"1"` | |
103+
| grafana-agent-statefulset.agent.resources.requests.memory | string | `"2G"` | |
104+
| grafana-agent-statefulset.controller.autoscaling.enabled | bool | `false` | Creates a HorizontalPodAutoscaler for controller type deployment. |
105+
| grafana-agent-statefulset.controller.autoscaling.maxReplicas | int | `5` | The upper limit for the number of replicas to which the autoscaler can scale up. |
106+
| grafana-agent-statefulset.controller.autoscaling.minReplicas | int | `2` | The lower limit for the number of replicas to which the autoscaler can scale down. |
107+
| grafana-agent-statefulset.controller.autoscaling.targetCPUUtilizationPercentage | int | `0` | Average CPU utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetCPUUtilizationPercentage` to 0 will disable CPU scaling. |
108+
| grafana-agent-statefulset.controller.autoscaling.targetMemoryUtilizationPercentage | int | `80` | Average Memory utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetMemoryUtilizationPercentage` to 0 will disable Memory scaling. |
109+
| grafana-agent-statefulset.controller.replicas | int | `1` | |
110+
| grafana-agent-statefulset.controller.type | string | `"statefulset"` | |
111+
| grafana-agent-statefulset.nameOverride | string | `"statefulset"` | Do not change this. |
112+
| grafana-agent-statefulset.rbac.create | bool | `false` | |
113+
| grafana-agent-statefulset.service.clusterIP | string | `"None"` | |
114+
| grafana-agent-statefulset.serviceAccount.create | bool | `false` | |
115+
| metricsGeneration.dimensions | list | `["service.namespace","service.version","deployment.environment","k8s.cluster.name"]` | Additional dimensions to add to generated metrics. |
116+
| metricsGeneration.enabled | bool | `true` | Toggle generation of spanmetrics and servicegraph metrics. |
117+
| sampling.decisionWait | string | `"15s"` | Wait time since the first span of a trace before making a sampling decision. |
118+
| sampling.enabled | bool | `true` | Toggle tail sampling. |
119+
| sampling.extraPolicies | string | A policy to sample long requests is added by default. | User-defined policies in river format. |
120+
| sampling.failedRequests.percentage | int | `50` | Percentage of failed requests to sample. |
121+
| sampling.failedRequests.sample | bool | `false` | Toggle sampling failed requests. |
122+
| sampling.successfulRequests.percentage | int | `10` | Percentage of successful requests to sample. |
123+
| sampling.successfulRequests.sample | bool | `true` | Toggle sampling successful requests. |
124+

0 commit comments

Comments
 (0)