From e60c9a07833a72e4d21ed489742afc5af74dfa13 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 09:20:50 +0100 Subject: [PATCH 01/13] Update `make docs` procedure (#6930) Co-authored-by: grafanabot --- docs/make-docs | 84 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 21 deletions(-) diff --git a/docs/make-docs b/docs/make-docs index 0a1730e6c6fe..f531df2ebb17 100755 --- a/docs/make-docs +++ b/docs/make-docs @@ -6,6 +6,17 @@ # [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes. # Changes are relevant to this script and the support docs.mk GNU Make interface. # +# ## 8.0.0 (2024-05-28) +# +# ### Changed +# +# - Add environment variable `OUTPUT_FORMAT` to control the output of commands. +# +# The default value is `human` and means the output format is human readable. +# The value `json` is also supported and outputs JSON. +# +# Note that the `json` format isn't supported by `make docs`, only `make doc-validator` and `make vale`. +# # ## 7.0.0 (2024-05-03) # # ### Changed @@ -255,6 +266,8 @@ readonly HUGO_REFLINKSERRORLEVEL="${HUGO_REFLINKSERRORLEVEL:-WARNING}" readonly VALE_MINALERTLEVEL="${VALE_MINALERTLEVEL:-error}" readonly WEBSITE_EXEC="${WEBSITE_EXEC:-make server-docs}" +readonly OUTPUT_FORMAT="${OUTPUT_FORMAT:-human}" + PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)" if ! command -v curl >/dev/null 2>&1; then @@ -748,45 +761,74 @@ POSIX_HERESTRING case "${image}" in 'grafana/doc-validator') - if ! command -v jq >/dev/null 2>&1; then - errr '`jq` must be installed for the `doc-validator` target to work.' - note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,' - - exit 1 - fi - proj="$(new_proj "$1")" printf '\r\n' - "${PODMAN}" run \ + + IFS='' read -r cmd </dev/null 2>&1; then + errr '`jq` must be installed for the `doc-validator` target to work.' + note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,' + + exit 1 + fi + + ${cmd} \ + | jq -r '"ERROR: \(.location.path):\(.location.range.start.line // 1):\(.location.range.start.column // 1): \(.message)" + if .suggestions[0].text then "\nSuggestion: \(.suggestions[0].text)" else "" end' + ;; + json) + ${cmd} + ;; + *) # default + errr "Invalid output format '${OUTPUT_FORMAT}'" + esac ;; 'grafana/vale') proj="$(new_proj "$1")" printf '\r\n' - "${PODMAN}" run \ + IFS='' read -r cmd < Date: Fri, 31 May 2024 10:55:12 -0400 Subject: [PATCH 02/13] prep for v0.41.0 on main (#6922) * prep for v0.41.0-rc.1 on main Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> * set for v0.41.0 skipping rc Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> --------- Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> --- CHANGELOG.md | 3 +++ docs/sources/_index.md | 2 +- docs/sources/flow/release-notes.md | 4 ++++ static/operator/defaults.go | 2 +- tools/gen-versioned-files/agent-version.txt | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0480ade1dac4..97baa5276cf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ internal API changes are not present. Main (unreleased) ----------------- +v0.41.0 (2024-05-31) +-------------------- + ### Breaking changes - The default listen port for `otelcol.receiver.opencensus` has changed from diff --git a/docs/sources/_index.md b/docs/sources/_index.md index 3974801b5aef..c61ff7984856 100644 --- a/docs/sources/_index.md +++ b/docs/sources/_index.md @@ -9,7 +9,7 @@ title: Grafana Agent description: Grafana Agent is a flexible, performant, vendor-neutral, telemetry collector weight: 350 cascade: - AGENT_RELEASE: v0.40.5 + AGENT_RELEASE: v0.41.0 OTEL_VERSION: v0.96.0 refs: variants: diff --git a/docs/sources/flow/release-notes.md b/docs/sources/flow/release-notes.md index b5e311127a57..e01a37736d97 100644 --- a/docs/sources/flow/release-notes.md +++ b/docs/sources/flow/release-notes.md @@ -36,6 +36,10 @@ Other release notes for the different {{< param "PRODUCT_ROOT_NAME" >}} variants The default listen port for `otelcol.receiver.opencensus` has changed from 4317 to 55678 to align with the upstream defaults. To retain the previous listen port, explicitly set the `endpoint` argument to `0.0.0.0:4317` before upgrading. +### Breaking change: default `mimir.rules.kubernetes` sync interval changed + +The default sync interval for `mimir.rules.kubernetes` has changed from `30s` to `5m` to reduce load on Mimir. + ## v0.40 ### Breaking change: Prohibit the configuration of services within modules. diff --git a/static/operator/defaults.go b/static/operator/defaults.go index 30ecbc4f2044..40be995cdd55 100644 --- a/static/operator/defaults.go +++ b/static/operator/defaults.go @@ -2,7 +2,7 @@ package operator // Supported versions of the Grafana Agent. var ( - DefaultAgentVersion = "v0.40.5" + DefaultAgentVersion = "v0.41.0" DefaultAgentBaseImage = "grafana/agent" DefaultAgentImage = DefaultAgentBaseImage + ":" + DefaultAgentVersion ) diff --git a/tools/gen-versioned-files/agent-version.txt b/tools/gen-versioned-files/agent-version.txt index 6a9c7cb0af27..9dedf1e9be1c 100644 --- a/tools/gen-versioned-files/agent-version.txt +++ b/tools/gen-versioned-files/agent-version.txt @@ -1 +1 @@ -v0.40.5 +v0.41.0 From 5f4edb0f07761bad97a70c79fcf461e68043d090 Mon Sep 17 00:00:00 2001 From: Erik Baranowski <39704712+erikbaranowski@users.noreply.github.com> Date: Fri, 31 May 2024 15:20:28 -0400 Subject: [PATCH 03/13] update helm for v0.41.0 (#6935) Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> --- docs/developer/release/8-update-helm-charts.md | 2 +- operations/helm/charts/grafana-agent/CHANGELOG.md | 7 +++++++ operations/helm/charts/grafana-agent/Chart.yaml | 4 ++-- operations/helm/charts/grafana-agent/README.md | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/statefulset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/deployment.yaml | 2 +- .../grafana-agent/templates/controllers/deployment.yaml | 2 +- .../grafana-agent/templates/controllers/statefulset.yaml | 2 +- .../grafana-agent/templates/controllers/statefulset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/deployment.yaml | 2 +- 33 files changed, 40 insertions(+), 33 deletions(-) diff --git a/docs/developer/release/8-update-helm-charts.md b/docs/developer/release/8-update-helm-charts.md index 00dbaaa9165b..a544068603e1 100644 --- a/docs/developer/release/8-update-helm-charts.md +++ b/docs/developer/release/8-update-helm-charts.md @@ -30,7 +30,7 @@ Our Helm charts require some version updates as well. 4. Create a branch from `main` for [grafana/agent](https://github.com/grafana/agent). -5. Update the helm chart code in `$agentRepo/operations/helm`: +5. Update the helm chart code in `operations/helm/charts/grafana-agent`: 1. Update `Chart.yaml` with the new helm version and app version. 2. Update `CHANGELOG.md` with a new section for the helm version. diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index 8d8acd10635f..66b7b2a1b33a 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -7,6 +7,13 @@ This document contains a historical list of changes between releases. Only changes that impact end-user behavior are listed; changes to documentation or internal API changes are not present. +0.40.0 (2024-05-31) +---------- + +### Enhancements + +- Update Grafana Agent version to v0.41.0. (@erikbaranowski) + 0.39.0 (2024-05-15) ---------- diff --git a/operations/helm/charts/grafana-agent/Chart.yaml b/operations/helm/charts/grafana-agent/Chart.yaml index 9f4e7a3d59d6..3ae2ec73c03a 100644 --- a/operations/helm/charts/grafana-agent/Chart.yaml +++ b/operations/helm/charts/grafana-agent/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: grafana-agent description: 'Grafana Agent' type: application -version: 0.39.0 -appVersion: 'v0.40.5' +version: 0.40.0 +appVersion: 'v0.41.0' dependencies: - name: crds diff --git a/operations/helm/charts/grafana-agent/README.md b/operations/helm/charts/grafana-agent/README.md index 1651129fe097..dbf0dea6ae31 100644 --- a/operations/helm/charts/grafana-agent/README.md +++ b/operations/helm/charts/grafana-agent/README.md @@ -1,6 +1,6 @@ # Grafana Agent Helm chart -![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.39.0](https://img.shields.io/badge/Version-0.39.0-informational?style=flat-square) ![AppVersion: v0.40.5](https://img.shields.io/badge/AppVersion-v0.40.5-informational?style=flat-square) +![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.40.0](https://img.shields.io/badge/Version-0.40.0-informational?style=flat-square) ![AppVersion: v0.41.0](https://img.shields.io/badge/AppVersion-v0.41.0-informational?style=flat-square) Helm chart for deploying [Grafana Agent][] to Kubernetes. diff --git a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml index 8342110f5701..e1e2d1a34113 100644 --- a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/clustering/grafana-agent/templates/controllers/statefulset.yaml b/operations/helm/tests/clustering/grafana-agent/templates/controllers/statefulset.yaml index 1965dea1b4ff..a1e8a9196e6f 100644 --- a/operations/helm/tests/clustering/grafana-agent/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/clustering/grafana-agent/templates/controllers/statefulset.yaml @@ -30,7 +30,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/controller-volumes-extra/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/controller-volumes-extra/grafana-agent/templates/controllers/daemonset.yaml index f2680dd3e0af..23416d684389 100644 --- a/operations/helm/tests/controller-volumes-extra/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/controller-volumes-extra/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/controllers/daemonset.yaml index 6f17cb5b4191..6e9698e3686a 100644 --- a/operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-daemonset/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/create-daemonset/grafana-agent/templates/controllers/daemonset.yaml index 8342110f5701..e1e2d1a34113 100644 --- a/operations/helm/tests/create-daemonset/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/create-daemonset/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/controllers/deployment.yaml b/operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/controllers/deployment.yaml index ba541d81f563..d3c77ad70601 100644 --- a/operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/controllers/deployment.yaml +++ b/operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/controllers/deployment.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-deployment/grafana-agent/templates/controllers/deployment.yaml b/operations/helm/tests/create-deployment/grafana-agent/templates/controllers/deployment.yaml index 3c444d7d3058..dc2309c5f51f 100644 --- a/operations/helm/tests/create-deployment/grafana-agent/templates/controllers/deployment.yaml +++ b/operations/helm/tests/create-deployment/grafana-agent/templates/controllers/deployment.yaml @@ -28,7 +28,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml b/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml index 38b7fa4d4ca0..22d7e04098c8 100644 --- a/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml @@ -29,7 +29,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-statefulset/grafana-agent/templates/controllers/statefulset.yaml b/operations/helm/tests/create-statefulset/grafana-agent/templates/controllers/statefulset.yaml index 44fe6cbbc98c..245f25020b46 100644 --- a/operations/helm/tests/create-statefulset/grafana-agent/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/create-statefulset/grafana-agent/templates/controllers/statefulset.yaml @@ -30,7 +30,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/custom-config/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/custom-config/grafana-agent/templates/controllers/daemonset.yaml index 8342110f5701..e1e2d1a34113 100644 --- a/operations/helm/tests/custom-config/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/custom-config/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/default-values/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/default-values/grafana-agent/templates/controllers/daemonset.yaml index 8342110f5701..e1e2d1a34113 100644 --- a/operations/helm/tests/default-values/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/default-values/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/controllers/daemonset.yaml index d949e5e76504..5116208298e0 100644 --- a/operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/enable-servicemonitor/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/enable-servicemonitor/grafana-agent/templates/controllers/daemonset.yaml index 8342110f5701..e1e2d1a34113 100644 --- a/operations/helm/tests/enable-servicemonitor/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/enable-servicemonitor/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/envFrom/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/envFrom/grafana-agent/templates/controllers/daemonset.yaml index fc1efb454dc0..f8f0c4a9615b 100644 --- a/operations/helm/tests/envFrom/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/envFrom/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/existing-config/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/existing-config/grafana-agent/templates/controllers/daemonset.yaml index d2091f0387af..4eb6fc47d3d9 100644 --- a/operations/helm/tests/existing-config/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/existing-config/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/extra-env/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/extra-env/grafana-agent/templates/controllers/daemonset.yaml index 0511e63ff103..1e7c77835546 100644 --- a/operations/helm/tests/extra-env/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/extra-env/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/extra-ports/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/extra-ports/grafana-agent/templates/controllers/daemonset.yaml index 8f7df51a7502..7d1e8a9aac54 100644 --- a/operations/helm/tests/extra-ports/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/extra-ports/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/faro-ingress/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/faro-ingress/grafana-agent/templates/controllers/daemonset.yaml index 060a0e1a686e..46483c9dd0ea 100644 --- a/operations/helm/tests/faro-ingress/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/faro-ingress/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml index 33d1f363ca63..3f18e1aa2554 100644 --- a/operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml @@ -32,7 +32,7 @@ spec: - name: global-cred containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/global-image-registry/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/global-image-registry/grafana-agent/templates/controllers/daemonset.yaml index c7640ec7775f..05c1a666c8de 100644 --- a/operations/helm/tests/global-image-registry/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/global-image-registry/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: quay.io/grafana/agent:v0.40.5 + image: quay.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/initcontainers/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/initcontainers/grafana-agent/templates/controllers/daemonset.yaml index 0d1033b105e0..c00cd334f426 100644 --- a/operations/helm/tests/initcontainers/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/initcontainers/grafana-agent/templates/controllers/daemonset.yaml @@ -45,7 +45,7 @@ spec: name: geoip containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml index 48861b4ceed9..910323aac0ab 100644 --- a/operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml @@ -29,7 +29,7 @@ spec: - name: local-cred containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/local-image-registry/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/local-image-registry/grafana-agent/templates/controllers/daemonset.yaml index c7640ec7775f..05c1a666c8de 100644 --- a/operations/helm/tests/local-image-registry/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/local-image-registry/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: quay.io/grafana/agent:v0.40.5 + image: quay.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/controllers/daemonset.yaml index 8d906ce4f9d1..634f29749313 100644 --- a/operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/nonroot/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/nonroot/grafana-agent/templates/controllers/daemonset.yaml index 47dd66fddd20..253b8916d437 100644 --- a/operations/helm/tests/nonroot/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/nonroot/grafana-agent/templates/controllers/daemonset.yaml @@ -29,7 +29,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/pod_annotations/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/pod_annotations/grafana-agent/templates/controllers/daemonset.yaml index 7d435484dad0..f74ef8c279b9 100644 --- a/operations/helm/tests/pod_annotations/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/pod_annotations/grafana-agent/templates/controllers/daemonset.yaml @@ -28,7 +28,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/sidecars/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/sidecars/grafana-agent/templates/controllers/daemonset.yaml index 7a8f63dfe404..b45690e3d15a 100644 --- a/operations/helm/tests/sidecars/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/sidecars/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/static-mode/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/static-mode/grafana-agent/templates/controllers/daemonset.yaml index 061ae337a09b..f0ea39e5bd52 100644 --- a/operations/helm/tests/static-mode/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/static-mode/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - -config.file=/etc/agent/config.yaml diff --git a/operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/controllers/deployment.yaml b/operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/controllers/deployment.yaml index cfa0ff005d70..2b6da91181fb 100644 --- a/operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/controllers/deployment.yaml +++ b/operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/controllers/deployment.yaml @@ -28,7 +28,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.40.5 + image: docker.io/grafana/agent:v0.41.0 imagePullPolicy: IfNotPresent args: - run From 6ead6f7d071f8ba9fabc0414be60c3e9b93105ef Mon Sep 17 00:00:00 2001 From: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> Date: Mon, 3 Jun 2024 05:32:30 -0700 Subject: [PATCH 04/13] Add mode and fix YAML indentation (#6936) --- docs/sources/flow/tasks/configure/configure-kubernetes.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/sources/flow/tasks/configure/configure-kubernetes.md b/docs/sources/flow/tasks/configure/configure-kubernetes.md index 332f38102dfb..8f05f8cdf8b6 100644 --- a/docs/sources/flow/tasks/configure/configure-kubernetes.md +++ b/docs/sources/flow/tasks/configure/configure-kubernetes.md @@ -99,6 +99,7 @@ Use this method if you prefer to embed your {{< param "PRODUCT_NAME" >}} configu ```yaml agent: + mode: "flow" configMap: content: |- // Write your Agent config here: @@ -142,7 +143,8 @@ Use this method if you prefer to write your {{< param "PRODUCT_NAME" >}} configu 1. Modify Helm Chart's configuration in your `values.yaml` to use the existing ConfigMap: ```yaml - agent: + agent: + mode: "flow" configMap: create: false name: agent-config From 53d022d6db2cecffb3369f548cb58b825c6f58f9 Mon Sep 17 00:00:00 2001 From: Marco Schaefer <47627413+codecapitano@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:44:34 +0200 Subject: [PATCH 05/13] chore(faro): prefix measurement values when parsing faro measurements (#6810) * chore(faro): prefix measurement values * changelog * pr: remove duplicated changelog entry * pr: do not convert measurement values to strings * extend unit test --------- Co-authored-by: William Dumont --- CHANGELOG.md | 2 ++ .../faro/receiver/internal/payload/payload.go | 10 +++++++++- .../receiver/internal/payload/payload_test.go | 20 +++++++++++++++++++ .../faro/receiver/internal/payload/utils.go | 14 +++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97baa5276cf0..7d3ed1055f90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ v0.41.0 (2024-05-31) - Added support for `otelcol` configuration conversion in `grafana-agent convert` and `grafana-agent run` commands. (@rfratto, @erikbaranowski, @tpaschalis, @hainenber) +- Prefix Faro measurement values with `value_` to align with the latest Faro cloud receiver updates. (@codecapitano) + - Added support for `static` configuration conversion of the `traces` subsystem. (@erikbaranowski, @wildum) - Add automatic conversion for `legacy_positions_file` in component `loki.source.file`. (@mattdurham) diff --git a/internal/component/faro/receiver/internal/payload/payload.go b/internal/component/faro/receiver/internal/payload/payload.go index 15e7a970e1f5..37d4b5059a39 100644 --- a/internal/component/faro/receiver/internal/payload/payload.go +++ b/internal/component/faro/receiver/internal/payload/payload.go @@ -220,7 +220,7 @@ type Measurement struct { Context MeasurementContext `json:"context,omitempty"` } -// KeyVal representation of the exception object +// KeyVal representation of the measurement object func (m Measurement) KeyVal() *KeyVal { kv := NewKeyVal() @@ -238,6 +238,14 @@ func (m Measurement) KeyVal() *KeyVal { } MergeKeyVal(kv, m.Trace.KeyVal()) MergeKeyValWithPrefix(kv, KeyValFromMap(m.Context), "context_") + + values := make(map[string]float64, len(m.Values)) + for key, value := range m.Values { + values[key] = value + } + + MergeKeyValWithPrefix(kv, KeyValFromFloatMap(values), "value_") + return kv } diff --git a/internal/component/faro/receiver/internal/payload/payload_test.go b/internal/component/faro/receiver/internal/payload/payload_test.go index 5944a2b10e34..7b3e1cc8f05e 100644 --- a/internal/component/faro/receiver/internal/payload/payload_test.go +++ b/internal/component/faro/receiver/internal/payload/payload_test.go @@ -139,4 +139,24 @@ func TestUnmarshalPayloadJSON(t *testing.T) { }, }, }, payload.Measurements) + + kv := payload.Measurements[0].KeyVal() + expectedKv := NewKeyVal() + expectedKv.Set("kind", "measurement") + expectedKv.Set("type", "foobar") + expectedKv.Set("ttfb", 14.000000) + expectedKv.Set("ttfcp", 22.120000) + expectedKv.Set("ttfp", 20.120000) + expectedKv.Set("traceID", "abcd") + expectedKv.Set("spanID", "def") + expectedKv.Set("context_hello", "world") + expectedKv.Set("value_ttfb", 14) + expectedKv.Set("value_ttfcp", 22.12) + expectedKv.Set("value_ttfp", 20.12) + expectedPair := kv.Oldest() + for pair := kv.Oldest(); pair != nil; pair = pair.Next() { + require.Equal(t, expectedPair.Key, pair.Key) + require.Equal(t, expectedPair.Value, pair.Value) + expectedPair = expectedPair.Next() + } } diff --git a/internal/component/faro/receiver/internal/payload/utils.go b/internal/component/faro/receiver/internal/payload/utils.go index dc6e58c90760..c9be5184bb5c 100644 --- a/internal/component/faro/receiver/internal/payload/utils.go +++ b/internal/component/faro/receiver/internal/payload/utils.go @@ -29,6 +29,20 @@ func KeyValFromMap(m map[string]string) *KeyVal { return kv } +// KeyValFromMap will instantiate KeyVal from a map[string]float64 +func KeyValFromFloatMap(m map[string]float64) *KeyVal { + kv := NewKeyVal() + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + sort.Strings(keys) + for _, k := range keys { + kv.Set(k, m[k]) + } + return kv +} + // MergeKeyVal will merge source in target func MergeKeyVal(target *KeyVal, source *KeyVal) { for el := source.Oldest(); el != nil; el = el.Next() { From 8e6a0873b6e1a1a8c9d32c6df79a32570546004a Mon Sep 17 00:00:00 2001 From: mattdurham Date: Fri, 7 Jun 2024 09:04:31 -0400 Subject: [PATCH 06/13] Update custom opentelemetry branch with changes. (#6940) cve-2024-36129 --- CHANGELOG.md | 7 +++++++ .../components/otelcol.receiver.jaeger.md | 2 +- .../components/otelcol.receiver.otlp.md | 2 +- .../components/otelcol.receiver.zipkin.md | 2 +- go.mod | 10 ++++++++-- go.sum | 16 ++++++++-------- 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3ed1055f90..2cb18f0abe2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ internal API changes are not present. Main (unreleased) ----------------- +### Breaking changes + + +- Applied OpenTelemetry [CVE-2024-36129](https://github.com/open-telemetry/opentelemetry-collector/security/advisories/GHSA-c74f-6mfw-mm4v) fixes. (@mattdurham) + - Components `otelcol.receiver.otlp`,`otelcol.receiver.zipkin` and `otelcol.receiver.jaeger` setting `max_request_body_size` + default changed from unlimited size to `20MiB`. + v0.41.0 (2024-05-31) -------------------- diff --git a/docs/sources/flow/reference/components/otelcol.receiver.jaeger.md b/docs/sources/flow/reference/components/otelcol.receiver.jaeger.md index a77bc58c376e..b4a6e0f1058a 100644 --- a/docs/sources/flow/reference/components/otelcol.receiver.jaeger.md +++ b/docs/sources/flow/reference/components/otelcol.receiver.jaeger.md @@ -164,7 +164,7 @@ The following arguments are supported: Name | Type | Description | Default | Required ---- | ---- | ----------- | ------- | -------- `endpoint` | `string` | `host:port` to listen for traffic on. | `"0.0.0.0:14268"` | no -`max_request_body_size` | `string` | Maximum request body size the server will allow. No limit when unset. | | no +`max_request_body_size` | `string` | Maximum request body size the server will allow. | `20MiB` | no `include_metadata` | `boolean` | Propagate incoming connection metadata to downstream consumers. | | no ### cors block diff --git a/docs/sources/flow/reference/components/otelcol.receiver.otlp.md b/docs/sources/flow/reference/components/otelcol.receiver.otlp.md index 86b3633c4ac5..116591fae318 100644 --- a/docs/sources/flow/reference/components/otelcol.receiver.otlp.md +++ b/docs/sources/flow/reference/components/otelcol.receiver.otlp.md @@ -142,7 +142,7 @@ The following arguments are supported: Name | Type | Description | Default | Required ---- | ---- | ----------- | ------- | -------- `endpoint` | `string` | `host:port` to listen for traffic on. | `"0.0.0.0:4318"` | no -`max_request_body_size` | `string` | Maximum request body size the server will allow. No limit when unset. | | no +`max_request_body_size` | `string` | Maximum request body size the server will allow. | `20MiB` | no `include_metadata` | `boolean` | Propagate incoming connection metadata to downstream consumers. | | no `traces_url_path` | `string` | The URL path to receive traces on. | `"/v1/traces"`| no `metrics_url_path` | `string` | The URL path to receive metrics on. | `"/v1/metrics"` | no diff --git a/docs/sources/flow/reference/components/otelcol.receiver.zipkin.md b/docs/sources/flow/reference/components/otelcol.receiver.zipkin.md index 87ed3b6cedfc..077aae622d14 100644 --- a/docs/sources/flow/reference/components/otelcol.receiver.zipkin.md +++ b/docs/sources/flow/reference/components/otelcol.receiver.zipkin.md @@ -39,7 +39,7 @@ Name | Type | Description | Default | Required ---- | ---- | ----------- | ------- | -------- `parse_string_tags` | `bool` | Parse string tags and binary annotations into non-string types. | `false` | no `endpoint` | `string` | `host:port` to listen for traffic on. | `"0.0.0.0:9411"` | no -`max_request_body_size` | `string` | Maximum request body size the HTTP server will allow. No limit when unset. | | no +`max_request_body_size` | `string` | Maximum request body size the server will allow. | `20MiB` | no `include_metadata` | `boolean` | Propagate incoming connection metadata to downstream consumers. | | no If `parse_string_tags` is `true`, string tags and binary annotations are diff --git a/go.mod b/go.mod index dba9e3f36199..da9ba840cc99 100644 --- a/go.mod +++ b/go.mod @@ -768,8 +768,14 @@ replace ( // https://github.com/open-telemetry/opentelemetry-collector/pull/7696 // https://github.com/open-telemetry/opentelemetry-collector/issues/4970 replace ( - go.opentelemetry.io/collector/otelcol => github.com/grafana/opentelemetry-collector/otelcol v0.0.0-20240321103955-8919a1c85cbe - go.opentelemetry.io/collector/service => github.com/grafana/opentelemetry-collector/service v0.0.0-20240321103955-8919a1c85cbe + go.opentelemetry.io/collector/otelcol => github.com/grafana/opentelemetry-collector/otelcol v0.0.0-20240606144032-13b77f7c5603 + go.opentelemetry.io/collector/service => github.com/grafana/opentelemetry-collector/service v0.0.0-20240606144032-13b77f7c5603 +) + +// This is to fix https://opentelemetry.io/blog/2024/cve-2024-36129 +replace ( + go.opentelemetry.io/collector/config/configgrpc => github.com/grafana/opentelemetry-collector/config/configgrpc v0.0.0-20240606144032-13b77f7c5603 + go.opentelemetry.io/collector/config/confighttp => github.com/grafana/opentelemetry-collector/config/confighttp v0.0.0-20240606144032-13b77f7c5603 ) // Required to avoid an ambiguous import with github.com/tencentcloud/tencentcloud-sdk-go diff --git a/go.sum b/go.sum index 9cc619280431..ea0d93d3a82c 100644 --- a/go.sum +++ b/go.sum @@ -1051,10 +1051,14 @@ github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595 h1:I9sR github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595/go.mod h1:U8ifHC5pT2WuVTO7ki4KZmWLjfEKfktQiU3bh0J8scw= github.com/grafana/node_exporter v0.18.1-grafana-r01.0.20231004161416-702318429731 h1:vyyIYY2sLpmgFIckJ1vSO/oYkvB0thDF6UiFYp5PThM= github.com/grafana/node_exporter v0.18.1-grafana-r01.0.20231004161416-702318429731/go.mod h1:vOZxEzxm0nZmuNqjtIfvtmvdRtJik9POmcN5mQVLf5E= -github.com/grafana/opentelemetry-collector/otelcol v0.0.0-20240321103955-8919a1c85cbe h1:XffwtyK11B/undScvvYBi/LSWG7ob43lzkdhxmxZkJw= -github.com/grafana/opentelemetry-collector/otelcol v0.0.0-20240321103955-8919a1c85cbe/go.mod h1:Xo58hEmoZFLyOIs9Wk400ME9gEFV+ttxCGcls6NxbhI= -github.com/grafana/opentelemetry-collector/service v0.0.0-20240321103955-8919a1c85cbe h1:LEmmaAnTjtp7pWCsnc8iMfuHIHzDbYIiCXnxpMTOLms= -github.com/grafana/opentelemetry-collector/service v0.0.0-20240321103955-8919a1c85cbe/go.mod h1:9El7PPhnV+2xPXLlyileLaUa5mOE+vw6sswmcZBaUlc= +github.com/grafana/opentelemetry-collector/config/configgrpc v0.0.0-20240606144032-13b77f7c5603 h1:F3jPOSv2BEO9kuCmlC02pyykcUPkDvgEfWC2pbcWq9M= +github.com/grafana/opentelemetry-collector/config/configgrpc v0.0.0-20240606144032-13b77f7c5603/go.mod h1:uUxDCwvWvyf331boTH8/gZhUXXST2r1ps5+ZAvxZl4o= +github.com/grafana/opentelemetry-collector/config/confighttp v0.0.0-20240606144032-13b77f7c5603 h1:f/rfuBzUEi7zV/bgazSeBH+I4z7a5JoeuhrZEl6ftic= +github.com/grafana/opentelemetry-collector/config/confighttp v0.0.0-20240606144032-13b77f7c5603/go.mod h1:KWac7J9mNFjtN4dQz8AUmFVBr7c2UOfo5OM7wfdPToI= +github.com/grafana/opentelemetry-collector/otelcol v0.0.0-20240606144032-13b77f7c5603 h1:g0fFX99XCDM8BOHnvJ3yLaRd4GPz9BcmiuDzB29GteM= +github.com/grafana/opentelemetry-collector/otelcol v0.0.0-20240606144032-13b77f7c5603/go.mod h1:Xo58hEmoZFLyOIs9Wk400ME9gEFV+ttxCGcls6NxbhI= +github.com/grafana/opentelemetry-collector/service v0.0.0-20240606144032-13b77f7c5603 h1:ItTHpGwsZ1JvHKUZ0OzMI9KseTE29fHf/sHhC+86BjM= +github.com/grafana/opentelemetry-collector/service v0.0.0-20240606144032-13b77f7c5603/go.mod h1:9El7PPhnV+2xPXLlyileLaUa5mOE+vw6sswmcZBaUlc= github.com/grafana/postgres_exporter v0.15.1-0.20240417113938-9358270470dd h1:vNHdecaOmYgSHMEQRgyzWacV++N38Jp8qLZg0RCsfFo= github.com/grafana/postgres_exporter v0.15.1-0.20240417113938-9358270470dd/go.mod h1:kR16GJ0ZwWVQ2osW3pgtDJU1a/GXpufrwio0kLG14cg= github.com/grafana/prometheus v1.8.2-0.20240130142130-51b39f24d406 h1:LVIOYe5j92m10wluP5hgeHqSkOLnZzcPxhYCkdbLXCE= @@ -2312,10 +2316,6 @@ go.opentelemetry.io/collector/config/configauth v0.96.0 h1:nnRLtaPVafazVij60/Q6q go.opentelemetry.io/collector/config/configauth v0.96.0/go.mod h1:XABE3s1OiLzjhHv6R/eMOp8fYFweF6/Naa9NgDD+Ntg= go.opentelemetry.io/collector/config/configcompression v0.96.0 h1:mbP0YbYTfbpovxcZE6JrBYmWg5G1Dozj7eOuLAdqcI4= go.opentelemetry.io/collector/config/configcompression v0.96.0/go.mod h1:owL6s04LI1fPrNZvXiRm6o4B0jaxb3z/oFEcgrakFK4= -go.opentelemetry.io/collector/config/configgrpc v0.96.0 h1:FxCtsN8V4zYYq5wlSYAjBs3OEI1AbjfzmzSPkHYZKkY= -go.opentelemetry.io/collector/config/configgrpc v0.96.0/go.mod h1:uUxDCwvWvyf331boTH8/gZhUXXST2r1ps5+ZAvxZl4o= -go.opentelemetry.io/collector/config/confighttp v0.96.0 h1:/piTkhB+UhhkvHc2PmHBuZzvp0okWTGiL/kZIh+zMmQ= -go.opentelemetry.io/collector/config/confighttp v0.96.0/go.mod h1:KWac7J9mNFjtN4dQz8AUmFVBr7c2UOfo5OM7wfdPToI= go.opentelemetry.io/collector/config/confignet v0.96.0 h1:ZUwziVVxWgcRMqukfKfdEjxfgmfhGsX6J3GEzF/Pupk= go.opentelemetry.io/collector/config/confignet v0.96.0/go.mod h1:BVw5xkQ7TH2wH75cbph+dtOoxq1baWLuhdSYIAvuVu0= go.opentelemetry.io/collector/config/configopaque v1.3.0 h1:J60RL/XxGmBF+OX2+Gx+yAo/p7YwjSsOOlPlo1yXotA= From 8f5281c3a28f90612676394883c29ff5a4b7dc0f Mon Sep 17 00:00:00 2001 From: mattdurham Date: Fri, 7 Jun 2024 10:51:49 -0400 Subject: [PATCH 07/13] Update versions for path to 41.1 (#6944) --- CHANGELOG.md | 9 ++++++++- docs/sources/_index.md | 2 +- static/operator/defaults.go | 2 +- tools/gen-versioned-files/agent-version.txt | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cb18f0abe2d..e1278c8e7aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,13 +10,20 @@ internal API changes are not present. Main (unreleased) ----------------- -### Breaking changes +v0.41.1 (2024-06-07) +-------------------- +### Breaking changes - Applied OpenTelemetry [CVE-2024-36129](https://github.com/open-telemetry/opentelemetry-collector/security/advisories/GHSA-c74f-6mfw-mm4v) fixes. (@mattdurham) - Components `otelcol.receiver.otlp`,`otelcol.receiver.zipkin` and `otelcol.receiver.jaeger` setting `max_request_body_size` default changed from unlimited size to `20MiB`. +### Enhancements + +- Updated pyroscope to v0.4.6 introducing `symbols_map_size` and `pid_map_size` configuration. (@simonswine) + + v0.41.0 (2024-05-31) -------------------- diff --git a/docs/sources/_index.md b/docs/sources/_index.md index c61ff7984856..78bdf97881df 100644 --- a/docs/sources/_index.md +++ b/docs/sources/_index.md @@ -9,7 +9,7 @@ title: Grafana Agent description: Grafana Agent is a flexible, performant, vendor-neutral, telemetry collector weight: 350 cascade: - AGENT_RELEASE: v0.41.0 + AGENT_RELEASE: v0.41.1 OTEL_VERSION: v0.96.0 refs: variants: diff --git a/static/operator/defaults.go b/static/operator/defaults.go index 40be995cdd55..406877a5df21 100644 --- a/static/operator/defaults.go +++ b/static/operator/defaults.go @@ -2,7 +2,7 @@ package operator // Supported versions of the Grafana Agent. var ( - DefaultAgentVersion = "v0.41.0" + DefaultAgentVersion = "v0.41.1" DefaultAgentBaseImage = "grafana/agent" DefaultAgentImage = DefaultAgentBaseImage + ":" + DefaultAgentVersion ) diff --git a/tools/gen-versioned-files/agent-version.txt b/tools/gen-versioned-files/agent-version.txt index 9dedf1e9be1c..d0cca40aac25 100644 --- a/tools/gen-versioned-files/agent-version.txt +++ b/tools/gen-versioned-files/agent-version.txt @@ -1 +1 @@ -v0.41.0 +v0.41.1 From 211e73898f00ccec10797cb2e9c7108d754e50df Mon Sep 17 00:00:00 2001 From: mattdurham Date: Fri, 7 Jun 2024 11:17:11 -0400 Subject: [PATCH 08/13] Add doc for release notes. (#6946) --- docs/sources/flow/release-notes.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/sources/flow/release-notes.md b/docs/sources/flow/release-notes.md index e01a37736d97..984e76c68ddf 100644 --- a/docs/sources/flow/release-notes.md +++ b/docs/sources/flow/release-notes.md @@ -29,6 +29,13 @@ Other release notes for the different {{< param "PRODUCT_ROOT_NAME" >}} variants [release-notes-operator]: {{< relref "../operator/release-notes.md" >}} {{< /admonition >}} +## v0.41.1 + +### Breaking change: `max_request_body_size` for `otelcol.receiver.otlp`,`otelcol.receiver.zipkin`,`otelcol.receiver.jaeger` changed + +The default value for `max_request_body_size` changed from unlimited to `20 MiB`. There is no ability to change `max_request_body_size` +to accept unlimited requests. + ## v0.41 ### Breaking change: default `otelcol.receiver.opencensus` list port changed From ad83d1e769a57dd39ae1cccf48fdb79fc77e334b Mon Sep 17 00:00:00 2001 From: mattdurham Date: Fri, 7 Jun 2024 14:00:00 -0400 Subject: [PATCH 09/13] Update chart for 41.1 (#6949) --- operations/helm/charts/grafana-agent/CHANGELOG.md | 7 +++++++ operations/helm/charts/grafana-agent/Chart.yaml | 4 ++-- operations/helm/charts/grafana-agent/README.md | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/statefulset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/deployment.yaml | 2 +- .../grafana-agent/templates/controllers/deployment.yaml | 2 +- .../grafana-agent/templates/controllers/statefulset.yaml | 2 +- .../grafana-agent/templates/controllers/statefulset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/daemonset.yaml | 2 +- .../grafana-agent/templates/controllers/deployment.yaml | 2 +- 32 files changed, 39 insertions(+), 32 deletions(-) diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index 66b7b2a1b33a..19fe15f10670 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -7,6 +7,13 @@ This document contains a historical list of changes between releases. Only changes that impact end-user behavior are listed; changes to documentation or internal API changes are not present. +0.41.0 (2024-06-07) +---------- + +### Enhancements + +- Update Grafana Agent version to v0.41.1. (@mattdurham) + 0.40.0 (2024-05-31) ---------- diff --git a/operations/helm/charts/grafana-agent/Chart.yaml b/operations/helm/charts/grafana-agent/Chart.yaml index 3ae2ec73c03a..49a37997ceda 100644 --- a/operations/helm/charts/grafana-agent/Chart.yaml +++ b/operations/helm/charts/grafana-agent/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: grafana-agent description: 'Grafana Agent' type: application -version: 0.40.0 -appVersion: 'v0.41.0' +version: 0.41.0 +appVersion: 'v0.41.1' dependencies: - name: crds diff --git a/operations/helm/charts/grafana-agent/README.md b/operations/helm/charts/grafana-agent/README.md index dbf0dea6ae31..f9308b6db569 100644 --- a/operations/helm/charts/grafana-agent/README.md +++ b/operations/helm/charts/grafana-agent/README.md @@ -1,6 +1,6 @@ # Grafana Agent Helm chart -![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.40.0](https://img.shields.io/badge/Version-0.40.0-informational?style=flat-square) ![AppVersion: v0.41.0](https://img.shields.io/badge/AppVersion-v0.41.0-informational?style=flat-square) +![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.41.0](https://img.shields.io/badge/Version-0.41.0-informational?style=flat-square) ![AppVersion: v0.41.1](https://img.shields.io/badge/AppVersion-v0.41.1-informational?style=flat-square) Helm chart for deploying [Grafana Agent][] to Kubernetes. diff --git a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml index e1e2d1a34113..10646a50a00c 100644 --- a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/clustering/grafana-agent/templates/controllers/statefulset.yaml b/operations/helm/tests/clustering/grafana-agent/templates/controllers/statefulset.yaml index a1e8a9196e6f..5a18082becfe 100644 --- a/operations/helm/tests/clustering/grafana-agent/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/clustering/grafana-agent/templates/controllers/statefulset.yaml @@ -30,7 +30,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/controller-volumes-extra/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/controller-volumes-extra/grafana-agent/templates/controllers/daemonset.yaml index 23416d684389..153a0656f2f7 100644 --- a/operations/helm/tests/controller-volumes-extra/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/controller-volumes-extra/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/controllers/daemonset.yaml index 6e9698e3686a..4ca333fac2fd 100644 --- a/operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-daemonset/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/create-daemonset/grafana-agent/templates/controllers/daemonset.yaml index e1e2d1a34113..10646a50a00c 100644 --- a/operations/helm/tests/create-daemonset/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/create-daemonset/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/controllers/deployment.yaml b/operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/controllers/deployment.yaml index d3c77ad70601..d89e24c7656f 100644 --- a/operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/controllers/deployment.yaml +++ b/operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/controllers/deployment.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-deployment/grafana-agent/templates/controllers/deployment.yaml b/operations/helm/tests/create-deployment/grafana-agent/templates/controllers/deployment.yaml index dc2309c5f51f..ae9bb7994f30 100644 --- a/operations/helm/tests/create-deployment/grafana-agent/templates/controllers/deployment.yaml +++ b/operations/helm/tests/create-deployment/grafana-agent/templates/controllers/deployment.yaml @@ -28,7 +28,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml b/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml index 22d7e04098c8..236088c60321 100644 --- a/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml @@ -29,7 +29,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/create-statefulset/grafana-agent/templates/controllers/statefulset.yaml b/operations/helm/tests/create-statefulset/grafana-agent/templates/controllers/statefulset.yaml index 245f25020b46..c7f01f36ed7f 100644 --- a/operations/helm/tests/create-statefulset/grafana-agent/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/create-statefulset/grafana-agent/templates/controllers/statefulset.yaml @@ -30,7 +30,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/custom-config/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/custom-config/grafana-agent/templates/controllers/daemonset.yaml index e1e2d1a34113..10646a50a00c 100644 --- a/operations/helm/tests/custom-config/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/custom-config/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/default-values/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/default-values/grafana-agent/templates/controllers/daemonset.yaml index e1e2d1a34113..10646a50a00c 100644 --- a/operations/helm/tests/default-values/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/default-values/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/controllers/daemonset.yaml index 5116208298e0..608585d64fcc 100644 --- a/operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/enable-servicemonitor/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/enable-servicemonitor/grafana-agent/templates/controllers/daemonset.yaml index e1e2d1a34113..10646a50a00c 100644 --- a/operations/helm/tests/enable-servicemonitor/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/enable-servicemonitor/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/envFrom/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/envFrom/grafana-agent/templates/controllers/daemonset.yaml index f8f0c4a9615b..4e921fde3e94 100644 --- a/operations/helm/tests/envFrom/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/envFrom/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/existing-config/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/existing-config/grafana-agent/templates/controllers/daemonset.yaml index 4eb6fc47d3d9..4c9e18851982 100644 --- a/operations/helm/tests/existing-config/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/existing-config/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/extra-env/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/extra-env/grafana-agent/templates/controllers/daemonset.yaml index 1e7c77835546..91b2f7b3b7d6 100644 --- a/operations/helm/tests/extra-env/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/extra-env/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/extra-ports/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/extra-ports/grafana-agent/templates/controllers/daemonset.yaml index 7d1e8a9aac54..a954b8c15bc4 100644 --- a/operations/helm/tests/extra-ports/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/extra-ports/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/faro-ingress/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/faro-ingress/grafana-agent/templates/controllers/daemonset.yaml index 46483c9dd0ea..4ac402c122ab 100644 --- a/operations/helm/tests/faro-ingress/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/faro-ingress/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml index 3f18e1aa2554..f223eb95526e 100644 --- a/operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml @@ -32,7 +32,7 @@ spec: - name: global-cred containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/global-image-registry/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/global-image-registry/grafana-agent/templates/controllers/daemonset.yaml index 05c1a666c8de..ab3b8cc86645 100644 --- a/operations/helm/tests/global-image-registry/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/global-image-registry/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: quay.io/grafana/agent:v0.41.0 + image: quay.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/initcontainers/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/initcontainers/grafana-agent/templates/controllers/daemonset.yaml index c00cd334f426..81161eac8261 100644 --- a/operations/helm/tests/initcontainers/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/initcontainers/grafana-agent/templates/controllers/daemonset.yaml @@ -45,7 +45,7 @@ spec: name: geoip containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml index 910323aac0ab..6558b5eb887e 100644 --- a/operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/controllers/daemonset.yaml @@ -29,7 +29,7 @@ spec: - name: local-cred containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/local-image-registry/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/local-image-registry/grafana-agent/templates/controllers/daemonset.yaml index 05c1a666c8de..ab3b8cc86645 100644 --- a/operations/helm/tests/local-image-registry/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/local-image-registry/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: quay.io/grafana/agent:v0.41.0 + image: quay.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/controllers/daemonset.yaml index 634f29749313..1679c438d4ea 100644 --- a/operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/nonroot/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/nonroot/grafana-agent/templates/controllers/daemonset.yaml index 253b8916d437..9376ab3b40e1 100644 --- a/operations/helm/tests/nonroot/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/nonroot/grafana-agent/templates/controllers/daemonset.yaml @@ -29,7 +29,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/pod_annotations/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/pod_annotations/grafana-agent/templates/controllers/daemonset.yaml index f74ef8c279b9..f1dc1e30c0af 100644 --- a/operations/helm/tests/pod_annotations/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/pod_annotations/grafana-agent/templates/controllers/daemonset.yaml @@ -28,7 +28,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/sidecars/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/sidecars/grafana-agent/templates/controllers/daemonset.yaml index b45690e3d15a..fb8d87c88fac 100644 --- a/operations/helm/tests/sidecars/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/sidecars/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run diff --git a/operations/helm/tests/static-mode/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/static-mode/grafana-agent/templates/controllers/daemonset.yaml index f0ea39e5bd52..b309d3dd1187 100644 --- a/operations/helm/tests/static-mode/grafana-agent/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/static-mode/grafana-agent/templates/controllers/daemonset.yaml @@ -27,7 +27,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - -config.file=/etc/agent/config.yaml diff --git a/operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/controllers/deployment.yaml b/operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/controllers/deployment.yaml index 2b6da91181fb..4bec438a9f1e 100644 --- a/operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/controllers/deployment.yaml +++ b/operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/controllers/deployment.yaml @@ -28,7 +28,7 @@ spec: serviceAccountName: grafana-agent containers: - name: grafana-agent - image: docker.io/grafana/agent:v0.41.0 + image: docker.io/grafana/agent:v0.41.1 imagePullPolicy: IfNotPresent args: - run From cb940a24e523234b1fe9fdc67f9f4a372ca65360 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:12:44 +0100 Subject: [PATCH 10/13] build(deps): bump aquasecurity/trivy-action from 0.20.0 to 0.22.0 (#6951) Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.20.0 to 0.22.0. - [Release notes](https://github.com/aquasecurity/trivy-action/releases) - [Commits](https://github.com/aquasecurity/trivy-action/compare/b2933f565dbc598b29947660e66259e3c7bc8561...595be6a0f6560a0a8fc419ddf630567fc623531d) --- updated-dependencies: - dependency-name: aquasecurity/trivy-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/trivy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 0c5dc80e0220..6e80c9b6978b 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -26,7 +26,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@b2933f565dbc598b29947660e66259e3c7bc8561 + uses: aquasecurity/trivy-action@595be6a0f6560a0a8fc419ddf630567fc623531d with: image-ref: 'grafana/agent:main' format: 'template' From a834fa5ce6116d06ada51f6bd76ae77d14c7ab61 Mon Sep 17 00:00:00 2001 From: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> Date: Wed, 12 Jun 2024 07:25:06 -0700 Subject: [PATCH 11/13] Add alt text and fix broken image links (#6955) * Add alt text and fix broekn image links * Match case to page title --- docs/sources/flow/tasks/debug.md | 12 +++++------- .../flow/tasks/opentelemetry-to-lgtm-stack.md | 11 +++++------ .../integrations/cloudwatch-exporter-config.md | 12 ++++++------ 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/docs/sources/flow/tasks/debug.md b/docs/sources/flow/tasks/debug.md index 9b5dfb2cab90..69d4090f057b 100644 --- a/docs/sources/flow/tasks/debug.md +++ b/docs/sources/flow/tasks/debug.md @@ -65,7 +65,7 @@ Follow these steps to debug issues with {{< param "PRODUCT_NAME" >}}: ### Home page -![](../../assets/ui_home_page.png) +![The Agent UI home page showing a table of components.](/media/docs/agent/ui_home_page.png) The home page shows a table of components defined in the configuration file and their health. @@ -75,14 +75,14 @@ Click the {{< param "PRODUCT_ROOT_NAME" >}} logo to navigate back to the home pa ### Graph page -![](../../assets/ui_graph_page.png) +![The Graph page showing a graph view of components.](/media/docs/agent/ui_graph_page.png) The **Graph** page shows a graph view of components defined in the configuration file and their health. Clicking a component in the graph navigates to the [Component detail page](#component-detail-page) for that component. ### Component detail page -![](../../assets/ui_component_detail_page.png) +![The component detail page showing detailed information about the components.](/media/docs/agent/ui_component_detail_page.png) The component detail page shows the following information for each component: @@ -95,9 +95,9 @@ The component detail page shows the following information for each component: ### Clustering page -![](../../assets/ui_clustering_page.png) +![The Clustering page showing detailed information about each cluster node.](/media/docs/agent/ui_clustering_page.png) -The clustering page shows the following information for each cluster node: +The Clustering page shows the following information for each cluster node: * The node's name. * The node's advertised address. @@ -144,5 +144,3 @@ Some issues that appear to be clustering issues may be symptoms of other issues, for example, problems with scraping or service discovery can result in missing metrics for an agent that can be interpreted as a node not joining the cluster. {{< /admonition >}} - - diff --git a/docs/sources/flow/tasks/opentelemetry-to-lgtm-stack.md b/docs/sources/flow/tasks/opentelemetry-to-lgtm-stack.md index 031690fa1e95..632b5475c1df 100644 --- a/docs/sources/flow/tasks/opentelemetry-to-lgtm-stack.md +++ b/docs/sources/flow/tasks/opentelemetry-to-lgtm-stack.md @@ -165,7 +165,7 @@ loki.write "default" { To use Loki with basic-auth, which is required with Grafana Cloud Loki, you must configure the [loki.write](ref:loki.write) component. You can get the Loki configuration from the Loki **Details** page in the [Grafana Cloud Portal][]: -![](../../../assets/tasks/loki-config.png) +![The Loki Details page showing information about the Loki configuration.](/media/docs/agent/loki-config.png) ```river otelcol.exporter.loki "grafana_cloud_loki" { @@ -200,7 +200,7 @@ otelcol.exporter.otlp "default" { To use Tempo with basic-auth, which is required with Grafana Cloud Tempo, you must use the [otelcol.auth.basic](ref:otelcol.auth.basic) component. You can get the Tempo configuration from the Tempo **Details** page in the [Grafana Cloud Portal][]: -![](../../../assets/tasks/tempo-config.png) +![The Tempo Details page showing information about the Tempo configuration.](/media/docs/agent//tempo-config.png) ```river otelcol.exporter.otlp "grafana_cloud_tempo" { @@ -237,7 +237,7 @@ prometheus.remote_write "default" { To use Prometheus with basic-auth, which is required with Grafana Cloud Prometheus, you must configure the [prometheus.remote_write](ref:prometheus.remote_write) component. You can get the Prometheus configuration from the Prometheus **Details** page in the [Grafana Cloud Portal][]: -![](../../../assets/tasks/prometheus-config.png) +![The Prometheus Details page showing information about the Prometheus configuration.](/media/docs/agent/prometheus-config.png) ```river otelcol.exporter.prometheus "grafana_cloud_prometheus" { @@ -361,9 +361,9 @@ ts=2023-05-09T09:37:15.304109Z component=otelcol.receiver.otlp.default level=inf ts=2023-05-09T09:37:15.304234Z component=otelcol.receiver.otlp.default level=info msg="Starting HTTP server" endpoint=0.0.0.0:4318 ``` -You can now check the pipeline graphically by visiting http://localhost:12345/graph +You can now check the pipeline graphically by visiting -![](../../../assets/tasks/otlp-lgtm-graph.png) +![The Graph page showing a graphical representation of the pipeline.](/media/docs/agent/otlp-lgtm-graph.png) [OpenTelemetry]: https://opentelemetry.io [Grafana Loki]: https://grafana.com/oss/loki/ @@ -371,4 +371,3 @@ You can now check the pipeline graphically by visiting http://localhost:12345/gr [Grafana Cloud Portal]: https://grafana.com/docs/grafana-cloud/account-management/cloud-portal#your-grafana-cloud-stack [Prometheus Remote Write]: https://prometheus.io/docs/operating/integrations/#remote-endpoints-and-storage [Grafana Mimir]: https://grafana.com/oss/mimir/ - diff --git a/docs/sources/static/configuration/integrations/cloudwatch-exporter-config.md b/docs/sources/static/configuration/integrations/cloudwatch-exporter-config.md index 6495625b76c8..7379895146cd 100644 --- a/docs/sources/static/configuration/integrations/cloudwatch-exporter-config.md +++ b/docs/sources/static/configuration/integrations/cloudwatch-exporter-config.md @@ -355,19 +355,19 @@ pick the ones you need. `length` controls how far back in time CloudWatch metrics are considered during each agent scrape. If both settings are configured, the time parameters when calling CloudWatch APIs work as follows: -![](https://grafana.com/media/docs/agent/cloudwatch-period-and-length-time-model-2.png) +![A diagram showing how the time parameters work when both period and length are configured.](/media/docs/agent/cloudwatch-period-and-length-time-model-2.png) -As noted above, if there is a different `period` or `length` across multiple metrics under the same static or discovery job, +As noted above, if there is a different `period` or `length` across multiple metrics under the same static or discovery job, the minimum of all periods, and maximum of all lengths is configured. -On the other hand, if `length` is not configured, both period and length settings are calculated based on +On the other hand, if `length` isn't configured, both period and length settings are calculated based on the required `period` configuration attribute. If all metrics within a job (discovery or static) have the same `period` value configured, CloudWatch APIs will be -requested for metrics from the scrape time, to `period`s seconds in the past. +requested for metrics from the scrape time, to `period`s seconds in the past. The values of these metrics are exported to Prometheus. -![](https://grafana.com/media/docs/agent/cloudwatch-single-period-time-model.png) +![A diagram showing how the time parameters work when a single period is configured.](/media/docs/agent/cloudwatch-single-period-time-model.png) On the other hand, if metrics with different `period`s are configured under an individual job, this works differently. First, two variables are calculated aggregating all periods: `length`, taking the maximum value of all periods, and @@ -375,7 +375,7 @@ the new `period` value, taking the minimum of all periods. Then, CloudWatch APIs `now - length` to `now`, aggregating each in samples for `period` seconds. For each metric, the most recent sample is exported to CloudWatch. -![](https://grafana.com/media/docs/agent/cloudwatch-multiple-period-time-model.png) +![A diagram showing how the time parameters work when multiple periods are configured.](/media/docs/agent/cloudwatch-multiple-period-time-model.png) ## Supported services in discovery jobs From 584f497e19cee403dc2beb5c3414fb4a769cd9f0 Mon Sep 17 00:00:00 2001 From: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> Date: Wed, 12 Jun 2024 07:25:28 -0700 Subject: [PATCH 12/13] FIx ref pattern (#6954) --- docs/sources/operator/release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/operator/release-notes.md b/docs/sources/operator/release-notes.md index c8f3812dbc24..9c83ca534b6f 100644 --- a/docs/sources/operator/release-notes.md +++ b/docs/sources/operator/release-notes.md @@ -14,7 +14,7 @@ refs: release-notes-static: - pattern: /docs/agent/ destination: /docs/agent//static/release-notes/ - - pattern: /docs/agent/ + - pattern: /docs/grafana-cloud/ destination: /docs/grafana-cloud/send-data/agent/static/release-notes/ release-notes-flow: - pattern: /docs/agent/ From e1527524b25fb8e41af76ca3ad4f1eebcc7585bc Mon Sep 17 00:00:00 2001 From: Barun Das Date: Thu, 13 Jun 2024 06:37:28 -0400 Subject: [PATCH 13/13] New `otelcol.exporter.debug` component (#5867) New otelcol.exporter.debug component. --------- Co-authored-by: Paulin Todev --- CHANGELOG.md | 5 + .../flow/reference/compatibility/_index.md | 1 + .../components/otelcol.exporter.debug.md | 102 ++++++++++++++++++ go.mod | 1 + go.sum | 2 + internal/component/all/all.go | 1 + .../component/otelcol/exporter/debug/debug.go | 96 +++++++++++++++++ .../otelcol/exporter/debug/debug_test.go | 79 ++++++++++++++ 8 files changed, 287 insertions(+) create mode 100644 docs/sources/flow/reference/components/otelcol.exporter.debug.md create mode 100644 internal/component/otelcol/exporter/debug/debug.go create mode 100644 internal/component/otelcol/exporter/debug/debug_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index e1278c8e7aa3..272b0fbdfda2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ internal API changes are not present. Main (unreleased) ----------------- +### Features + +- A new `otelcol.exporter.debug` component for printing OTel telemetry from + other `otelcol` components to the console. (@BarunKGP) + v0.41.1 (2024-06-07) -------------------- diff --git a/docs/sources/flow/reference/compatibility/_index.md b/docs/sources/flow/reference/compatibility/_index.md index 61775bcf26b5..97d113cdb10f 100644 --- a/docs/sources/flow/reference/compatibility/_index.md +++ b/docs/sources/flow/reference/compatibility/_index.md @@ -287,6 +287,7 @@ The following components, grouped by namespace, _export_ OpenTelemetry `otelcol. - [otelcol.connector.servicegraph](../components/otelcol.connector.servicegraph) - [otelcol.connector.spanlogs](../components/otelcol.connector.spanlogs) - [otelcol.connector.spanmetrics](../components/otelcol.connector.spanmetrics) +- [otelcol.exporter.debug](../components/otelcol.exporter.debug) - [otelcol.exporter.loadbalancing](../components/otelcol.exporter.loadbalancing) - [otelcol.exporter.logging](../components/otelcol.exporter.logging) - [otelcol.exporter.loki](../components/otelcol.exporter.loki) diff --git a/docs/sources/flow/reference/components/otelcol.exporter.debug.md b/docs/sources/flow/reference/components/otelcol.exporter.debug.md new file mode 100644 index 000000000000..a3006d9d9bf2 --- /dev/null +++ b/docs/sources/flow/reference/components/otelcol.exporter.debug.md @@ -0,0 +1,102 @@ +--- +aliases: +- /docs/grafana-cloud/agent/flow/reference/components/otelcol.exporter.debug/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/reference/components/otelcol.exporter.debug/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/reference/components/otelcol.exporter.debug/ +- /docs/grafana-cloud/send-data/agent/flow/reference/components/otelcol.exporter.debug/ +canonical: https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.exporter.debug/ +description: Learn about otelcol.exporter.debug +labels: + stage: experimental +title: otelcol.exporter.debug +--- + +# otelcol.exporter.debug + +`otelcol.exporter.debug` accepts telemetry data from other `otelcol` components and writes them to the console (stderr). +You can control the verbosity of the logs. + +{{< admonition type="note" >}} +`otelcol.exporter.debug` is a wrapper over the upstream OpenTelemetry Collector `debug` exporter. +If necessary, bug reports or feature requests are redirected to the upstream repository. +{{< /admonition >}} + +Multiple `otelcol.exporter.debug` components can be specified by giving them different labels. + +## Usage + +```river +otelcol.exporter.debug "LABEL" { } +``` + +## Arguments + +`otelcol.exporter.debug` supports the following arguments: + +Name | Type | Description | Default | Required +---- | ---- | ----------- | ------- | -------- +`verbosity` | `string` | Verbosity of the generated logs. | `"normal"` | no +`sampling_initial` | `int` | Number of messages initially logged each second. | `2` | no +`sampling_thereafter` | `int` | Sampling rate after the initial messages are logged. | `500` | no + +The `verbosity` argument must be one of `"basic"`, `"normal"`, or `"detailed"`. + +## Exported fields + +The following fields are exported and can be referenced by other components: + +Name | Type | Description +---- | ---- | ----------- +`input` | `otelcol.Consumer` | A value that other components can use to send telemetry data to. + +`input` accepts `otelcol.Consumer` data for any telemetry signal (metrics, +logs, or traces). + +## Component health + +`otelcol.exporter.debug` is only reported as unhealthy if given an invalid +configuration. + +## Debug information + +`otelcol.exporter.debug` does not expose any component-specific debug +information. + +## Example + +This example scrapes Prometheus UNIX metrics and writes them to the console: + +```river +prometheus.exporter.unix "default" { } + +prometheus.scrape "default" { + targets = prometheus.exporter.unix.default.targets + forward_to = [otelcol.receiver.prometheus.default.receiver] +} + +otelcol.receiver.prometheus "default" { + output { + metrics = [otelcol.exporter.debug.default.input] + } +} + +otelcol.exporter.debug "default" { + verbosity = "detailed" + sampling_initial = 1 + sampling_thereafter = 1 +} +``` + + +## Compatible components + +`otelcol.exporter.debug` has exports that can be consumed by the following components: + +- Components that consume [OpenTelemetry `otelcol.Consumer`](../../compatibility/#opentelemetry-otelcolconsumer-consumers) + +{{< admonition type="note" >}} +Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. +Refer to the linked documentation for more details. +{{< /admonition >}} + + \ No newline at end of file diff --git a/go.mod b/go.mod index da9ba840cc99..aa4750d6fb0c 100644 --- a/go.mod +++ b/go.mod @@ -615,6 +615,7 @@ require ( go.opentelemetry.io/collector/confmap/converter/expandconverter v0.96.0 go.opentelemetry.io/collector/confmap/provider/fileprovider v0.96.0 go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.96.0 + go.opentelemetry.io/collector/exporter/debugexporter v0.96.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.24.0 golang.org/x/crypto/x509roots/fallback v0.0.0-20240208163226-62c9f1799c91 k8s.io/apimachinery v0.29.2 diff --git a/go.sum b/go.sum index ea0d93d3a82c..16547bbd5f45 100644 --- a/go.sum +++ b/go.sum @@ -2348,6 +2348,8 @@ go.opentelemetry.io/collector/consumer v0.96.0 h1:JN4JHelp5EGMGoC2UVelTMG6hyZjgt go.opentelemetry.io/collector/consumer v0.96.0/go.mod h1:Vn+qzzKgekDFayCVV8peSH5Btx1xrt/bmzD9gTxgidQ= go.opentelemetry.io/collector/exporter v0.96.0 h1:SmOSaP+zUNq0nl+BcllsCSsYePdUNIIUfW5sXKKaUlI= go.opentelemetry.io/collector/exporter v0.96.0/go.mod h1:DcuGaxcINhOV2LgojDI56r3830cUtuCsNadINMIU23c= +go.opentelemetry.io/collector/exporter/debugexporter v0.96.0 h1:88v2GWCIuYgd3e4KdwF0JLklIgBzETBw0e3dkEJ7BbI= +go.opentelemetry.io/collector/exporter/debugexporter v0.96.0/go.mod h1:mZjJ0G6Pn6aSS7T4UeEjXSHt3pgslvaZa/4Uam8DKuo= go.opentelemetry.io/collector/exporter/loggingexporter v0.96.0 h1:fKHt4iTcD7C0utDzeww6ZYVlDYaC0dw9wtzVwLha4CM= go.opentelemetry.io/collector/exporter/loggingexporter v0.96.0/go.mod h1:vpuKdiIQ6yjwZbKiiAs/MV8rZMKiQfPF55vX8UxO8fk= go.opentelemetry.io/collector/exporter/otlpexporter v0.96.0 h1:vZEd10B/zj7WkBWSVegDkGOwv7FZhUwyk60E2zkYwL4= diff --git a/internal/component/all/all.go b/internal/component/all/all.go index f6911eb95b30..75156137b027 100644 --- a/internal/component/all/all.go +++ b/internal/component/all/all.go @@ -70,6 +70,7 @@ import ( _ "github.com/grafana/agent/internal/component/otelcol/connector/servicegraph" // Import otelcol.connector.servicegraph _ "github.com/grafana/agent/internal/component/otelcol/connector/spanlogs" // Import otelcol.connector.spanlogs _ "github.com/grafana/agent/internal/component/otelcol/connector/spanmetrics" // Import otelcol.connector.spanmetrics + _ "github.com/grafana/agent/internal/component/otelcol/exporter/debug" // Import otelcol.exporter.debug _ "github.com/grafana/agent/internal/component/otelcol/exporter/loadbalancing" // Import otelcol.exporter.loadbalancing _ "github.com/grafana/agent/internal/component/otelcol/exporter/logging" // Import otelcol.exporter.logging _ "github.com/grafana/agent/internal/component/otelcol/exporter/loki" // Import otelcol.exporter.loki diff --git a/internal/component/otelcol/exporter/debug/debug.go b/internal/component/otelcol/exporter/debug/debug.go new file mode 100644 index 000000000000..66d0ad40b9ca --- /dev/null +++ b/internal/component/otelcol/exporter/debug/debug.go @@ -0,0 +1,96 @@ +package debug + +import ( + "fmt" + + "github.com/grafana/agent/internal/component" + "github.com/grafana/agent/internal/component/otelcol" + "github.com/grafana/agent/internal/component/otelcol/exporter" + "github.com/grafana/agent/internal/featuregate" + otelcomponent "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configtelemetry" + debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" + otelextension "go.opentelemetry.io/collector/extension" +) + +func init() { + component.Register(component.Registration{ + Name: "otelcol.exporter.debug", + Args: Arguments{}, + Exports: otelcol.ConsumerExports{}, + Stability: featuregate.StabilityExperimental, + + Build: func(opts component.Options, args component.Arguments) (component.Component, error) { + fact := debugexporter.NewFactory() + return exporter.New(opts, fact, args.(Arguments), exporter.TypeAll) + }, + }) +} + +type Arguments struct { + Verbosity string `river:"verbosity,attr,optional"` + SamplingInitial int `river:"sampling_initial,attr,optional"` + SamplingThereafter int `river:"sampling_thereafter,attr,optional"` +} + +func (args Arguments) convertVerbosity() (configtelemetry.Level, error) { + var verbosity configtelemetry.Level + switch args.Verbosity { + case "basic": + verbosity = configtelemetry.LevelBasic + case "normal": + verbosity = configtelemetry.LevelNormal + case "detailed": + verbosity = configtelemetry.LevelDetailed + default: + // Invalid verbosity + // debugexporter only supports basic, normal and detailed levels + return verbosity, fmt.Errorf("invalid verbosity %q", args.Verbosity) + } + + return verbosity, nil +} + +var _ exporter.Arguments = Arguments{} + +// DefaultArguments holds default values for Arguments. +var DefaultArguments = Arguments{ + Verbosity: "normal", + SamplingInitial: 2, + SamplingThereafter: 500, +} + +// SetToDefault implements river.Defaulter. +func (args *Arguments) SetToDefault() { + *args = DefaultArguments +} + +// Convert implements exporter.Arguments. +func (args Arguments) Convert() (otelcomponent.Config, error) { + verbosity, err := args.convertVerbosity() + if err != nil { + return nil, fmt.Errorf("error in conversion to config arguments, %v", err) + } + + return &debugexporter.Config{ + Verbosity: verbosity, + SamplingInitial: args.SamplingInitial, + SamplingThereafter: args.SamplingThereafter, + }, nil +} + +// Extensions implements exporter.Arguments. +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { + return nil +} + +// Exporters implements exporter.Arguments. +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { + return nil +} + +// DebugMetricsConfig implements receiver.Arguments. +func (args Arguments) DebugMetricsConfig() otelcol.DebugMetricsArguments { + var debugMetrics otelcol.DebugMetricsArguments + return debugMetrics +} diff --git a/internal/component/otelcol/exporter/debug/debug_test.go b/internal/component/otelcol/exporter/debug/debug_test.go new file mode 100644 index 000000000000..85d180bf9a51 --- /dev/null +++ b/internal/component/otelcol/exporter/debug/debug_test.go @@ -0,0 +1,79 @@ +package debug_test + +import ( + "fmt" + "testing" + + "github.com/grafana/agent/internal/component/otelcol/exporter/debug" + "github.com/grafana/river" + "github.com/stretchr/testify/require" + otelcomponent "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configtelemetry" + debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" +) + +func Test(t *testing.T) { + tests := []struct { + testName string + args string + expectedReturn debugexporter.Config + errorMsg string + }{ + { + testName: "defaultConfig", + args: ``, + expectedReturn: debugexporter.Config{ + Verbosity: configtelemetry.LevelNormal, + SamplingInitial: 2, + SamplingThereafter: 500, + }, + }, + + { + testName: "validConfig", + args: ` + verbosity = "detailed" + sampling_initial = 5 + sampling_thereafter = 20 + `, + expectedReturn: debugexporter.Config{ + Verbosity: configtelemetry.LevelDetailed, + SamplingInitial: 5, + SamplingThereafter: 20, + }, + }, + + { + testName: "invalidConfig", + args: ` + verbosity = "test" + sampling_initial = 5 + sampling_thereafter = 20 + `, + errorMsg: "error in conversion to config arguments", + }, + } + + for _, tc := range tests { + t.Run(tc.testName, func(t *testing.T) { + var args debug.Arguments + err := river.Unmarshal([]byte(tc.args), &args) + require.NoError(t, err) + + actualPtr, err := args.Convert() + if tc.errorMsg != "" { + require.ErrorContains(t, err, tc.errorMsg) + return + } + + require.NoError(t, err) + + actual := actualPtr.(*debugexporter.Config) + fmt.Printf("Passed conversion") + + require.NoError(t, otelcomponent.ValidateConfig(actual)) + + require.Equal(t, tc.expectedReturn, *actual) + }) + } +}