From b06eb00882bc18f58a7d0f135ca0e91e0ed1a88c Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Fri, 5 Apr 2024 13:11:24 -0400 Subject: [PATCH] misc: final renames and release prep (#132) --- .drone/drone.yml | 156 +++++++++++++++- .drone/pipelines/publish.jsonnet | 166 ++++++++++-------- .github/depcheck.yml | 4 +- .../workflows/publish-documentation-next.yml | 2 +- .../publish-documentation-versioned.yml | 6 +- .github/workflows/scripts.yml | 2 +- docs/Makefile | 3 - .../developer/release/8-update-helm-charts.md | 24 +-- docs/sources/assets/hierarchy.svg | 100 ----------- .../components/prometheus.exporter.self.md | 4 +- .../components/prometheus.exporter.unix.md | 2 +- docs/sources/shared/deploy-alloy.md | 4 +- docs/sources/tasks/debug.md | 2 +- .../first-components-and-stdlib/index.md | 2 +- docs/variables.mk | 4 +- internal/alloyseed/alloyseed.go | 9 +- internal/static/metrics/cluster/config.go | 1 - internal/usagestats/reporter.go | 5 +- internal/util/otel_feature_gate_test.go | 2 +- .../dashboards/prometheus.libsonnet | 2 +- operations/helm/charts/alloy/README.md | 4 +- operations/helm/charts/alloy/README.md.gotmpl | 4 +- .../charts/alloy/ci/clustering-values.yaml | 2 +- .../ci/controller-volumes-extra-values.yaml | 2 +- .../create-deployment-autoscaling-values.yaml | 2 +- ...create-statefulset-autoscaling-values.yaml | 2 +- .../charts/alloy/ci/custom-config-values.yaml | 2 +- .../ci/enable-servicemonitor-tls-values.yaml | 2 +- .../helm/charts/alloy/ci/envFrom-values.yaml | 2 +- .../alloy/ci/existing-config-values.yaml | 2 +- .../charts/alloy/ci/extra-env-values.yaml | 2 +- .../charts/alloy/ci/extra-ports-values.yaml | 2 +- .../charts/alloy/ci/faro-ingress-values.yaml | 2 +- .../alloy/ci/initcontainers-values.yaml | 2 +- .../ci/local-image-pullsecrets-values.yaml | 2 +- .../helm/charts/alloy/ci/sidecars-values.yaml | 2 +- operations/helm/charts/alloy/values.yaml | 3 +- tools/ci/docker-containers | 30 ++-- tools/ci/docker-containers-windows | 30 +++- tools/release | 2 +- 40 files changed, 331 insertions(+), 270 deletions(-) delete mode 100644 docs/sources/assets/hierarchy.svg diff --git a/.drone/drone.yml b/.drone/drone.yml index d3f195be56..2592f92081 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -271,7 +271,7 @@ steps: - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - docker buildx create --name multiarch-alloy-alloy-${DRONE_COMMIT_SHA} --driver docker-container --use - - DEVELOPMENT=1 ./tools/ci/docker-containers alloy + - ./tools/ci/docker-containers alloy-devel - docker buildx rm multiarch-alloy-alloy-${DRONE_COMMIT_SHA} environment: DOCKER_LOGIN: @@ -295,6 +295,158 @@ volumes: name: docker --- kind: pipeline +name: Publish development Windows alloy container +platform: + arch: amd64 + os: windows + version: "1809" +steps: +- commands: + - '& "C:/Program Files/git/bin/bash.exe" ./tools/ci/docker-containers-windows alloy-devel' + environment: + DOCKER_LOGIN: + from_secret: docker_login + DOCKER_PASSWORD: + from_secret: docker_password + image: grafana/agent-build-image:0.40.2-windows + name: Build containers + volumes: + - name: docker + path: //./pipe/docker_engine/ +trigger: + ref: + - refs/heads/main +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker +--- +kind: pipeline +name: Publish Linux alloy container +platform: + arch: amd64 + os: linux +steps: +- commands: + - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + failure: ignore + image: grafana/agent-build-image:0.40.2 + name: Configure QEMU + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - mkdir -p $HOME/.docker + - printenv GCR_CREDS > $HOME/.docker/config.json + - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD + - docker buildx create --name multiarch-alloy-alloy-${DRONE_COMMIT_SHA} --driver + docker-container --use + - ./tools/ci/docker-containers alloy + - docker buildx rm multiarch-alloy-alloy-${DRONE_COMMIT_SHA} + environment: + DOCKER_LOGIN: + from_secret: docker_login + DOCKER_PASSWORD: + from_secret: docker_password + GCR_CREDS: + from_secret: gcr_admin + image: grafana/agent-build-image:0.40.2 + name: Publish container + volumes: + - name: docker + path: /var/run/docker.sock +trigger: + ref: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +--- +kind: pipeline +name: Publish Windows alloy container +platform: + arch: amd64 + os: windows + version: "1809" +steps: +- commands: + - '& "C:/Program Files/git/bin/bash.exe" ./tools/ci/docker-containers-windows alloy' + environment: + DOCKER_LOGIN: + from_secret: docker_login + DOCKER_PASSWORD: + from_secret: docker_password + image: grafana/agent-build-image:0.40.2-windows + name: Build containers + volumes: + - name: docker + path: //./pipe/docker_engine/ +trigger: + ref: + - refs/tags/v* +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker +--- +depends_on: +- Publish Linux alloy container +- Publish Windows alloy container +image_pull_secrets: +- dockerconfigjson +kind: pipeline +name: Publish release +platform: + arch: amd64 + os: linux +steps: +- commands: + - /usr/bin/github-app-external-token > /drone/src/gh-token.txt + environment: + GITHUB_APP_ID: + from_secret: updater_app_id + GITHUB_APP_INSTALLATION_ID: + from_secret: updater_app_installation_id + GITHUB_APP_PRIVATE_KEY: + from_secret: updater_private_key + image: us.gcr.io/kubernetes-dev/github-app-secret-writer:latest + name: Generate GitHub token +- commands: + - export GITHUB_TOKEN=$(cat /drone/src/gh-token.txt) + - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD + - RELEASE_BUILD=1 VERSION="${DRONE_TAG}" make -j4 dist + - | + VERSION="${DRONE_TAG}" RELEASE_DOC_TAG=$(echo "${DRONE_TAG}" | awk -F '.' '{print $1"."$2}') ./tools/release + environment: + DOCKER_LOGIN: + from_secret: docker_login + DOCKER_PASSWORD: + from_secret: docker_password + GPG_PASSPHRASE: + from_secret: gpg_passphrase + GPG_PRIVATE_KEY: + from_secret: gpg_private_key + GPG_PUBLIC_KEY: + from_secret: gpg_public_key + image: grafana/agent-build-image:0.40.2 + name: Publish release + volumes: + - name: docker + path: /var/run/docker.sock +trigger: + ref: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +--- +kind: pipeline name: Test Linux system packages platform: arch: amd64 @@ -401,6 +553,6 @@ kind: secret name: updater_private_key --- kind: signature -hmac: 1c75c3c155d1dba9707728f7b6a5fed9399518900e86c7fba55e52a253bdb26b +hmac: 8dfa15c0fd4f3dde68d7099e77e6a4f90f3fd6685288805e6927f6ad24b9359a ... diff --git a/.drone/pipelines/publish.jsonnet b/.drone/pipelines/publish.jsonnet index e78b634813..8b4ecab764 100644 --- a/.drone/pipelines/publish.jsonnet +++ b/.drone/pipelines/publish.jsonnet @@ -7,13 +7,12 @@ local ghTokenFilename = '/drone/src/gh-token.txt'; local job_names = function(jobs) std.map(function(job) job.name, jobs); local linux_containers = ['alloy']; +local windows_containers = ['alloy']; local linux_containers_dev_jobs = std.map(function(container) ( pipelines.linux('Publish development Linux %s container' % container) { trigger: { - ref: [ - 'refs/heads/main', - ], + ref: ['refs/heads/main'], }, steps: [{ // We only need to run this once per machine, so it's OK if it fails. It @@ -48,7 +47,7 @@ local linux_containers_dev_jobs = std.map(function(container) ( // Create a buildx worker for our cross platform builds. 'docker buildx create --name multiarch-alloy-%s-${DRONE_COMMIT_SHA} --driver docker-container --use' % container, - 'DEVELOPMENT=1 ./tools/ci/docker-containers %s' % container, + './tools/ci/docker-containers %s-devel' % container, 'docker buildx rm multiarch-alloy-%s-${DRONE_COMMIT_SHA}' % container, ], @@ -60,14 +59,37 @@ local linux_containers_dev_jobs = std.map(function(container) ( } ), linux_containers); +local windows_containers_dev_jobs = std.map(function(container) ( + pipelines.windows('Publish development Windows %s container' % container) { + trigger: { + ref: ['refs/heads/main'], + }, + steps: [{ + name: 'Build containers', + image: build_image.windows, + volumes: [{ + name: 'docker', + path: '//./pipe/docker_engine/', + }], + environment: { + DOCKER_LOGIN: secrets.docker_login.fromSecret, + DOCKER_PASSWORD: secrets.docker_password.fromSecret, + }, + commands: [ + '& "C:/Program Files/git/bin/bash.exe" ./tools/ci/docker-containers-windows %s-devel' % container, + ], + }], + volumes: [{ + name: 'docker', + host: { path: '//./pipe/docker_engine/' }, + }], + } +), windows_containers); local linux_containers_jobs = std.map(function(container) ( pipelines.linux('Publish Linux %s container' % container) { trigger: { - ref: [ - 'refs/heads/main', - 'refs/tags/v*', - ], + ref: ['refs/tags/v*'], }, steps: [{ // We only need to run this once per machine, so it's OK if it fails. It @@ -114,14 +136,10 @@ local linux_containers_jobs = std.map(function(container) ( } ), linux_containers); -local windows_containers = ['agent']; local windows_containers_jobs = std.map(function(container) ( pipelines.windows('Publish Windows %s container' % container) { trigger: { - ref: [ - 'refs/heads/main', - 'refs/tags/v*', - ], + ref: ['refs/tags/v*'], }, steps: [{ name: 'Build containers', @@ -145,70 +163,65 @@ local windows_containers_jobs = std.map(function(container) ( } ), windows_containers); -// TODO(rfratto): The following are TEMPORARILY disabled as grafana/alloy gets -// set up. Remove the line below in favor of the comment block to reenable the -// publish jobs. -// -// This file must be refactored in the future after development has fully -// shifted. -linux_containers_dev_jobs - -/* +linux_containers_dev_jobs + windows_containers_dev_jobs + linux_containers_jobs + windows_containers_jobs + [ - pipelines.linux('Deploy to deployment_tools') { - trigger: { - ref: ['refs/heads/main'], - }, - image_pull_secrets: ['dockerconfigjson'], - steps: [ - { - name: 'Create .image-tag', - image: 'alpine', - commands: [ - 'apk update && apk add git', - 'echo "$(sh ./tools/image-tag)" > .tag-only', - 'echo "grafana/agent:$(sh ./tools/image-tag)" > .image-tag', - ], + // TODO(rfratto): Re-enable CD for development images. + /* + pipelines.linux('Deploy to deployment_tools') { + trigger: { + ref: ['refs/heads/main'], }, - { - name: 'Update deployment_tools', - image: 'us.gcr.io/kubernetes-dev/drone/plugins/updater', - settings: { - config_json: ||| - { - "git_committer_name": "updater-for-ci[bot]", - "git_author_name": "updater-for-ci[bot]", - "git_committer_email": "119986603+updater-for-ci[bot]@users.noreply.github.com", - "git_author_email": "119986603+updater-for-ci[bot]@users.noreply.github.com", - "destination_branch": "master", - "repo_name": "deployment_tools", - "update_jsonnet_attribute_configs": [ - { - "file_path": "ksonnet/environments/kowalski/dev-us-central-0.kowalski-dev/main.jsonnet", - "jsonnet_key": "agent_image", - "jsonnet_value_file": ".image-tag" - }, - { - "file_path": "ksonnet/environments/grafana-agent/waves/agent.libsonnet", - "jsonnet_key": "dev_canary", - "jsonnet_value_file": ".image-tag" - }, - { - "file_path": "ksonnet/environments/pyroscope-ebpf/waves/ebpf.libsonnet", - "jsonnet_key": "dev_canary", - "jsonnet_value_file": ".image-tag" - } - ] - } - |||, - github_app_id: secrets.updater_app_id.fromSecret, - github_app_installation_id: secrets.updater_app_installation_id.fromSecret, - github_app_private_key: secrets.updater_private_key.fromSecret, + image_pull_secrets: ['dockerconfigjson'], + steps: [ + { + name: 'Create .image-tag', + image: 'alpine', + commands: [ + 'apk update && apk add git', + 'echo "$(sh ./tools/image-tag)" > .tag-only', + 'echo "grafana/agent:$(sh ./tools/image-tag)" > .image-tag', + ], }, - }, - ], - depends_on: job_names(linux_containers_jobs), - }, + { + name: 'Update deployment_tools', + image: 'us.gcr.io/kubernetes-dev/drone/plugins/updater', + settings: { + config_json: ||| + { + "git_committer_name": "updater-for-ci[bot]", + "git_author_name": "updater-for-ci[bot]", + "git_committer_email": "119986603+updater-for-ci[bot]@users.noreply.github.com", + "git_author_email": "119986603+updater-for-ci[bot]@users.noreply.github.com", + "destination_branch": "master", + "repo_name": "deployment_tools", + "update_jsonnet_attribute_configs": [ + { + "file_path": "ksonnet/environments/kowalski/dev-us-central-0.kowalski-dev/main.jsonnet", + "jsonnet_key": "agent_image", + "jsonnet_value_file": ".image-tag" + }, + { + "file_path": "ksonnet/environments/grafana-agent/waves/agent.libsonnet", + "jsonnet_key": "dev_canary", + "jsonnet_value_file": ".image-tag" + }, + { + "file_path": "ksonnet/environments/pyroscope-ebpf/waves/ebpf.libsonnet", + "jsonnet_key": "dev_canary", + "jsonnet_value_file": ".image-tag" + } + ] + } + |||, + github_app_id: secrets.updater_app_id.fromSecret, + github_app_installation_id: secrets.updater_app_installation_id.fromSecret, + github_app_private_key: secrets.updater_private_key.fromSecret, + }, + }, + ], + depends_on: job_names(linux_containers_dev_jobs), + }, + */ pipelines.linux('Publish release') { trigger: { @@ -246,9 +259,9 @@ linux_containers_jobs + windows_containers_jobs + [ commands: [ 'export GITHUB_TOKEN=$(cat %s)' % ghTokenFilename, 'docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD', - 'make -j4 RELEASE_BUILD=1 VERSION=${DRONE_TAG} dist', + 'RELEASE_BUILD=1 VERSION="${DRONE_TAG}" make -j4 dist', ||| - VERSION=${DRONE_TAG} RELEASE_DOC_TAG=$(echo ${DRONE_TAG} | awk -F '.' '{print $1"."$2}') ./tools/release + VERSION="${DRONE_TAG}" RELEASE_DOC_TAG=$(echo "${DRONE_TAG}" | awk -F '.' '{print $1"."$2}') ./tools/release |||, ], }, @@ -259,4 +272,3 @@ linux_containers_jobs + windows_containers_jobs + [ }], }, ] -*/ diff --git a/.github/depcheck.yml b/.github/depcheck.yml index b3eeb7c994..d29d06fcd7 100644 --- a/.github/depcheck.yml +++ b/.github/depcheck.yml @@ -17,8 +17,8 @@ go_modules: # explicitly in go.mod *OR* are in go.mod but replaced with a fork should be # added here. # -# The "current" version being used in the Agent must be provided explicitly as -# you can see below. +# The "current" version being used in Alloy must be provided explicitly as you +# can see below. github_repos: - github.com/google/dnsmasq_exporter v0.2.0 - github.com/ncabatoff/process-exporter v0.7.5 diff --git a/.github/workflows/publish-documentation-next.yml b/.github/workflows/publish-documentation-next.yml index fa72d1988b..36702ce72c 100644 --- a/.github/workflows/publish-documentation-next.yml +++ b/.github/workflows/publish-documentation-next.yml @@ -42,7 +42,7 @@ jobs: id: "publish_next" with: repository: grafana/website - branch: alloy-docs + branch: robbymilo/alloy-launch host: github.com # PUBLISH_TO_WEBSITE_TOKEN is a fine-grained GitHub Personal Access Token that expires. # It must be regenerated in the grafanabot GitHub account and requires a Grafana organization diff --git a/.github/workflows/publish-documentation-versioned.yml b/.github/workflows/publish-documentation-versioned.yml index 71028e1472..7fbcd0bc02 100644 --- a/.github/workflows/publish-documentation-versioned.yml +++ b/.github/workflows/publish-documentation-versioned.yml @@ -3,7 +3,7 @@ name: "publish-technical-documentation-version" on: push: branches: - - 'release-*' + - 'release/*' tags: - 'v[0-9]+.[0-9]+.[0-9]+' paths: @@ -49,7 +49,7 @@ jobs: with: ref_name: "${{ github.ref_name }}" release_tag_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$" - release_branch_regexp: "^release-v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$" + release_branch_regexp: "^release/v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$" - name: "Extract semver" if: "steps.has-matching-release-tag.outputs.bool == 'true'" @@ -72,7 +72,7 @@ jobs: id: "publish_release" with: repository: grafana/website - branch: alloy-docs + branch: robbymilo/alloy-launch host: github.com # PUBLISH_TO_WEBSITE_TOKEN is a fine-grained GitHub Personal Access Token that expires. # It must be regenerated in the grafanabot GitHub account and requires a Grafana organization diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml index 9bdfe33ee5..fc43e33386 100644 --- a/.github/workflows/scripts.yml +++ b/.github/workflows/scripts.yml @@ -8,4 +8,4 @@ jobs: - uses: actions/checkout@v4 - uses: azohra/shell-linter@latest with: - path: "packaging,production,tools/ci,tools/release,docs/sources/flow/tutorials/assets" + path: "packaging,production,tools/ci,tools/release,docs/sources/tutorials/assets" diff --git a/docs/Makefile b/docs/Makefile index b0c97d4d33..a5beaf340e 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -15,6 +15,3 @@ check-cloudwatch-integration: generate-cloudwatch-integration: $(PODMAN) run -v $(shell git rev-parse --show-toplevel):/repo -v $(shell pwd):/docs -w /repo golang:1.22.1-bullseye go run internal/static/integrations/cloudwatch_exporter/docs/doc.go generate - -sources/assets/hierarchy.svg: sources/operator/hierarchy.dot - cat $< | $(PODMAN) run --rm -i nshine/dot dot -Tsvg > $@ diff --git a/docs/developer/release/8-update-helm-charts.md b/docs/developer/release/8-update-helm-charts.md index 961cb6260a..754424e6db 100644 --- a/docs/developer/release/8-update-helm-charts.md +++ b/docs/developer/release/8-update-helm-charts.md @@ -10,30 +10,12 @@ Our Helm charts require some version updates as well. ## Steps -1. Create a branch from `main` for [grafana/helm-charts](https://github.com/grafana/helm-charts). +1. Create a branch from `main` for [grafana/alloy](https://github.com/grafana/alloy). -2. Update the code: - - 1. Copy the content of the last CRDs into helm-charts. - - Copy the contents from agent repo `operations/agent-static-operator/crds` to replace the contents of helm-charts repo `charts/agent-operator/crds` - - 2. Update references of agent-operator app version in helm-charts pointing to release version. - - 3. Bump up the helm chart version. - - > **NOTE**: Do not update the README.md manually. Running the - > [helm-docs](https://github.com/norwoodj/helm-docs) utility in the `charts/agent-operator` - > directory will update it automatically. - -3. Open a PR, following the pattern in PR [#2233](https://github.com/grafana/helm-charts/pull/2233). - -4. Create a branch from `main` for [grafana/alloy](https://github.com/grafana/alloy). - -5. Update the helm chart code in `$agentRepo/operations/helm`: +2. Update the helm chart code in `$alloyRepo/operations/helm`: 1. Update `Chart.yaml` with the new helm version and app version. 2. Update `CHANGELOG.md` with a new section for the helm version. 3. Run `make docs rebuild-tests` from the `operations/helm` directory. -6. Open a PR, following the pattern in PR [#3126](https://github.com/grafana/agent/pull/3126). +3. Open a PR, following the pattern in PR [#3126](https://github.com/grafana/agent/pull/3126). diff --git a/docs/sources/assets/hierarchy.svg b/docs/sources/assets/hierarchy.svg deleted file mode 100644 index 3b4e7c976c..0000000000 --- a/docs/sources/assets/hierarchy.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - -G - - - -GrafanaAgent - -GrafanaAgent -app.kubernetes.io/name: grafana-agent-operator - - - -MetricsInstance - -MetricsInstance -helm.sh/chart: loki-3.2.2     -instance: primary - - - -GrafanaAgent->MetricsInstance - - -matchLabels: -  instance: primary - - - -LogsInstance - -LogsInstance -helm.sh/chart: loki-3.2.2     -instance: primary - - - -GrafanaAgent->LogsInstance - - -matchLabels: -  instance: primary - - - -ServiceMonitor - -ServiceMonitor -helm.sh/chart: loki-3.2.2     -instance: primary - - - -MetricsInstance->ServiceMonitor - - -matchLabels: - instance: primary - - - -Probe - -Probe -helm.sh/chart: loki-3.2.2     -instance: primary - - - -MetricsInstance->Probe - - -matchLabels: -  instance: primary - - - -PodLogs - -PodLogs -helm.sh/chart: loki-3.2.2     -instance: primary - - - -LogsInstance->PodLogs - - -matchLabels: -  instance: primary - - - diff --git a/docs/sources/reference/components/prometheus.exporter.self.md b/docs/sources/reference/components/prometheus.exporter.self.md index 8a4fbc9f27..805af91306 100644 --- a/docs/sources/reference/components/prometheus.exporter.self.md +++ b/docs/sources/reference/components/prometheus.exporter.self.md @@ -11,7 +11,7 @@ The `prometheus.exporter.self` component collects and exposes metrics about {{< ## Usage ```alloy -prometheus.exporter.self "agent" { +prometheus.exporter.self "alloy" { } ``` @@ -46,7 +46,7 @@ from `prometheus.exporter.self`: ```alloy prometheus.exporter.self "example" {} -// Configure a prometheus.scrape component to collect agent metrics. +// Configure a prometheus.scrape component to collect Alloy metrics. prometheus.scrape "demo" { targets = prometheus.exporter.self.example.targets forward_to = [prometheus.remote_write.demo.receiver] diff --git a/docs/sources/reference/components/prometheus.exporter.unix.md b/docs/sources/reference/components/prometheus.exporter.unix.md index eb49ded8d5..5c7b11e8ef 100644 --- a/docs/sources/reference/components/prometheus.exporter.unix.md +++ b/docs/sources/reference/components/prometheus.exporter.unix.md @@ -130,7 +130,7 @@ The following blocks are supported inside the definition of ### filesystem block -The default values can vary by the operating system the agent runs on - refer to the [integration source](https://github.com/grafana/alloy/blob/main/internal/static/integrations/node_exporter/config.go) for up-to-date values on each OS. +The default values can vary by the operating system Alloy runs on - refer to the [integration source](https://github.com/grafana/alloy/blob/main/internal/static/integrations/node_exporter/config.go) for up-to-date values on each OS. | Name | Type | Description | Default | Required | | ---------------------- | ---------- | ------------------------------------------------------------------- | ----------------------------------------------- | -------- | diff --git a/docs/sources/shared/deploy-alloy.md b/docs/sources/shared/deploy-alloy.md index 7042b53172..c19d52c125 100644 --- a/docs/sources/shared/deploy-alloy.md +++ b/docs/sources/shared/deploy-alloy.md @@ -32,7 +32,7 @@ You can also use a Kubernetes Deployment in cases where persistent storage isn't ### Pros -* Straightforward scaling using [clustering][] or [hashmod sharding][] +* Straightforward scaling using [clustering][] * Minimizes the “noisy neighbor” effect * Easy to meta-monitor @@ -118,6 +118,4 @@ The Pod’s controller, network configuration, enabled capabilities, and availab * Scenarios where the {{< param "PRODUCT_NAME" >}} deployment size grows so large it can become a noisy neighbor -[hashmod sharding]: https://grafana.com/docs/agent/latest/static/operation-guide/ - [clustering]: ../../concepts/clustering/ diff --git a/docs/sources/tasks/debug.md b/docs/sources/tasks/debug.md index c7c2b23521..0d477e78a4 100644 --- a/docs/sources/tasks/debug.md +++ b/docs/sources/tasks/debug.md @@ -106,7 +106,7 @@ To debug issues when using [clustering][], check for the following symptoms. Check the clustering page to view the state of the peers and verify that the terminating {{< param "PRODUCT_NAME" >}} has been shut down. {{< admonition type="note" >}} -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. +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 Alloy instance that can be interpreted as a node not joining the cluster. {{< /admonition >}} [logging]: ../../reference/config-blocks/logging/ diff --git a/docs/sources/tutorials/first-components-and-stdlib/index.md b/docs/sources/tutorials/first-components-and-stdlib/index.md index a8a16d4e9e..3ff5c123e6 100644 --- a/docs/sources/tutorials/first-components-and-stdlib/index.md +++ b/docs/sources/tutorials/first-components-and-stdlib/index.md @@ -281,7 +281,7 @@ prometheus.remote_write "local_prom" { ## Finishing up and next steps -You might have noticed that running {{< param "PRODUCT_NAME" >}} with the configurations created a directory called `data-agent` in the directory you ran {{< param "PRODUCT_NAME" >}} from. +You might have noticed that running {{< param "PRODUCT_NAME" >}} with the configurations created a directory called `data-alloy` in the directory you ran {{< param "PRODUCT_NAME" >}} from. This directory is where components can store data, such as the `prometheus.exporter.unix` component storing its WAL (Write Ahead Log). If you look in the directory, do you notice anything interesting? The directory for each component is the fully qualified name. diff --git a/docs/variables.mk b/docs/variables.mk index 43189540d9..8b6d36759f 100644 --- a/docs/variables.mk +++ b/docs/variables.mk @@ -1,7 +1,7 @@ # List of projects to provide to the make-docs script. # Format is PROJECT[:[VERSION][:[REPOSITORY][:[DIRECTORY]]]] -# The following PROJECTS value mounts content into the agent project, at the "latest" version, which is the default if not explicitly set. -# This results in the content being served at /docs/agent/latest/. +# The following PROJECTS value mounts content into the Alloy project, at the "latest" version, which is the default if not explicitly set. +# This results in the content being served at /docs/alloy/latest/. # The source of the content is the current repository which is determined by the name of the parent directory of the git root. # This overrides the default behavior of assuming the repository directory is the same as the project name. PROJECTS := alloy::$(notdir $(basename $(shell git rev-parse --show-toplevel))) diff --git a/internal/alloyseed/alloyseed.go b/internal/alloyseed/alloyseed.go index 580a3ecbe2..46935cb05b 100644 --- a/internal/alloyseed/alloyseed.go +++ b/internal/alloyseed/alloyseed.go @@ -36,10 +36,11 @@ const filename = "alloy_seed.json" var savedSeed *Seed var once sync.Once -// Init should be called by an app entrypoint as soon as it can to configure where the unique seed will be stored. -// dir is the directory where we will read and store alloy_seed.json -// If left empty it will default to $APPDATA or /tmp -// A unique agent seed will be generated when this method is first called, and reused for the lifetime of this agent. +// Init should be called by an app entrypoint as soon as it can to configure +// where the unique seed will be stored. dir is the directory where we will +// read and store alloy_seed.json If left empty it will default to $APPDATA or +// /tmp A unique Alloy seed will be generated when this method is first called, +// and reused for the lifetime of this Alloy instance. func Init(dir string, l log.Logger) { if l == nil { l = log.NewNopLogger() diff --git a/internal/static/metrics/cluster/config.go b/internal/static/metrics/cluster/config.go index 6774ac80a5..11393fb5b0 100644 --- a/internal/static/metrics/cluster/config.go +++ b/internal/static/metrics/cluster/config.go @@ -45,7 +45,6 @@ type Config struct { DangerousAllowReadingFiles bool `yaml:"dangerous_allow_reading_files,omitempty"` - // TODO(rfratto): deprecate scraping_service_client in Agent and replace with this. Client client.Config `yaml:"-"` APIEnableGetConfiguration bool `yaml:"-"` } diff --git a/internal/usagestats/reporter.go b/internal/usagestats/reporter.go index 3b4d9d186d..74e4650913 100644 --- a/internal/usagestats/reporter.go +++ b/internal/usagestats/reporter.go @@ -89,8 +89,9 @@ func (rep *Reporter) reportUsage(ctx context.Context, interval time.Time, metric return errs.Err() } -// nextReport compute the next report time based on the interval. -// The interval is based off the creation of the Alloy seed to avoid all agents reporting at the same time. +// nextReport compute the next report time based on the interval. The interval +// is based off the creation of the Alloy seed to avoid all Alloy instances +// reporting at the same time. func nextReport(interval time.Duration, createdAt, now time.Time) time.Time { duration := math.Ceil(float64(now.Sub(createdAt)) / float64(interval)) return createdAt.Add(time.Duration(duration) * interval) diff --git a/internal/util/otel_feature_gate_test.go b/internal/util/otel_feature_gate_test.go index fd8892f961..17b25fec36 100644 --- a/internal/util/otel_feature_gate_test.go +++ b/internal/util/otel_feature_gate_test.go @@ -21,7 +21,7 @@ func Test_FeatureGates(t *testing.T) { return } // Make sure that the feature gate is disabled before touching it. - // There is no point in the Agent enabling a feature gate + // There is no point in Alloy enabling a feature gate // if it's already enabled in the Collector. // This "require" check will fail if the Collector was upgraded and // a feature gate was promoted from alpha to beta. diff --git a/operations/alloy-mixin/dashboards/prometheus.libsonnet b/operations/alloy-mixin/dashboards/prometheus.libsonnet index 52e048183f..e54b28bd08 100644 --- a/operations/alloy-mixin/dashboards/prometheus.libsonnet +++ b/operations/alloy-mixin/dashboards/prometheus.libsonnet @@ -407,7 +407,7 @@ local remoteWritePanels(y_offset) = [ label_values(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) |||), dashboard.newMultiTemplateVariable('component_path', ||| - label_values(agent_wal_samples_appended_total{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id=~"prometheus\\.remote_write\\..*", component_path=~".*"}, component_path) + label_values(prometheus_remote_write_wal_samples_appended_total{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id=~"prometheus\\.remote_write\\..*", component_path=~".*"}, component_path) |||), dashboard.newMultiTemplateVariable('component', ||| label_values(prometheus_remote_write_wal_samples_appended_total{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id=~"prometheus\\.remote_write\\..*"}, component_id) diff --git a/operations/helm/charts/alloy/README.md b/operations/helm/charts/alloy/README.md index 0d28425f1c..a60f277cb3 100644 --- a/operations/helm/charts/alloy/README.md +++ b/operations/helm/charts/alloy/README.md @@ -245,8 +245,8 @@ Alloy is deployed in. The [loki.source.kubernetes][] component may be used to collect logs from containers using the Kubernetes API. This component does not require mounting -the hosts filesystem into the Agent, nor requires additional security contexts -to work correctly. +the hosts filesystem into Alloy, nor requires additional security contexts to +work correctly. [loki.source.kubernetes]: https://grafana.com/docs/alloy/latest/reference/components/loki.source.kubernetes/ diff --git a/operations/helm/charts/alloy/README.md.gotmpl b/operations/helm/charts/alloy/README.md.gotmpl index 8765d8f63d..f871bf21c5 100644 --- a/operations/helm/charts/alloy/README.md.gotmpl +++ b/operations/helm/charts/alloy/README.md.gotmpl @@ -144,8 +144,8 @@ Alloy is deployed in. The [loki.source.kubernetes][] component may be used to collect logs from containers using the Kubernetes API. This component does not require mounting -the hosts filesystem into the Agent, nor requires additional security contexts -to work correctly. +the hosts filesystem into Alloy, nor requires additional security contexts to +work correctly. [loki.source.kubernetes]: https://grafana.com/docs/alloy/latest/reference/components/loki.source.kubernetes/ diff --git a/operations/helm/charts/alloy/ci/clustering-values.yaml b/operations/helm/charts/alloy/ci/clustering-values.yaml index d6a74017b4..4a0c4687ba 100644 --- a/operations/helm/charts/alloy/ci/clustering-values.yaml +++ b/operations/helm/charts/alloy/ci/clustering-values.yaml @@ -1,4 +1,4 @@ -agent: +alloy: clustering: enabled: true diff --git a/operations/helm/charts/alloy/ci/controller-volumes-extra-values.yaml b/operations/helm/charts/alloy/ci/controller-volumes-extra-values.yaml index 3bed05af88..2486c5991a 100644 --- a/operations/helm/charts/alloy/ci/controller-volumes-extra-values.yaml +++ b/operations/helm/charts/alloy/ci/controller-volumes-extra-values.yaml @@ -5,7 +5,7 @@ controller: emptyDir: sizeLimit: 500Mi -agent: +alloy: mounts: extra: - mountPath: /cache diff --git a/operations/helm/charts/alloy/ci/create-deployment-autoscaling-values.yaml b/operations/helm/charts/alloy/ci/create-deployment-autoscaling-values.yaml index 9a0f9ff712..cde871c0d9 100644 --- a/operations/helm/charts/alloy/ci/create-deployment-autoscaling-values.yaml +++ b/operations/helm/charts/alloy/ci/create-deployment-autoscaling-values.yaml @@ -19,7 +19,7 @@ controller: value: 100 periodSeconds: 15 stabilizationWindowSeconds: 80 -agent: +alloy: resources: requests: memory: 100Mi diff --git a/operations/helm/charts/alloy/ci/create-statefulset-autoscaling-values.yaml b/operations/helm/charts/alloy/ci/create-statefulset-autoscaling-values.yaml index eedf5411b3..e8099c59d1 100644 --- a/operations/helm/charts/alloy/ci/create-statefulset-autoscaling-values.yaml +++ b/operations/helm/charts/alloy/ci/create-statefulset-autoscaling-values.yaml @@ -4,7 +4,7 @@ controller: autoscaling: enabled: true enableStatefulSetAutoDeletePVC: true -agent: +alloy: resources: requests: memory: 100Mi diff --git a/operations/helm/charts/alloy/ci/custom-config-values.yaml b/operations/helm/charts/alloy/ci/custom-config-values.yaml index d6bc02163b..ebfce09a08 100644 --- a/operations/helm/charts/alloy/ci/custom-config-values.yaml +++ b/operations/helm/charts/alloy/ci/custom-config-values.yaml @@ -1,4 +1,4 @@ -agent: +alloy: configMap: content: |- logging { diff --git a/operations/helm/charts/alloy/ci/enable-servicemonitor-tls-values.yaml b/operations/helm/charts/alloy/ci/enable-servicemonitor-tls-values.yaml index 03d3559680..26662f3abb 100644 --- a/operations/helm/charts/alloy/ci/enable-servicemonitor-tls-values.yaml +++ b/operations/helm/charts/alloy/ci/enable-servicemonitor-tls-values.yaml @@ -1,5 +1,5 @@ # Test rendering of the chart with the service monitor enabled -agent: +alloy: listenScheme: HTTPS service: enabled: true diff --git a/operations/helm/charts/alloy/ci/envFrom-values.yaml b/operations/helm/charts/alloy/ci/envFrom-values.yaml index 22013a5967..8d901486d7 100644 --- a/operations/helm/charts/alloy/ci/envFrom-values.yaml +++ b/operations/helm/charts/alloy/ci/envFrom-values.yaml @@ -1,5 +1,5 @@ # Specify extra ports for verifying rendering the template works -agent: +alloy: envFrom: - configMapRef: name: special-config diff --git a/operations/helm/charts/alloy/ci/existing-config-values.yaml b/operations/helm/charts/alloy/ci/existing-config-values.yaml index 2490dd15f1..5eeeb42d05 100644 --- a/operations/helm/charts/alloy/ci/existing-config-values.yaml +++ b/operations/helm/charts/alloy/ci/existing-config-values.yaml @@ -1,4 +1,4 @@ -agent: +alloy: configMap: create: false name: existing-config diff --git a/operations/helm/charts/alloy/ci/extra-env-values.yaml b/operations/helm/charts/alloy/ci/extra-env-values.yaml index 0ee66253e1..7d444f1da7 100644 --- a/operations/helm/charts/alloy/ci/extra-env-values.yaml +++ b/operations/helm/charts/alloy/ci/extra-env-values.yaml @@ -1,5 +1,5 @@ # Specify extra ports for verifying rendering the template works -agent: +alloy: extraEnv: - name: GREETING value: "Warm greetings to" diff --git a/operations/helm/charts/alloy/ci/extra-ports-values.yaml b/operations/helm/charts/alloy/ci/extra-ports-values.yaml index 460c5e0f47..d29a0e5d77 100644 --- a/operations/helm/charts/alloy/ci/extra-ports-values.yaml +++ b/operations/helm/charts/alloy/ci/extra-ports-values.yaml @@ -1,5 +1,5 @@ # Specify extra ports for verifying rendering the template works -agent: +alloy: extraPorts: - name: jaeger-thrift port: 14268 diff --git a/operations/helm/charts/alloy/ci/faro-ingress-values.yaml b/operations/helm/charts/alloy/ci/faro-ingress-values.yaml index cc61de1899..3f09d8829d 100644 --- a/operations/helm/charts/alloy/ci/faro-ingress-values.yaml +++ b/operations/helm/charts/alloy/ci/faro-ingress-values.yaml @@ -1,4 +1,4 @@ -agent: +alloy: extraPorts: - name: "faro" port: 12347 diff --git a/operations/helm/charts/alloy/ci/initcontainers-values.yaml b/operations/helm/charts/alloy/ci/initcontainers-values.yaml index 3097aebc62..4c74c931d9 100644 --- a/operations/helm/charts/alloy/ci/initcontainers-values.yaml +++ b/operations/helm/charts/alloy/ci/initcontainers-values.yaml @@ -22,7 +22,7 @@ controller: - name: geoip mountPath: /etc/geoip -agent: +alloy: mounts: extra: - name: geoip diff --git a/operations/helm/charts/alloy/ci/local-image-pullsecrets-values.yaml b/operations/helm/charts/alloy/ci/local-image-pullsecrets-values.yaml index a999d1a0ea..a7a800fb3c 100644 --- a/operations/helm/charts/alloy/ci/local-image-pullsecrets-values.yaml +++ b/operations/helm/charts/alloy/ci/local-image-pullsecrets-values.yaml @@ -1,4 +1,4 @@ -# Test rendering of the chart with the agent image pull secret explicitly set. +# Test rendering of the chart with the image pull secret explicitly set. image: pullSecrets: - name: local-cred diff --git a/operations/helm/charts/alloy/ci/sidecars-values.yaml b/operations/helm/charts/alloy/ci/sidecars-values.yaml index a443c9a949..763c546865 100644 --- a/operations/helm/charts/alloy/ci/sidecars-values.yaml +++ b/operations/helm/charts/alloy/ci/sidecars-values.yaml @@ -22,7 +22,7 @@ controller: - name: geoip mountPath: /etc/geoip -agent: +alloy: mounts: extra: - name: geoip diff --git a/operations/helm/charts/alloy/values.yaml b/operations/helm/charts/alloy/values.yaml index e070d80294..5107e9f896 100644 --- a/operations/helm/charts/alloy/values.yaml +++ b/operations/helm/charts/alloy/values.yaml @@ -23,7 +23,8 @@ crds: create: true ## Various Alloy settings. For backwards compatibility with the grafana-agent -## chart, this field may also be called "agent". +## chart, this field may also be called "agent". Naming this field "agent" is +## deprecated and will be removed in a future release. alloy: configMap: # -- Create a new ConfigMap for the config file. diff --git a/tools/ci/docker-containers b/tools/ci/docker-containers index 05c2a1c1be..8da6ca35bf 100755 --- a/tools/ci/docker-containers +++ b/tools/ci/docker-containers @@ -7,11 +7,6 @@ # from a Drone trigger. set -euxo pipefail -RELEASE_ALLOY_IMAGE=grafana/alloy -DEVELOPMENT_ALLOY_IMAGE=us-docker.pkg.dev/grafanalabs-dev/docker-alloy-dev/alloy - -DEFAULT_ALLOY_IMAGE=${RELEASE_ALLOY_IMAGE} - # Environment variables used throughout this script. These must be set # otherwise bash will fail with an "unbound variable" error because of the `set # -u` flag on the above line. @@ -20,13 +15,9 @@ DEFAULT_ALLOY_IMAGE=${RELEASE_ALLOY_IMAGE} # empty string. export TARGET_CONTAINER=${1:-} export DRONE_TAG=${DRONE_TAG:-} -export DEVELOPMENT=${DEVELOPMENT:-} - -if [ -n "$DEVELOPMENT" ]; then - DEFAULT_ALLOY_IMAGE=${DEVELOPMENT_ALLOY_IMAGE} -fi -export ALLOY_IMAGE=${DEFAULT_ALLOY_IMAGE} +export RELEASE_ALLOY_IMAGE=grafana/alloy +export DEVEL_ALLOY_IMAGE=us-docker.pkg.dev/grafanalabs-dev/docker-alloy-dev/alloy # We need to determine what version to assign to built binaries. If containers # are being built from a Drone tag trigger, we force the version to come from the @@ -67,14 +58,25 @@ case "$TARGET_CONTAINER" in --platform $BUILD_PLATFORMS \ --build-arg RELEASE_BUILD=1 \ --build-arg VERSION="$VERSION" \ - -t "$ALLOY_IMAGE:$TAG_VERSION" \ - -t "$ALLOY_IMAGE:$BRANCH_TAG" \ + -t "$RELEASE_ALLOY_IMAGE:$TAG_VERSION" \ + -t "$RELEASE_ALLOY_IMAGE:$BRANCH_TAG" \ + -f Dockerfile \ + . + ;; + + alloy-devel) + docker buildx build --push \ + --platform $BUILD_PLATFORMS \ + --build-arg RELEASE_BUILD=1 \ + --build-arg VERSION="$VERSION" \ + -t "$DEVEL_ALLOY_IMAGE:$TAG_VERSION" \ + -t "$DEVEL_ALLOY_IMAGE:$BRANCH_TAG" \ -f Dockerfile \ . ;; *) - echo "Usage: $0 alloy" + echo "Usage: $0 alloy|alloy-devel" exit 1 ;; esac diff --git a/tools/ci/docker-containers-windows b/tools/ci/docker-containers-windows index abbad1a501..11e4b177bd 100644 --- a/tools/ci/docker-containers-windows +++ b/tools/ci/docker-containers-windows @@ -22,7 +22,8 @@ export DRONE_BRANCH=${DRONE_BRANCH:-} export DOCKER_LOGIN=${DOCKER_LOGIN:-} export DOCKER_PASSWORD=${DOCKER_PASSWORD:-} -export ALLOY_IMAGE=grafana/alloy +export RELEASE_ALLOY_IMAGE=grafana/alloy +export DEVEL_ALLOY_IMAGE=us-docker.pkg.dev/grafanalabs-dev/docker-alloy-dev/alloy if [ -n "$DRONE_TAG" ]; then VERSION=$DRONE_TAG @@ -54,8 +55,18 @@ fi case "$TARGET_CONTAINER" in alloy) docker build \ - -t "$ALLOY_IMAGE:$VERSION_TAG" \ - -t "$ALLOY_IMAGE:$BRANCH_TAG" \ + -t "$RELEASE_ALLOY_IMAGE:$VERSION_TAG" \ + -t "$RELEASE_ALLOY_IMAGE:$BRANCH_TAG" \ + --build-arg VERSION="$VERSION" \ + --build-arg RELEASE_BUILD=1 \ + -f ./Dockerfile.windows \ + . + ;; + + alloy-devel) + docker build \ + -t "$DEVEL_ALLOY_IMAGE:$VERSION_TAG" \ + -t "$DEVEL_ALLOY_IMAGE:$BRANCH_TAG" \ --build-arg VERSION="$VERSION" \ --build-arg RELEASE_BUILD=1 \ -f ./Dockerfile.windows \ @@ -63,7 +74,7 @@ case "$TARGET_CONTAINER" in ;; *) - echo "Usage: $0 alloy" + echo "Usage: $0 alloy|alloy-devel" exit 1 ;; esac @@ -74,12 +85,17 @@ if [ -n "$DOCKER_LOGIN" ] && [ -n "$DOCKER_PASSWORD" ]; then case "$TARGET_CONTAINER" in alloy) - docker push "$ALLOY_IMAGE:$VERSION_TAG" - docker push "$ALLOY_IMAGE:$BRANCH_TAG" + docker push "$RELEASE_ALLOY_IMAGE:$VERSION_TAG" + docker push "$RELEASE_ALLOY_IMAGE:$BRANCH_TAG" + ;; + + alloy-devel) + docker push "$DEVEL_ALLOY_IMAGE:$VERSION_TAG" + docker push "$DEVEL_ALLOY_IMAGE:$BRANCH_TAG" ;; *) - echo "Usage: $0 alloy" + echo "Usage: $0 alloy|alloy-devel" exit 1 ;; esac diff --git a/tools/release b/tools/release index b252d81e84..07e07bdfd9 100755 --- a/tools/release +++ b/tools/release @@ -3,7 +3,7 @@ # This script should be run from the root of the repository. set -ex -# Zip up all the agent binaries to reduce the download size. DEBs and RPMs +# Zip up all the binaries to reduce the download size. DEBs and RPMs # aren't included to be easier to work with. find dist/ -type f \ -name 'alloy*' -not -name '*.deb' -not -name '*.rpm' \