From ce7a8dda05fd851af0b78d23337e7d50f58a6e5c Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Wed, 27 Mar 2024 08:23:28 -0400 Subject: [PATCH] internal: rename agent references to Alloy (#86) --- CODEOWNERS | 4 +- Dockerfile | 2 +- Dockerfile.windows | 1 + .../reference/components/local.file.md | 2 +- .../components/loki.source.journal.md | 4 +- .../components/prometheus.receive_http.md | 6 +-- .../components/prometheus.relabel.md | 15 +++--- .../components/prometheus.remote_write.md | 14 +++--- .../reference/components/prometheus.scrape.md | 6 +-- .../tutorials/assets/docker-compose.yaml | 2 - .../assets/grafana/dashboards/agent.json | 12 ++--- docs/sources/tutorials/chaining.md | 2 +- .../collecting-prometheus-metrics.md | 4 +- docs/sources/tutorials/filtering-metrics.md | 2 +- internal/alloy/internal/controller/loader.go | 2 +- internal/alloy/internal/controller/metrics.go | 12 ++--- .../controller/node_builtin_component.go | 2 +- internal/alloy/internal/worker/worker_pool.go | 2 +- internal/alloy/logging/logger.go | 2 +- internal/alloy/logging/logger_test.go | 2 +- internal/alloy/tracing/tracing.go | 2 +- internal/alloy/tracing/wrap_tracer.go | 4 +- internal/alloycli/alloycli.go | 2 +- internal/alloycli/cmd_run.go | 6 +-- internal/alloycli/resources_collector.go | 12 ++--- internal/alloyseed/alloyseed.go | 4 +- internal/build/build.go | 7 ++- internal/cmd/integration-tests/utils.go | 2 +- .../component/common/loki/client/client.go | 2 +- .../common/loki/client/queue_client.go | 7 +-- internal/component/local/file/file.go | 2 +- .../component/local/file_match/file_test.go | 16 +++--- .../component/loki/rules/kubernetes/events.go | 4 +- .../loki/rules/kubernetes/events_test.go | 4 +- .../component/loki/rules/kubernetes/types.go | 2 +- .../loki/source/file/decompresser.go | 2 +- .../source/gelf/internal/target/metrics.go | 10 ++-- .../kubernetes_events/event_controller.go | 2 +- .../loki/source/podlogs/controller.go | 2 +- .../source/windowsevent/component_test.go | 2 +- internal/component/loki/write/write.go | 2 +- .../mimir/rules/kubernetes/events.go | 4 +- .../mimir/rules/kubernetes/events_test.go | 4 +- .../component/mimir/rules/kubernetes/types.go | 2 +- internal/component/otelcol/auth/auth.go | 2 +- internal/component/otelcol/config_filter.go | 6 +-- internal/component/otelcol/config_k8s.go | 2 +- .../component/otelcol/connector/connector.go | 2 +- .../component/otelcol/exporter/exporter.go | 2 +- .../exporter/loadbalancing/loadbalancing.go | 2 +- .../loadbalancing/loadbalancing_test.go | 28 +++++------ .../otelcol/exporter/otlp/otlp_test.go | 10 ++-- .../exporter/otlphttp/otlphttp_test.go | 10 ++-- .../component/otelcol/extension/extension.go | 2 +- .../component/otelcol/internal/views/views.go | 2 +- .../processor/attributes/attributes_test.go | 6 +-- .../k8sattributes/k8sattributes_test.go | 4 +- .../component/otelcol/processor/processor.go | 2 +- .../internal/k8snode/config.go | 6 +-- .../resourcedetection/resourcedetection.go | 4 +- .../otelcol/receiver/jaeger/jaeger_test.go | 10 ++-- .../otelcol/receiver/kafka/kafka_test.go | 10 ++-- .../receiver/opencensus/opencensus_test.go | 10 ++-- .../otelcol/receiver/otlp/otlp_test.go | 10 ++-- .../otelcol/receiver/prometheus/prometheus.go | 4 +- .../component/otelcol/receiver/receiver.go | 2 +- .../otelcol/receiver/vcenter/vcenter_test.go | 10 ++-- .../otelcol/receiver/zipkin/zipkin_test.go | 10 ++-- .../prometheus/exporter/cloudwatch/config.go | 12 ++--- .../prometheus/exporter/self/self.go | 2 +- internal/component/prometheus/fanout.go | 4 +- .../prometheus/operator/common/crdmanager.go | 2 +- .../prometheus/receive_http/receive_http.go | 6 +-- .../receive_http/receive_http_test.go | 6 +-- .../component/prometheus/relabel/relabel.go | 12 ++--- .../component/prometheus/scrape/scrape.go | 2 +- .../prometheus/scrape/scrape_test.go | 2 +- .../component/pyroscope/java/asprof/asprof.go | 2 +- .../pyroscope/java/asprof/asprof_test.go | 2 +- internal/component/pyroscope/java/loop.go | 4 +- internal/component/remote/s3/s3.go | 4 +- .../testdata/unsupported.diags | 2 +- .../internal/promtailconvert/validate.go | 2 +- internal/loki/client/client.go | 3 +- internal/mimir/client/client.go | 3 +- internal/service/http/http.go | 6 +-- internal/service/http/http_test.go | 2 +- internal/service/labelstore/service.go | 6 +-- internal/static/agentctl/waltools/walstats.go | 6 +-- internal/static/config/config.go | 2 +- .../config/instrumentation/config_metrics.go | 12 ++--- internal/static/logs/logs.go | 3 +- internal/static/metrics/wal/wal.go | 14 +++--- internal/usagestats/reporter.go | 6 +-- internal/usagestats/reporter_test.go | 8 +-- internal/useragent/useragent.go | 8 +-- internal/useragent/useragent_test.go | 4 +- internal/util/otel_feature_gate_test.go | 4 +- internal/web/ui/package.json | 2 +- internal/web/ui/public/index.html | 2 +- .../web/ui/src/features/layout/Navbar.tsx | 4 +- internal/web/ui/ui.go | 2 +- main.go | 2 +- .../alloy-mixin/alerts/clustering.libsonnet | 2 +- .../alloy-mixin/alerts/controller.libsonnet | 4 +- .../dashboards/cluster-node.libsonnet | 6 +-- .../dashboards/cluster-overview.libsonnet | 4 +- .../dashboards/controller.libsonnet | 50 +++++++++---------- .../dashboards/opentelemetry.libsonnet | 6 +-- .../dashboards/prometheus.libsonnet | 14 +++--- .../dashboards/resources.libsonnet | 26 +++++----- .../alloy/templates/containers/_agent.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/statefulset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/deployment.yaml | 2 +- .../templates/controllers/deployment.yaml | 2 +- .../templates/controllers/statefulset.yaml | 2 +- .../templates/controllers/statefulset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- .../templates/controllers/deployment.yaml | 2 +- .../templates/controllers/daemonset.yaml | 2 +- packaging/deb/alloy.service | 2 +- packaging/rpm/alloy.service | 2 +- 142 files changed, 349 insertions(+), 348 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 4f1541f12d..1b2ed5f90e 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,8 +1,8 @@ # The CODEOWNERS file is used to define ownership of individuals or teams -# outside of the core set of Grafana Agent maintainers. +# outside of the core set of Grafana Alloy maintainers. # # If a directory is not listed here, it is assumed to be owned by the -# @grafana/grafana-agent-maintainers; they are not explicitly listed as +# @grafana/grafana-alloy-maintainers; they are not explicitly listed as # CODEOWNERS as a GitHub project board is used instead for PR tracking, which # helps reduce notification noise of the members of that team. diff --git a/Dockerfile b/Dockerfile index 72dd8d6409..9797ad7d71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,5 +55,5 @@ RUN chown -R $USERNAME:$USERNAME /etc/alloy RUN chown -R $USERNAME:$USERNAME /bin/alloy ENTRYPOINT ["/bin/alloy"] -ENV AGENT_DEPLOY_MODE=docker +ENV ALLOY_DEPLOY_MODE=docker CMD ["run", "/etc/alloy/config.river", "--storage.path=/etc/alloy/data"] diff --git a/Dockerfile.windows b/Dockerfile.windows index 6777948100..3ded8edf5c 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -24,4 +24,5 @@ COPY --from=builder /src/alloy/build/alloy /bin/alloy COPY --from=builder /src/alloy/example-config.river /etc/alloy/config.river ENTRYPOINT ["/bin/alloy"] +ENV ALLOY_DEPLOY_MODE=docker CMD ["run", "/etc/alloy/config.river", "--storage.path=/etc/alloy/data"] diff --git a/docs/sources/reference/components/local.file.md b/docs/sources/reference/components/local.file.md index 69628d9f01..aa82610d44 100644 --- a/docs/sources/reference/components/local.file.md +++ b/docs/sources/reference/components/local.file.md @@ -60,7 +60,7 @@ The read error will be exposed as a log message and in the debug information for ## Debug metrics -* `agent_local_file_timestamp_last_accessed_unix_seconds` (gauge): The timestamp, in Unix seconds, that the file was last successfully accessed. +* `local_file_timestamp_last_accessed_unix_seconds` (gauge): The timestamp, in Unix seconds, that the file was last successfully accessed. ## Example diff --git a/docs/sources/reference/components/loki.source.journal.md b/docs/sources/reference/components/loki.source.journal.md index 3b8b1905c3..8fbc4a7f7e 100644 --- a/docs/sources/reference/components/loki.source.journal.md +++ b/docs/sources/reference/components/loki.source.journal.md @@ -66,8 +66,8 @@ The final internal label name would be `__journal__systemd_unit`, with _two_ und ## Debug Metrics -* `agent_loki_source_journal_target_parsing_errors_total` (counter): Total number of parsing errors while reading journal messages. -* `agent_loki_source_journal_target_lines_total` (counter): Total number of successful journal lines read. +* `loki_source_journal_target_parsing_errors_total` (counter): Total number of parsing errors while reading journal messages. +* `loki_source_journal_target_lines_total` (counter): Total number of successful journal lines read. ## Example diff --git a/docs/sources/reference/components/prometheus.receive_http.md b/docs/sources/reference/components/prometheus.receive_http.md index 9b7d14c3ba..2ffe9804a3 100644 --- a/docs/sources/reference/components/prometheus.receive_http.md +++ b/docs/sources/reference/components/prometheus.receive_http.md @@ -67,8 +67,8 @@ The following are some of the metrics that are exposed when this component is us * `prometheus_receive_http_request_message_bytes` (histogram): Size (in bytes) of messages received in the request. * `prometheus_receive_http_response_message_bytes` (histogram): Size (in bytes) of messages sent in response. * `prometheus_receive_http_tcp_connections` (gauge): Current number of accepted TCP connections. -* `agent_prometheus_fanout_latency` (histogram): Write latency for sending metrics to other components. -* `agent_prometheus_forwarded_samples_total` (counter): Total number of samples sent to downstream components. +* `prometheus_fanout_latency` (histogram): Write latency for sending metrics to other components. +* `prometheus_forwarded_samples_total` (counter): Total number of samples sent to downstream components. ## Example @@ -138,4 +138,4 @@ Connecting some components may not be sensible or components may require further Refer to the linked documentation for more details. {{< /admonition >}} - \ No newline at end of file + diff --git a/docs/sources/reference/components/prometheus.relabel.md b/docs/sources/reference/components/prometheus.relabel.md index 9b471a50e2..90278bddcc 100644 --- a/docs/sources/reference/components/prometheus.relabel.md +++ b/docs/sources/reference/components/prometheus.relabel.md @@ -88,14 +88,13 @@ values. ## Debug metrics - -* `agent_prometheus_relabel_metrics_processed` (counter): Total number of metrics processed. -* `agent_prometheus_relabel_metrics_written` (counter): Total number of metrics written. -* `agent_prometheus_relabel_cache_misses` (counter): Total number of cache misses. -* `agent_prometheus_relabel_cache_hits` (counter): Total number of cache hits. -* `agent_prometheus_relabel_cache_size` (gauge): Total size of relabel cache. -* `agent_prometheus_fanout_latency` (histogram): Write latency for sending to direct and indirect components. -* `agent_prometheus_forwarded_samples_total` (counter): Total number of samples sent to downstream components. +* `prometheus_relabel_metrics_processed` (counter): Total number of metrics processed. +* `prometheus_relabel_metrics_written` (counter): Total number of metrics written. +* `prometheus_relabel_cache_misses` (counter): Total number of cache misses. +* `prometheus_relabel_cache_hits` (counter): Total number of cache hits. +* `prometheus_relabel_cache_size` (gauge): Total size of relabel cache. +* `prometheus_fanout_latency` (histogram): Write latency for sending to direct and indirect components. +* `prometheus_forwarded_samples_total` (counter): Total number of samples sent to downstream components. ## Example diff --git a/docs/sources/reference/components/prometheus.remote_write.md b/docs/sources/reference/components/prometheus.remote_write.md index 3084aae1d1..5716fe2b97 100644 --- a/docs/sources/reference/components/prometheus.remote_write.md +++ b/docs/sources/reference/components/prometheus.remote_write.md @@ -262,19 +262,19 @@ information. ## Debug metrics -* `agent_wal_storage_active_series` (gauge): Current number of active series +* `prometheus_remote_write_wal_storage_active_series` (gauge): Current number of active series being tracked by the WAL. -* `agent_wal_storage_deleted_series` (gauge): Current number of series marked +* `prometheus_remote_write_wal_storage_deleted_series` (gauge): Current number of series marked for deletion from memory. -* `agent_wal_out_of_order_samples_total` (counter): Total number of out of +* `prometheus_remote_write_wal_out_of_order_samples_total` (counter): Total number of out of order samples ingestion failed attempts. -* `agent_wal_storage_created_series_total` (counter): Total number of created +* `prometheus_remote_write_wal_storage_created_series_total` (counter): Total number of created series appended to the WAL. -* `agent_wal_storage_removed_series_total` (counter): Total number of series +* `prometheus_remote_write_wal_storage_removed_series_total` (counter): Total number of series removed from the WAL. -* `agent_wal_samples_appended_total` (counter): Total number of samples +* `prometheus_remote_write_wal_samples_appended_total` (counter): Total number of samples appended to the WAL. -* `agent_wal_exemplars_appended_total` (counter): Total number of exemplars +* `prometheus_remote_write_wal_exemplars_appended_total` (counter): Total number of exemplars appended to the WAL. * `prometheus_remote_storage_samples_total` (counter): Total number of samples sent to remote storage. diff --git a/docs/sources/reference/components/prometheus.scrape.md b/docs/sources/reference/components/prometheus.scrape.md index 533e07e475..2bb750a214 100644 --- a/docs/sources/reference/components/prometheus.scrape.md +++ b/docs/sources/reference/components/prometheus.scrape.md @@ -179,9 +179,9 @@ scrape job on the component's debug endpoint. ## Debug metrics -* `agent_prometheus_fanout_latency` (histogram): Write latency for sending to direct and indirect components. -* `agent_prometheus_scrape_targets_gauge` (gauge): Number of targets this component is configured to scrape. -* `agent_prometheus_forwarded_samples_total` (counter): Total number of samples sent to downstream components. +* `prometheus_fanout_latency` (histogram): Write latency for sending to direct and indirect components. +* `prometheus_scrape_targets_gauge` (gauge): Number of targets this component is configured to scrape. +* `prometheus_forwarded_samples_total` (counter): Total number of samples sent to downstream components. ## Scraping behavior diff --git a/docs/sources/tutorials/assets/docker-compose.yaml b/docs/sources/tutorials/assets/docker-compose.yaml index 7775983f2b..1346a0861f 100644 --- a/docs/sources/tutorials/assets/docker-compose.yaml +++ b/docs/sources/tutorials/assets/docker-compose.yaml @@ -16,8 +16,6 @@ services: - 12345:12345 volumes: - ./flow_configs:/etc/agent-config - environment: - AGENT_MODE: "flow" entrypoint: - /bin/grafana-agent - run diff --git a/docs/sources/tutorials/assets/grafana/dashboards/agent.json b/docs/sources/tutorials/assets/grafana/dashboards/agent.json index 768fccb011..59afe87230 100644 --- a/docs/sources/tutorials/assets/grafana/dashboards/agent.json +++ b/docs/sources/tutorials/assets/grafana/dashboards/agent.json @@ -139,7 +139,7 @@ ], "targets": [ { - "expr": "count by (pod, container, version) (agent_build_info{cluster=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\"})", + "expr": "count by (pod, container, version) (alloy_build_info{cluster=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\"})", "format": "table", "instant": true, "intervalFactor": 2, @@ -578,7 +578,7 @@ "steppedLine": false, "targets": [ { - "expr": "sum by (job, instance_group_name) (rate(agent_wal_samples_appended_total{cluster=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\"}[5m]))", + "expr": "sum by (job, instance_group_name) (rate(prometheus_remote_write_wal_samples_appended_total{cluster=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\"}[5m]))", "format": "time_series", "intervalFactor": 2, "legendFormat": "{{job}} {{instance_group_name}}", @@ -666,7 +666,7 @@ "multi": true, "name": "cluster", "options": [ ], - "query": "label_values(agent_build_info, cluster)", + "query": "label_values(alloy_build_info, cluster)", "refresh": 1, "regex": "", "sort": 2, @@ -690,7 +690,7 @@ "multi": true, "name": "namespace", "options": [ ], - "query": "label_values(agent_build_info, namespace)", + "query": "label_values(alloy_build_info, namespace)", "refresh": 1, "regex": "", "sort": 2, @@ -714,7 +714,7 @@ "multi": true, "name": "container", "options": [ ], - "query": "label_values(agent_build_info, container)", + "query": "label_values(alloy_build_info, container)", "refresh": 1, "regex": "", "sort": 2, @@ -738,7 +738,7 @@ "multi": true, "name": "pod", "options": [ ], - "query": "label_values(agent_build_info{container=~\"$container\"}, pod)", + "query": "label_values(alloy_build_info{container=~\"$container\"}, pod)", "refresh": 1, "regex": "", "sort": 2, diff --git a/docs/sources/tutorials/chaining.md b/docs/sources/tutorials/chaining.md index dfa3502b30..638322c655 100644 --- a/docs/sources/tutorials/chaining.md +++ b/docs/sources/tutorials/chaining.md @@ -81,5 +81,5 @@ In `multiple-input.alloy` add a new `prometheus.relabel` component that adds a ` [multiple-inputs.alloy]: ../assets/flow_configs/multiple-inputs.alloy [Filtering metrics]: ../filtering-metrics/ -[Grafana]: http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22agent_build_info%7B%7D%22%7D%5D +[Grafana]: http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22alloy_build_info%7B%7D%22%7D%5D [node_exporter]: http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22node_cpu_seconds_total%22%7D%5D diff --git a/docs/sources/tutorials/collecting-prometheus-metrics.md b/docs/sources/tutorials/collecting-prometheus-metrics.md index 254d0b91a1..4d6fdb91c9 100644 --- a/docs/sources/tutorials/collecting-prometheus-metrics.md +++ b/docs/sources/tutorials/collecting-prometheus-metrics.md @@ -31,7 +31,7 @@ The `runt.sh` script does: Allow {{< param "PRODUCT_NAME" >}} to run for two minutes, then navigate to [Grafana][]. -![Dashboard showing agent_build_info metrics](/media/docs/agent/screenshot-grafana-agent-collect-metrics-build-info.png) +![Dashboard showing alloy_build_info metrics](/media/docs/agent/screenshot-grafana-agent-collect-metrics-build-info.png) This example scrapes the {{< param "PRODUCT_NAME" >}} `http://localhost:12345/metrics` endpoint and pushes those metrics to the Mimir instance. @@ -92,7 +92,7 @@ To try out {{< param "PRODUCT_NAME" >}} without using Docker: [Docker]: https://www.docker.com/products/docker-desktop -[Grafana]: http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22agent_build_info%7B%7D%22%7D%5D +[Grafana]: http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22alloy_build_info%7B%7D%22%7D%5D [prometheus.scrape]: ../../reference/components/prometheus.scrape/ [attribute]: ../../concepts/config-language/#attributes [argument]: ../../concepts/components/ diff --git a/docs/sources/tutorials/filtering-metrics.md b/docs/sources/tutorials/filtering-metrics.md index 5d9e72e86f..1afe57ae1a 100644 --- a/docs/sources/tutorials/filtering-metrics.md +++ b/docs/sources/tutorials/filtering-metrics.md @@ -49,7 +49,7 @@ Open the `relabel.alloy` file that was downloaded and change the name of the ser ![Updated dashboard showing api_server_v2](/media/docs/agent/screenshot-grafana-agent-filtering-metrics-transition.png) [Docker]: https://www.docker.com/products/docker-desktop -[Grafana]: http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22agent_build_info%7B%7D%22%7D%5D +[Grafana]: http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22alloy_build_info%7B%7D%22%7D%5D [relabel.alloy]: ../assets/flow_configs/relabel.alloy/ [prometheus.relabel]: ../../reference/components/prometheus.relabel/ [Collect Prometheus metrics]: ../collecting-prometheus-metrics diff --git a/internal/alloy/internal/controller/loader.go b/internal/alloy/internal/controller/loader.go index ea6718b7c8..c1ee5005a8 100644 --- a/internal/alloy/internal/controller/loader.go +++ b/internal/alloy/internal/controller/loader.go @@ -743,7 +743,7 @@ func (l *Loader) EvaluateDependants(ctx context.Context, updatedNodes []*QueuedN }) if err != nil { level.Error(l.log).Log( - "msg", "failed to submit node for evaluation - the agent is likely overloaded "+ + "msg", "failed to submit node for evaluation - Alloy is likely overloaded "+ "and cannot keep up with evaluating components - will retry", "err", err, "node_id", n.NodeID(), diff --git a/internal/alloy/internal/controller/metrics.go b/internal/alloy/internal/controller/metrics.go index e60d8a51e3..72cc5f5bae 100644 --- a/internal/alloy/internal/controller/metrics.go +++ b/internal/alloy/internal/controller/metrics.go @@ -29,14 +29,14 @@ func newControllerMetrics(id string) *controllerMetrics { evaluationTimesBuckets := []float64{.005, .025, .1, .5, 1, 5, 10, 30, 60, 120, 300, 600} cm.controllerEvaluation = prometheus.NewGauge(prometheus.GaugeOpts{ - Name: "agent_component_controller_evaluating", + Name: "alloy_component_controller_evaluating", Help: "Tracks if the controller is currently in the middle of a graph evaluation", ConstLabels: map[string]string{"controller_id": id}, }) cm.componentEvaluationTime = prometheus.NewHistogram( prometheus.HistogramOpts{ - Name: "agent_component_evaluation_seconds", + Name: "alloy_component_evaluation_seconds", Help: "Time spent performing component evaluation", ConstLabels: map[string]string{"controller_id": id}, Buckets: evaluationTimesBuckets, @@ -47,7 +47,7 @@ func newControllerMetrics(id string) *controllerMetrics { ) cm.dependenciesWaitTime = prometheus.NewHistogram( prometheus.HistogramOpts{ - Name: "agent_component_dependencies_wait_seconds", + Name: "alloy_component_dependencies_wait_seconds", Help: "Time spent by components waiting to be evaluated after their dependency is updated.", ConstLabels: map[string]string{"controller_id": id}, Buckets: evaluationTimesBuckets, @@ -58,13 +58,13 @@ func newControllerMetrics(id string) *controllerMetrics { ) cm.evaluationQueueSize = prometheus.NewGauge(prometheus.GaugeOpts{ - Name: "agent_component_evaluation_queue_size", + Name: "alloy_component_evaluation_queue_size", Help: "Tracks the number of components waiting to be evaluated in the worker pool", ConstLabels: map[string]string{"controller_id": id}, }) cm.slowComponentEvaluationTime = prometheus.NewCounterVec(prometheus.CounterOpts{ - Name: "agent_component_evaluation_slow_seconds", + Name: "alloy_component_evaluation_slow_seconds", Help: fmt.Sprintf("Number of seconds spent evaluating components that take longer than %v to evaluate", cm.slowComponentThreshold), ConstLabels: map[string]string{"controller_id": id}, }, []string{"component_id"}) @@ -104,7 +104,7 @@ func newControllerCollector(l *Loader, id string) *controllerCollector { return &controllerCollector{ l: l, runningComponentsTotal: prometheus.NewDesc( - "agent_component_controller_running_components", + "alloy_component_controller_running_components", "Total number of running components.", []string{"health_type"}, map[string]string{"controller_id": id}, diff --git a/internal/alloy/internal/controller/node_builtin_component.go b/internal/alloy/internal/controller/node_builtin_component.go index aadc9140e5..a1e71d7515 100644 --- a/internal/alloy/internal/controller/node_builtin_component.go +++ b/internal/alloy/internal/controller/node_builtin_component.go @@ -69,7 +69,7 @@ type ComponentGlobals struct { MinStability featuregate.Stability // Minimum allowed stability level for features OnBlockNodeUpdate func(cn BlockNode) // Informs controller that we need to reevaluate OnExportsChange func(exports map[string]any) // Invoked when the managed component updated its exports - Registerer prometheus.Registerer // Registerer for serving agent and component metrics + Registerer prometheus.Registerer // Registerer for serving Alloy and component metrics ControllerID string // ID of controller. NewModuleController func(id string) ModuleController // Func to generate a module controller. GetServiceData func(name string) (interface{}, error) // Get data for a service. diff --git a/internal/alloy/internal/worker/worker_pool.go b/internal/alloy/internal/worker/worker_pool.go index bcd6844758..ee9c27c0c3 100644 --- a/internal/alloy/internal/worker/worker_pool.go +++ b/internal/alloy/internal/worker/worker_pool.go @@ -168,7 +168,7 @@ func (w *workQueue) emitNextTask() { // Remove the task from waiting and add it to running set. // NOTE: Even though we remove an element from the middle of a collection, we use a slice instead of a linked list. - // This code is NOT identified as a performance hot spot and given that in large agents we observe max number of + // This code is NOT identified as a performance hot spot and given that in large Alloy instances we observe max number of // tasks queued to be ~10, the slice is actually faster because it does not allocate memory. See BenchmarkQueue. w.waitingOrder = append(w.waitingOrder[:index], w.waitingOrder[index+1:]...) task = w.waiting[key] diff --git a/internal/alloy/logging/logger.go b/internal/alloy/logging/logger.go index c4d798424a..b5b9aa8ba9 100644 --- a/internal/alloy/logging/logger.go +++ b/internal/alloy/logging/logger.go @@ -175,7 +175,7 @@ func (fw *lokiWriter) Write(p []byte) (int, error) { select { case receiver.Chan() <- loki.Entry{ - Labels: model.LabelSet{"component": "agent"}, + Labels: model.LabelSet{"component": "alloy"}, Entry: logproto.Entry{ Timestamp: time.Now(), Line: string(p), diff --git a/internal/alloy/logging/logger_test.go b/internal/alloy/logging/logger_test.go index 7d8df9ebb5..8068011075 100644 --- a/internal/alloy/logging/logger_test.go +++ b/internal/alloy/logging/logger_test.go @@ -21,7 +21,7 @@ import ( $ go test -count=1 -benchmem ./internal/alloy/logging -run ^$ -bench BenchmarkLogging_ goos: darwin goarch: arm64 -pkg: github.com/grafana/agent/internal/alloy/logging +pkg: github.com/grafana/alloy/internal/alloy/logging BenchmarkLogging_NoLevel_Prints-8 722358 1524 ns/op 368 B/op 11 allocs/op BenchmarkLogging_NoLevel_Drops-8 47103154 25.59 ns/op 8 B/op 0 allocs/op BenchmarkLogging_GoKitLevel_Drops_Sprintf-8 3585387 332.1 ns/op 320 B/op 8 allocs/op diff --git a/internal/alloy/tracing/tracing.go b/internal/alloy/tracing/tracing.go index d8a0fa3763..49464f8209 100644 --- a/internal/alloy/tracing/tracing.go +++ b/internal/alloy/tracing/tracing.go @@ -18,7 +18,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -const serviceName = "grafana-agent" +const serviceName = "alloy" // Defaults for all Options structs. var ( diff --git a/internal/alloy/tracing/wrap_tracer.go b/internal/alloy/tracing/wrap_tracer.go index 5f166d874a..a10f26eb85 100644 --- a/internal/alloy/tracing/wrap_tracer.go +++ b/internal/alloy/tracing/wrap_tracer.go @@ -10,8 +10,8 @@ import ( ) var ( - componentIDAttributeKey = "grafana_agent.component_id" - controllerIDAttributeKey = "grafana_agent.controller_id" + componentIDAttributeKey = "alloy.component_id" + controllerIDAttributeKey = "alloy.controller_id" ) // WrapTracer returns a new trace.TracerProvider which will inject the provided diff --git a/internal/alloycli/alloycli.go b/internal/alloycli/alloycli.go index 9155895c6a..11781474ca 100644 --- a/internal/alloycli/alloycli.go +++ b/internal/alloycli/alloycli.go @@ -15,7 +15,7 @@ func Run() { var cmd = &cobra.Command{ Use: fmt.Sprintf("%s [global options] ", os.Args[0]), Short: "Grafana Alloy", - Version: build.Print("agent"), + Version: build.Print("alloy"), RunE: func(cmd *cobra.Command, args []string) error { return cmd.Usage() diff --git a/internal/alloycli/cmd_run.go b/internal/alloycli/cmd_run.go index 61df9964a0..3092241675 100644 --- a/internal/alloycli/cmd_run.go +++ b/internal/alloycli/cmd_run.go @@ -49,9 +49,9 @@ import ( func runCommand() *cobra.Command { r := &alloyRun{ - inMemoryAddr: "agent.internal:12345", + inMemoryAddr: "alloy.internal:12345", httpListenAddr: "127.0.0.1:12345", - storagePath: "data-agent/", + storagePath: "data-alloy/", minStability: featuregate.StabilityStable, uiPrefix: "/", disableReporting: false, @@ -205,7 +205,7 @@ func (fr *alloyRun) Run(configPath string) error { // TODO(rfratto): many of the dependencies we import register global metrics, // even when their code isn't being used. To reduce the number of series - // generated by the agent, we should switch to a custom registry. + // generated by Alloy, we should switch to a custom registry. // // Before doing this, we need to ensure that anything using the default // registry that we want to keep can be given a custom registry so desired diff --git a/internal/alloycli/resources_collector.go b/internal/alloycli/resources_collector.go index 02336330a8..26c53ef4b7 100644 --- a/internal/alloycli/resources_collector.go +++ b/internal/alloycli/resources_collector.go @@ -33,37 +33,37 @@ func newResourcesCollector(l log.Logger) *resourcesCollector { log: l, processStartTime: prometheus.NewDesc( - "agent_resources_process_start_time_seconds", + "alloy_resources_process_start_time_seconds", "Start time of the process since Unix epoch in seconds.", nil, nil, ), cpuTotal: prometheus.NewDesc( - "agent_resources_process_cpu_seconds_total", + "alloy_resources_process_cpu_seconds_total", "Total user and system CPU time spent in seconds.", nil, nil, ), rssMemory: prometheus.NewDesc( - "agent_resources_process_resident_memory_bytes", + "alloy_resources_process_resident_memory_bytes", "Current resident memory size in bytes.", nil, nil, ), virtMemory: prometheus.NewDesc( - "agent_resources_process_virtual_memory_bytes", + "alloy_resources_process_virtual_memory_bytes", "Current virtual memory size in bytes.", nil, nil, ), rxBytes: prometheus.NewDesc( - "agent_resources_machine_rx_bytes_total", + "alloy_resources_machine_rx_bytes_total", "Total bytes, host-wide, received across all network interfaces.", nil, nil, ), txBytes: prometheus.NewDesc( - "agent_resources_machine_tx_bytes_total", + "alloy_resources_machine_tx_bytes_total", "Total bytes, host-wide, sent across all given network interface.", nil, nil, ), diff --git a/internal/alloyseed/alloyseed.go b/internal/alloyseed/alloyseed.go index 4eba022858..580a3ecbe2 100644 --- a/internal/alloyseed/alloyseed.go +++ b/internal/alloyseed/alloyseed.go @@ -15,7 +15,7 @@ import ( "github.com/prometheus/common/version" ) -// Seed identifies a unique agent. +// Seed identifies a unique Alloy instance. type Seed struct { UID string `json:"UID"` CreatedAt time.Time `json:"created_at"` @@ -37,7 +37,7 @@ 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 agent_seed.json +// 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. func Init(dir string, l log.Logger) { diff --git a/internal/build/build.go b/internal/build/build.go index 43201285c4..5e3e8171f0 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -8,10 +8,9 @@ import ( "github.com/prometheus/common/version" ) -// Version information passed to Prometheus version package. -// Package path as used by linker changes based on vendoring being used or not, -// so it's easier just to use stable Agent path, and pass it to -// Prometheus in the code. +// Version information passed to Prometheus version package. Package path as +// used by linker changes based on vendoring being used or not, so it's easier +// just to use stable Alloy path, and pass it to Prometheus in the code. var ( Version string Revision string diff --git a/internal/cmd/integration-tests/utils.go b/internal/cmd/integration-tests/utils.go index baeeccb980..611894898d 100644 --- a/internal/cmd/integration-tests/utils.go +++ b/internal/cmd/integration-tests/utils.go @@ -85,7 +85,7 @@ func runSingleTest(testDir string, port int) { } } - err = os.RemoveAll(filepath.Join(testDir, "data-agent")) + err = os.RemoveAll(filepath.Join(testDir, "data-alloy")) if err != nil { panic(err) } diff --git a/internal/component/common/loki/client/client.go b/internal/component/common/loki/client/client.go index c61225f6a6..0ca4fd3702 100644 --- a/internal/component/common/loki/client/client.go +++ b/internal/component/common/loki/client/client.go @@ -202,7 +202,7 @@ func newClient(metrics *Metrics, cfg Config, maxStreams, maxLineSize int, maxLin return nil, err } - c.client, err = config.NewClientFromConfig(cfg.Client, "GrafanaAgent", config.WithHTTP2Disabled()) + c.client, err = config.NewClientFromConfig(cfg.Client, useragent.ProductName, config.WithHTTP2Disabled()) if err != nil { return nil, err } diff --git a/internal/component/common/loki/client/queue_client.go b/internal/component/common/loki/client/queue_client.go index 0050406bb8..bc5cb125c6 100644 --- a/internal/component/common/loki/client/queue_client.go +++ b/internal/component/common/loki/client/queue_client.go @@ -14,7 +14,8 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" - agentWal "github.com/grafana/alloy/internal/component/common/loki/wal" + alloyWal "github.com/grafana/alloy/internal/component/common/loki/wal" + "github.com/grafana/alloy/internal/useragent" "github.com/grafana/dskit/backoff" "github.com/prometheus/common/config" "github.com/prometheus/common/model" @@ -28,7 +29,7 @@ import ( // StoppableWriteTo is a mixing of the WAL's WriteTo interface, that is Stoppable as well. type StoppableWriteTo interface { - agentWal.WriteTo + alloyWal.WriteTo Stop() StopNow() } @@ -224,7 +225,7 @@ func newQueueClient(metrics *Metrics, qcMetrics *QueueClientMetrics, cfg Config, return nil, err } - c.client, err = config.NewClientFromConfig(cfg.Client, "GrafanaAgent", config.WithHTTP2Disabled()) + c.client, err = config.NewClientFromConfig(cfg.Client, useragent.ProductName, config.WithHTTP2Disabled()) if err != nil { return nil, err } diff --git a/internal/component/local/file/file.go b/internal/component/local/file/file.go index 36cb9c7d50..193f7a2791 100644 --- a/internal/component/local/file/file.go +++ b/internal/component/local/file/file.go @@ -99,7 +99,7 @@ func New(o component.Options, args Arguments) (*Component, error) { reloadCh: make(chan struct{}, 1), lastAccessed: prometheus.NewGauge(prometheus.GaugeOpts{ - Name: "agent_local_file_timestamp_last_accessed_unix_seconds", + Name: "local_file_timestamp_last_accessed_unix_seconds", Help: "The last successful access in unix seconds", }), } diff --git a/internal/component/local/file_match/file_test.go b/internal/component/local/file_match/file_test.go index 17839cf005..bec538ce2f 100644 --- a/internal/component/local/file_match/file_test.go +++ b/internal/component/local/file_match/file_test.go @@ -21,7 +21,7 @@ import ( ) func TestFile(t *testing.T) { - dir := path.Join(os.TempDir(), "agent_testing", "t1") + dir := path.Join(os.TempDir(), "alloy_testing", "t1") err := os.MkdirAll(dir, 0755) require.NoError(t, err) writeFile(t, dir, "t1.txt") @@ -42,7 +42,7 @@ func TestFile(t *testing.T) { } func TestDirectoryFile(t *testing.T) { - dir := path.Join(os.TempDir(), "agent_testing", "t1") + dir := path.Join(os.TempDir(), "alloy_testing", "t1") subdir := path.Join(dir, "subdir") err := os.MkdirAll(subdir, 0755) require.NoError(t, err) @@ -64,7 +64,7 @@ func TestDirectoryFile(t *testing.T) { } func TestAddingFile(t *testing.T) { - dir := path.Join(os.TempDir(), "agent_testing", "t2") + dir := path.Join(os.TempDir(), "alloy_testing", "t2") err := os.MkdirAll(dir, 0755) require.NoError(t, err) writeFile(t, dir, "t1.txt") @@ -88,7 +88,7 @@ func TestAddingFile(t *testing.T) { } func TestAddingFileInSubDir(t *testing.T) { - dir := path.Join(os.TempDir(), "agent_testing", "t3") + dir := path.Join(os.TempDir(), "alloy_testing", "t3") os.MkdirAll(dir, 0755) writeFile(t, dir, "t1.txt") t.Cleanup(func() { @@ -117,7 +117,7 @@ func TestAddingFileInSubDir(t *testing.T) { } func TestAddingFileInAnExcludedSubDir(t *testing.T) { - dir := path.Join(os.TempDir(), "agent_testing", "t3") + dir := path.Join(os.TempDir(), "alloy_testing", "t3") os.MkdirAll(dir, 0755) writeFile(t, dir, "t1.txt") t.Cleanup(func() { @@ -154,7 +154,7 @@ func TestAddingFileInAnExcludedSubDir(t *testing.T) { } func TestAddingRemovingFileInSubDir(t *testing.T) { - dir := path.Join(os.TempDir(), "agent_testing", "t3") + dir := path.Join(os.TempDir(), "alloy_testing", "t3") os.MkdirAll(dir, 0755) writeFile(t, dir, "t1.txt") t.Cleanup(func() { @@ -191,7 +191,7 @@ func TestAddingRemovingFileInSubDir(t *testing.T) { } func TestExclude(t *testing.T) { - dir := path.Join(os.TempDir(), "agent_testing", "t3") + dir := path.Join(os.TempDir(), "alloy_testing", "t3") os.MkdirAll(dir, 0755) writeFile(t, dir, "t1.txt") t.Cleanup(func() { @@ -215,7 +215,7 @@ func TestExclude(t *testing.T) { } func TestMultiLabels(t *testing.T) { - dir := path.Join(os.TempDir(), "agent_testing", "t3") + dir := path.Join(os.TempDir(), "alloy_testing", "t3") os.MkdirAll(dir, 0755) writeFile(t, dir, "t1.txt") t.Cleanup(func() { diff --git a/internal/component/loki/rules/kubernetes/events.go b/internal/component/loki/rules/kubernetes/events.go index 6b7cd29a95..453a3e290d 100644 --- a/internal/component/loki/rules/kubernetes/events.go +++ b/internal/component/loki/rules/kubernetes/events.go @@ -195,13 +195,13 @@ func (c *Component) applyChanges(ctx context.Context, namespace string, diffs [] // lokiNamespaceForRuleCRD returns the namespace that the rule CRD should be // stored in loki. This function, along with isManagedNamespace, is used to -// determine if a rule CRD is managed by the agent. +// determine if a rule CRD is managed by Alloy. func lokiNamespaceForRuleCRD(prefix string, pr *promv1.PrometheusRule) string { // Set to - to separate, loki doesn't support prefixpath like mimir ruler does return fmt.Sprintf("%s-%s-%s-%s", prefix, pr.Namespace, pr.Name, pr.UID) } -// isManagedLokiNamespace returns true if the namespace is managed by the agent. +// isManagedLokiNamespace returns true if the namespace is managed by Alloy. // Unmanaged namespaces are left as is by the operator. func isManagedLokiNamespace(prefix, namespace string) bool { prefixPart := regexp.QuoteMeta(prefix) diff --git a/internal/component/loki/rules/kubernetes/events_test.go b/internal/component/loki/rules/kubernetes/events_test.go index 62f1b4f444..cdd310b0da 100644 --- a/internal/component/loki/rules/kubernetes/events_test.go +++ b/internal/component/loki/rules/kubernetes/events_test.go @@ -133,7 +133,7 @@ func TestEventLoop(t *testing.T) { ruleLister: ruleLister, ruleSelector: labels.Everything(), lokiClient: newFakeLokiClient(), - args: Arguments{LokiNameSpacePrefix: "agent"}, + args: Arguments{LokiNameSpacePrefix: "alloy"}, metrics: newMetrics(), } eventHandler := kubernetes.NewQueuedEventHandler(component.log, component.queue) @@ -168,7 +168,7 @@ func TestEventLoop(t *testing.T) { require.Eventually(t, func() bool { allRules, err := component.lokiClient.ListRules(ctx, "") require.NoError(t, err) - rules := allRules[lokiNamespaceForRuleCRD("agent", rule)][0].Rules + rules := allRules[lokiNamespaceForRuleCRD("alloy", rule)][0].Rules return len(rules) == 2 }, time.Second, 10*time.Millisecond) component.queue.AddRateLimited(kubernetes.Event{Typ: eventTypeSyncLoki}) diff --git a/internal/component/loki/rules/kubernetes/types.go b/internal/component/loki/rules/kubernetes/types.go index 89cdeb90cc..8bba8a994a 100644 --- a/internal/component/loki/rules/kubernetes/types.go +++ b/internal/component/loki/rules/kubernetes/types.go @@ -22,7 +22,7 @@ type Arguments struct { var DefaultArguments = Arguments{ SyncInterval: 30 * time.Second, - LokiNameSpacePrefix: "agent", + LokiNameSpacePrefix: "alloy", HTTPClientConfig: config.DefaultHTTPClientConfig, } diff --git a/internal/component/loki/source/file/decompresser.go b/internal/component/loki/source/file/decompresser.go index 14fb680427..32d8925ca3 100644 --- a/internal/component/loki/source/file/decompresser.go +++ b/internal/component/loki/source/file/decompresser.go @@ -239,7 +239,7 @@ func (d *decompressor) readLines() { if err != nil { level.Debug(d.logger).Log("msg", "failed to convert encoding", "error", err) d.metrics.encodingFailures.WithLabelValues(d.path).Inc() - finalText = fmt.Sprintf("the requested encoding conversion for this line failed in Grafana Agent: %s", err.Error()) + finalText = fmt.Sprintf("the requested encoding conversion for this line failed in Grafana Alloy: %s", err.Error()) } } else { finalText = text diff --git a/internal/component/loki/source/gelf/internal/target/metrics.go b/internal/component/loki/source/gelf/internal/target/metrics.go index d984380dc0..4bfea06f5e 100644 --- a/internal/component/loki/source/gelf/internal/target/metrics.go +++ b/internal/component/loki/source/gelf/internal/target/metrics.go @@ -21,14 +21,12 @@ func NewMetrics(reg prometheus.Registerer) *Metrics { m.reg = reg m.gelfEntries = prometheus.NewCounter(prometheus.CounterOpts{ - Namespace: "agent", - Name: "loki_source_gelf_target_entries_total", - Help: "Total number of successful entries sent to the gelf target", + Name: "loki_source_gelf_target_entries_total", + Help: "Total number of successful entries sent to the gelf target", }) m.gelfErrors = prometheus.NewCounter(prometheus.CounterOpts{ - Namespace: "agent", - Name: "loki_source_gelf_target_parsing_errors_total", - Help: "Total number of parsing errors while receiving gelf messages", + Name: "loki_source_gelf_target_parsing_errors_total", + Help: "Total number of parsing errors while receiving gelf messages", }) if reg != nil { diff --git a/internal/component/loki/source/kubernetes_events/event_controller.go b/internal/component/loki/source/kubernetes_events/event_controller.go index 623a1f783d..6c0bba10f6 100644 --- a/internal/component/loki/source/kubernetes_events/event_controller.go +++ b/internal/component/loki/source/kubernetes_events/event_controller.go @@ -140,7 +140,7 @@ func (ctrl *eventController) configureInformers(ctx context.Context, informers c if err != nil { if errors.Is(informerCtx.Err(), context.DeadlineExceeded) { // Check the context to prevent GetInformer returning a fake timeout return fmt.Errorf("timeout exceeded while configuring informers. Check the connection"+ - " to the Kubernetes API is stable and that the Agent has appropriate RBAC permissions for %v", ty) + " to the Kubernetes API is stable and that Alloy has appropriate RBAC permissions for %v", ty) } return err } diff --git a/internal/component/loki/source/podlogs/controller.go b/internal/component/loki/source/podlogs/controller.go index b126673852..bbdfe76afe 100644 --- a/internal/component/loki/source/podlogs/controller.go +++ b/internal/component/loki/source/podlogs/controller.go @@ -175,7 +175,7 @@ func (ctrl *controller) configureInformers(ctx context.Context, informers cache. if err != nil { if errors.Is(informerCtx.Err(), context.DeadlineExceeded) { // Check the context to prevent GetInformer returning a fake timeout return fmt.Errorf("Timeout exceeded while configuring informers. Check the connection"+ - " to the Kubernetes API is stable and that the Agent has appropriate RBAC permissions for %v", ty) + " to the Kubernetes API is stable and that Alloy has appropriate RBAC permissions for %v", ty) } return err diff --git a/internal/component/loki/source/windowsevent/component_test.go b/internal/component/loki/source/windowsevent/component_test.go index ebd35bab57..ad9452b259 100644 --- a/internal/component/loki/source/windowsevent/component_test.go +++ b/internal/component/loki/source/windowsevent/component_test.go @@ -18,7 +18,7 @@ import ( ) func TestEventLogger(t *testing.T) { - var loggerName = "agent_test" + var loggerName = "alloy_test" //Setup Windows Event log with the log source name and logging levels _ = eventlog.InstallAsEventCreate(loggerName, eventlog.Info|eventlog.Warning|eventlog.Error) wlog, err := eventlog.Open(loggerName) diff --git a/internal/component/loki/write/write.go b/internal/component/loki/write/write.go index 4c86e5a01a..cda5e52a05 100644 --- a/internal/component/loki/write/write.go +++ b/internal/component/loki/write/write.go @@ -123,7 +123,7 @@ func (c *Component) Run(ctx context.Context) error { c.walWriter.Stop() } if c.clientManger != nil { - // drain, since the component is shutting down. That means the agent is shutting down as well + // drain, since the component is shutting down. That means Alloy is shutting down as well c.clientManger.StopWithDrain(true) } }() diff --git a/internal/component/mimir/rules/kubernetes/events.go b/internal/component/mimir/rules/kubernetes/events.go index 01ca34fafd..471c12b28c 100644 --- a/internal/component/mimir/rules/kubernetes/events.go +++ b/internal/component/mimir/rules/kubernetes/events.go @@ -193,12 +193,12 @@ func (c *Component) applyChanges(ctx context.Context, namespace string, diffs [] // mimirNamespaceForRuleCRD returns the namespace that the rule CRD should be // stored in mimir. This function, along with isManagedNamespace, is used to -// determine if a rule CRD is managed by the agent. +// determine if a rule CRD is managed by Alloy. func mimirNamespaceForRuleCRD(prefix string, pr *promv1.PrometheusRule) string { return fmt.Sprintf("%s/%s/%s/%s", prefix, pr.Namespace, pr.Name, pr.UID) } -// isManagedMimirNamespace returns true if the namespace is managed by the agent. +// isManagedMimirNamespace returns true if the namespace is managed by Alloy. // Unmanaged namespaces are left as is by the operator. func isManagedMimirNamespace(prefix, namespace string) bool { prefixPart := regexp.QuoteMeta(prefix) diff --git a/internal/component/mimir/rules/kubernetes/events_test.go b/internal/component/mimir/rules/kubernetes/events_test.go index 8b16ef78d1..27cc51a6aa 100644 --- a/internal/component/mimir/rules/kubernetes/events_test.go +++ b/internal/component/mimir/rules/kubernetes/events_test.go @@ -133,7 +133,7 @@ func TestEventLoop(t *testing.T) { ruleLister: ruleLister, ruleSelector: labels.Everything(), mimirClient: newFakeMimirClient(), - args: Arguments{MimirNameSpacePrefix: "agent"}, + args: Arguments{MimirNameSpacePrefix: "alloy"}, metrics: newMetrics(), } eventHandler := kubernetes.NewQueuedEventHandler(component.log, component.queue) @@ -168,7 +168,7 @@ func TestEventLoop(t *testing.T) { require.Eventually(t, func() bool { allRules, err := component.mimirClient.ListRules(ctx, "") require.NoError(t, err) - rules := allRules[mimirNamespaceForRuleCRD("agent", rule)][0].Rules + rules := allRules[mimirNamespaceForRuleCRD("alloy", rule)][0].Rules return len(rules) == 2 }, time.Second, 10*time.Millisecond) component.queue.AddRateLimited(kubernetes.Event{Typ: eventTypeSyncMimir}) diff --git a/internal/component/mimir/rules/kubernetes/types.go b/internal/component/mimir/rules/kubernetes/types.go index ccdbe2b8c1..1e05a1549a 100644 --- a/internal/component/mimir/rules/kubernetes/types.go +++ b/internal/component/mimir/rules/kubernetes/types.go @@ -23,7 +23,7 @@ type Arguments struct { var DefaultArguments = Arguments{ SyncInterval: 30 * time.Second, - MimirNameSpacePrefix: "agent", + MimirNameSpacePrefix: "alloy", HTTPClientConfig: config.DefaultHTTPClientConfig, PrometheusHTTPPrefix: "/prometheus", } diff --git a/internal/component/otelcol/auth/auth.go b/internal/component/otelcol/auth/auth.go index ed6d857def..720d2f5fd9 100644 --- a/internal/component/otelcol/auth/auth.go +++ b/internal/component/otelcol/auth/auth.go @@ -147,7 +147,7 @@ func (a *Auth) Update(args component.Arguments) error { BuildInfo: otelcomponent.BuildInfo{ Command: os.Args[0], - Description: "Grafana Agent", + Description: "Grafana Alloy", Version: build.Version, }, } diff --git a/internal/component/otelcol/config_filter.go b/internal/component/otelcol/config_filter.go index ae2b7fa2e9..77536944c0 100644 --- a/internal/component/otelcol/config_filter.go +++ b/internal/component/otelcol/config_filter.go @@ -298,9 +298,9 @@ var severityNumbers = map[plog.SeverityNumber]SeverityLevel{ // UnmarshalText implements encoding.TextUnmarshaler for SeverityLevel. func (sl *SeverityLevel) UnmarshalText(text []byte) error { - agentSevLevelStr := SeverityLevel(text) - if _, exists := severityLevels[agentSevLevelStr]; exists { - *sl = agentSevLevelStr + alloySevLevelStr := SeverityLevel(text) + if _, exists := severityLevels[alloySevLevelStr]; exists { + *sl = alloySevLevelStr return nil } return fmt.Errorf("unrecognized severity level %q", string(text)) diff --git a/internal/component/otelcol/config_k8s.go b/internal/component/otelcol/config_k8s.go index 546d851ef1..9cfbf91ed2 100644 --- a/internal/component/otelcol/config_k8s.go +++ b/internal/component/otelcol/config_k8s.go @@ -13,7 +13,7 @@ const ( type KubernetesAPIConfig struct { // How to authenticate to the K8s API server. This can be one of `none` // (for no auth), `serviceAccount` (to use the standard service account - // token provided to the agent pod), or `kubeConfig` to use credentials + // token provided to the Alloy pod), or `kubeConfig` to use credentials // from `~/.kube/config`. AuthType string `alloy:"auth_type,attr,optional"` diff --git a/internal/component/otelcol/connector/connector.go b/internal/component/otelcol/connector/connector.go index 4b229a54c5..75324ef28f 100644 --- a/internal/component/otelcol/connector/connector.go +++ b/internal/component/otelcol/connector/connector.go @@ -157,7 +157,7 @@ func (p *Connector) Update(args component.Arguments) error { BuildInfo: otelcomponent.BuildInfo{ Command: os.Args[0], - Description: "Grafana Agent", + Description: "Grafana Alloy", Version: build.Version, }, } diff --git a/internal/component/otelcol/exporter/exporter.go b/internal/component/otelcol/exporter/exporter.go index dde372ed76..2b5c32592d 100644 --- a/internal/component/otelcol/exporter/exporter.go +++ b/internal/component/otelcol/exporter/exporter.go @@ -181,7 +181,7 @@ func (e *Exporter) Update(args component.Arguments) error { BuildInfo: otelcomponent.BuildInfo{ Command: os.Args[0], - Description: "Grafana Agent", + Description: "Grafana Alloy", Version: build.Version, }, } diff --git a/internal/component/otelcol/exporter/loadbalancing/loadbalancing.go b/internal/component/otelcol/exporter/loadbalancing/loadbalancing.go index 2757441959..0b01973b66 100644 --- a/internal/component/otelcol/exporter/loadbalancing/loadbalancing.go +++ b/internal/component/otelcol/exporter/loadbalancing/loadbalancing.go @@ -31,7 +31,7 @@ func init() { Build: func(opts component.Options, args component.Arguments) (component.Component, error) { fact := loadbalancingexporter.NewFactory() - //TODO(ptodev): LB exporter cannot yet work with metrics due to a limitation in the Agent: + //TODO(ptodev): LB exporter cannot yet work with metrics due to a limitation in Alloy: // https://github.com/grafana/agent/pull/5684 // Once the limitation is removed, we may be able to remove the need for exporter.TypeSignal altogether. return exporter.New(opts, fact, args.(Arguments), exporter.TypeLogs|exporter.TypeTraces) diff --git a/internal/component/otelcol/exporter/loadbalancing/loadbalancing_test.go b/internal/component/otelcol/exporter/loadbalancing/loadbalancing_test.go index 9300f9c5f9..59ddf69eee 100644 --- a/internal/component/otelcol/exporter/loadbalancing/loadbalancing_test.go +++ b/internal/component/otelcol/exporter/loadbalancing/loadbalancing_test.go @@ -44,12 +44,12 @@ func TestConfigConversion(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected loadbalancingexporter.Config }{ { testName: "static", - agentCfg: ` + alloyCfg: ` resolver { static { hostnames = ["endpoint-1"] @@ -74,7 +74,7 @@ func TestConfigConversion(t *testing.T) { }, { testName: "static with service routing", - agentCfg: ` + alloyCfg: ` routing_key = "service" resolver { static { @@ -100,7 +100,7 @@ func TestConfigConversion(t *testing.T) { }, { testName: "static with timeout", - agentCfg: ` + alloyCfg: ` protocol { otlp { timeout = "1s" @@ -143,7 +143,7 @@ func TestConfigConversion(t *testing.T) { }, { testName: "dns with defaults", - agentCfg: ` + alloyCfg: ` resolver { dns { hostname = "service-1" @@ -171,7 +171,7 @@ func TestConfigConversion(t *testing.T) { }, { testName: "dns with non-defaults", - agentCfg: ` + alloyCfg: ` resolver { dns { hostname = "service-1" @@ -202,7 +202,7 @@ func TestConfigConversion(t *testing.T) { }, { testName: "k8s with defaults", - agentCfg: ` + alloyCfg: ` resolver { kubernetes { service = "lb-svc.lb-ns" @@ -228,7 +228,7 @@ func TestConfigConversion(t *testing.T) { }, { testName: "k8s with non-defaults", - agentCfg: ` + alloyCfg: ` resolver { kubernetes { service = "lb-svc.lb-ns" @@ -258,7 +258,7 @@ func TestConfigConversion(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args loadbalancing.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) actual, err := args.Convert() require.NoError(t, err) require.Equal(t, &tc.expected, actual.(*loadbalancingexporter.Config)) @@ -269,12 +269,12 @@ func TestConfigConversion(t *testing.T) { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` resolver { static { hostnames = ["endpoint-1"] @@ -292,7 +292,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` resolver { static { hostnames = ["endpoint-1"] @@ -313,7 +313,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` resolver { static { hostnames = ["endpoint-1"] @@ -337,7 +337,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args loadbalancing.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/otelcol/exporter/otlp/otlp_test.go b/internal/component/otelcol/exporter/otlp/otlp_test.go index 7ef7ae88b8..250b5dc320 100644 --- a/internal/component/otelcol/exporter/otlp/otlp_test.go +++ b/internal/component/otelcol/exporter/otlp/otlp_test.go @@ -147,12 +147,12 @@ func createTestTraces() ptrace.Traces { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` client { endpoint = "tempo-xxx.grafana.net/tempo:443" } @@ -163,7 +163,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` client { endpoint = "tempo-xxx.grafana.net/tempo:443" } @@ -177,7 +177,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` client { endpoint = "tempo-xxx.grafana.net/tempo:443" } @@ -194,7 +194,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args otlp.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/otelcol/exporter/otlphttp/otlphttp_test.go b/internal/component/otelcol/exporter/otlphttp/otlphttp_test.go index 1396842ed0..6f4e0e5eb8 100644 --- a/internal/component/otelcol/exporter/otlphttp/otlphttp_test.go +++ b/internal/component/otelcol/exporter/otlphttp/otlphttp_test.go @@ -118,12 +118,12 @@ func createTestTraces() ptrace.Traces { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` client { endpoint = "http://tempo:4317" } @@ -134,7 +134,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` client { endpoint = "http://tempo:4317" } @@ -148,7 +148,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` client { endpoint = "http://tempo:4317" } @@ -165,7 +165,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args otlphttp.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/otelcol/extension/extension.go b/internal/component/otelcol/extension/extension.go index f0ba0fb249..8cff7c3a61 100644 --- a/internal/component/otelcol/extension/extension.go +++ b/internal/component/otelcol/extension/extension.go @@ -124,7 +124,7 @@ func (e *Extension) Update(args component.Arguments) error { BuildInfo: otelcomponent.BuildInfo{ Command: os.Args[0], - Description: "Grafana Agent", + Description: "Grafana Alloy", Version: build.Version, }, } diff --git a/internal/component/otelcol/internal/views/views.go b/internal/component/otelcol/internal/views/views.go index 7d2804ec34..4391bcf13e 100644 --- a/internal/component/otelcol/internal/views/views.go +++ b/internal/component/otelcol/internal/views/views.go @@ -40,7 +40,7 @@ func cardinalityFilter(kvs ...attribute.KeyValue) attribute.Filter { // https://github.com/open-telemetry/opentelemetry-go-contrib/issues/3765 // The long-term solution for the Collector is to set view settings in the Collector config: // https://github.com/open-telemetry/opentelemetry-collector/issues/7517#issuecomment-1511168350 -// In the future, when Collector supports such config, we may want to support similar view settings in the Agent. +// In the future, when Collector supports such config, we may want to support similar view settings in Alloy. func DropHighCardinalityServerAttributes() []metric.View { var views []metric.View diff --git a/internal/component/otelcol/processor/attributes/attributes_test.go b/internal/component/otelcol/processor/attributes/attributes_test.go index 31f1625cce..918a217f14 100644 --- a/internal/component/otelcol/processor/attributes/attributes_test.go +++ b/internal/component/otelcol/processor/attributes/attributes_test.go @@ -35,7 +35,7 @@ func TestSeverityLevelMatchesOtel(t *testing.T) { var tests []TestDefinition for _, testInfo := range []struct { - agentSevStr string + alloySevStr string otelSevStr string }{ {"TRACE", "Trace"}, @@ -72,8 +72,8 @@ func TestSeverityLevelMatchesOtel(t *testing.T) { ` newTest := TestDefinition{ - name: testInfo.agentSevStr, - cfg: fmt.Sprintf(cfgTemplate, testInfo.agentSevStr), + name: testInfo.alloySevStr, + cfg: fmt.Sprintf(cfgTemplate, testInfo.alloySevStr), expectedOtelSevStr: testInfo.otelSevStr, } tests = append(tests, newTest) diff --git a/internal/component/otelcol/processor/k8sattributes/k8sattributes_test.go b/internal/component/otelcol/processor/k8sattributes/k8sattributes_test.go index bc9e5b7966..b8b862475b 100644 --- a/internal/component/otelcol/processor/k8sattributes/k8sattributes_test.go +++ b/internal/component/otelcol/processor/k8sattributes/k8sattributes_test.go @@ -336,7 +336,7 @@ func Test_Exclude(t *testing.T) { cfg := ` exclude { pod { - name = "grafana-agent" + name = "alloy" } } @@ -353,6 +353,6 @@ func Test_Exclude(t *testing.T) { exclude := &otelObj.Exclude require.Len(t, exclude.Pods, 1) - require.Equal(t, "grafana-agent", exclude.Pods[0].Name) + require.Equal(t, "alloy", exclude.Pods[0].Name) }) } diff --git a/internal/component/otelcol/processor/processor.go b/internal/component/otelcol/processor/processor.go index 528e56fad4..2dc4546a40 100644 --- a/internal/component/otelcol/processor/processor.go +++ b/internal/component/otelcol/processor/processor.go @@ -143,7 +143,7 @@ func (p *Processor) Update(args component.Arguments) error { BuildInfo: otelcomponent.BuildInfo{ Command: os.Args[0], - Description: "Grafana Agent", + Description: "Grafana Alloy", Version: build.Version, }, } diff --git a/internal/component/otelcol/processor/resourcedetection/internal/k8snode/config.go b/internal/component/otelcol/processor/resourcedetection/internal/k8snode/config.go index 071126b3e1..1b1d92f96a 100644 --- a/internal/component/otelcol/processor/resourcedetection/internal/k8snode/config.go +++ b/internal/component/otelcol/processor/resourcedetection/internal/k8snode/config.go @@ -12,12 +12,12 @@ type Config struct { KubernetesAPIConfig otelcol.KubernetesAPIConfig `alloy:",squash"` // NodeFromEnv can be used to extract the node name from an environment // variable. The value must be the name of the environment variable. - // This is useful when the node where an Agent will run on cannot be + // This is useful when the node where Alloy will run on cannot be // predicted. In such cases, the Kubernetes downward API can be used to // add the node name to each pod as an environment variable. K8s tagger // can then read this value and filter pods by it. // - // For example, node name can be passed to each agent with the downward API as follows + // For example, node name can be passed to Alloy with the downward API as follows // // env: // - name: K8S_NODE_NAME @@ -26,7 +26,7 @@ type Config struct { // fieldPath: spec.nodeName // // Then the NodeFromEnv field can be set to `K8S_NODE_NAME` to filter all pods by the node that - // the agent is running on. + // Alloy is running on. // // More on downward API here: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/ NodeFromEnvVar string `alloy:"node_from_env_var,attr,optional"` diff --git a/internal/component/otelcol/processor/resourcedetection/resourcedetection.go b/internal/component/otelcol/processor/resourcedetection/resourcedetection.go index 6fa2252ac2..894ff4f9a9 100644 --- a/internal/component/otelcol/processor/resourcedetection/resourcedetection.go +++ b/internal/component/otelcol/processor/resourcedetection/resourcedetection.go @@ -63,8 +63,8 @@ type Arguments struct { //TODO: Uncomment this later, and remove Timeout? // Can we just get away with a timeout, or do we need all the http client settings? // It seems that HTTP client settings are only used in the ec2 detection via ClientFromContext. - // This seems like a very niche use case, so for now I won't implement it in the Agent. - // If we do implement it in the Agent, I am not sure how to document the HTTP client settings. + // This seems like a very niche use case, so for now I won't implement it in Alloy. + // If we do implement it in Alloy, I am not sure how to document the HTTP client settings. // We'd have to mention that they're only for a very specific use case. // Output configures where to send processed data. Required. diff --git a/internal/component/otelcol/receiver/jaeger/jaeger_test.go b/internal/component/otelcol/receiver/jaeger/jaeger_test.go index 8e6f2ccf43..92ab549783 100644 --- a/internal/component/otelcol/receiver/jaeger/jaeger_test.go +++ b/internal/component/otelcol/receiver/jaeger/jaeger_test.go @@ -135,12 +135,12 @@ func getFreeAddr(t *testing.T) string { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` protocols { thrift_compact {} } output {} `, @@ -150,7 +150,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` protocols { thrift_compact {} } debug_metrics { disable_high_cardinality_metrics = false @@ -163,7 +163,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` protocols { thrift_compact {} } debug_metrics { disable_high_cardinality_metrics = true @@ -179,7 +179,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args jaeger.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/otelcol/receiver/kafka/kafka_test.go b/internal/component/otelcol/receiver/kafka/kafka_test.go index b6c10c5d31..02b8792437 100644 --- a/internal/component/otelcol/receiver/kafka/kafka_test.go +++ b/internal/component/otelcol/receiver/kafka/kafka_test.go @@ -378,12 +378,12 @@ func TestArguments_Auth(t *testing.T) { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` brokers = ["10.10.10.10:9092"] protocol_version = "2.0.0" output {} @@ -394,7 +394,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` brokers = ["10.10.10.10:9092"] protocol_version = "2.0.0" debug_metrics { @@ -408,7 +408,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` brokers = ["10.10.10.10:9092"] protocol_version = "2.0.0" debug_metrics { @@ -425,7 +425,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args kafka.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/otelcol/receiver/opencensus/opencensus_test.go b/internal/component/otelcol/receiver/opencensus/opencensus_test.go index 57a13bd37c..3ce0412229 100644 --- a/internal/component/otelcol/receiver/opencensus/opencensus_test.go +++ b/internal/component/otelcol/receiver/opencensus/opencensus_test.go @@ -104,12 +104,12 @@ func getFreeAddr(t *testing.T) string { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` output {} `, expected: otelcol.DebugMetricsArguments{ @@ -118,7 +118,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` debug_metrics { disable_high_cardinality_metrics = false } @@ -130,7 +130,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` debug_metrics { disable_high_cardinality_metrics = true } @@ -145,7 +145,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args opencensus.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/otelcol/receiver/otlp/otlp_test.go b/internal/component/otelcol/receiver/otlp/otlp_test.go index 550482ac35..d51c90ae0d 100644 --- a/internal/component/otelcol/receiver/otlp/otlp_test.go +++ b/internal/component/otelcol/receiver/otlp/otlp_test.go @@ -177,12 +177,12 @@ func TestUnmarshalHttpUrls(t *testing.T) { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` grpc { endpoint = "/v1/traces" } @@ -194,7 +194,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` grpc { endpoint = "/v1/traces" } @@ -209,7 +209,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` grpc { endpoint = "/v1/traces" } @@ -227,7 +227,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args otlp.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/otelcol/receiver/prometheus/prometheus.go b/internal/component/otelcol/receiver/prometheus/prometheus.go index c3540188e3..c478999b27 100644 --- a/internal/component/otelcol/receiver/prometheus/prometheus.go +++ b/internal/component/otelcol/receiver/prometheus/prometheus.go @@ -106,7 +106,7 @@ func (c *Component) Update(newConfig component.Arguments) error { useCreatedMetric = false // Trimming the metric suffixes is used to remove the metric type and the unit and the end of the metric name. - // To trim the unit, the opentelemetry code uses the MetricMetadataStore which is currently not supported by the agent. + // To trim the unit, the opentelemetry code uses the MetricMetadataStore which is currently not supported by Alloy. // When supported, this could be added as an arg. trimMetricSuffixes = false @@ -130,7 +130,7 @@ func (c *Component) Update(newConfig component.Arguments) error { BuildInfo: otelcomponent.BuildInfo{ Command: os.Args[0], - Description: "Grafana Agent", + Description: "Grafana Alloy", Version: build.Version, }, } diff --git a/internal/component/otelcol/receiver/receiver.go b/internal/component/otelcol/receiver/receiver.go index d42754943a..fc96cb43ce 100644 --- a/internal/component/otelcol/receiver/receiver.go +++ b/internal/component/otelcol/receiver/receiver.go @@ -141,7 +141,7 @@ func (r *Receiver) Update(args component.Arguments) error { BuildInfo: otelcomponent.BuildInfo{ Command: os.Args[0], - Description: "Grafana Agent", + Description: "Grafana Alloy", Version: build.Version, }, } diff --git a/internal/component/otelcol/receiver/vcenter/vcenter_test.go b/internal/component/otelcol/receiver/vcenter/vcenter_test.go index a42811a7f6..e6a097d281 100644 --- a/internal/component/otelcol/receiver/vcenter/vcenter_test.go +++ b/internal/component/otelcol/receiver/vcenter/vcenter_test.go @@ -230,12 +230,12 @@ func TestArguments_UnmarshalRiver(t *testing.T) { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` endpoint = "http://localhost:1234" username = "user" password = "pass" @@ -248,7 +248,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` endpoint = "http://localhost:1234" username = "user" password = "pass" @@ -265,7 +265,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` endpoint = "http://localhost:1234" username = "user" password = "pass" @@ -285,7 +285,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args vcenter.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/otelcol/receiver/zipkin/zipkin_test.go b/internal/component/otelcol/receiver/zipkin/zipkin_test.go index a5a7e39b57..3c7c963748 100644 --- a/internal/component/otelcol/receiver/zipkin/zipkin_test.go +++ b/internal/component/otelcol/receiver/zipkin/zipkin_test.go @@ -89,12 +89,12 @@ func getFreeAddr(t *testing.T) string { func TestDebugMetricsConfig(t *testing.T) { tests := []struct { testName string - agentCfg string + alloyCfg string expected otelcol.DebugMetricsArguments }{ { testName: "default", - agentCfg: ` + alloyCfg: ` output {} `, expected: otelcol.DebugMetricsArguments{ @@ -103,7 +103,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_false", - agentCfg: ` + alloyCfg: ` debug_metrics { disable_high_cardinality_metrics = false } @@ -116,7 +116,7 @@ func TestDebugMetricsConfig(t *testing.T) { }, { testName: "explicit_true", - agentCfg: ` + alloyCfg: ` debug_metrics { disable_high_cardinality_metrics = true } @@ -132,7 +132,7 @@ func TestDebugMetricsConfig(t *testing.T) { for _, tc := range tests { t.Run(tc.testName, func(t *testing.T) { var args zipkin.Arguments - require.NoError(t, syntax.Unmarshal([]byte(tc.agentCfg), &args)) + require.NoError(t, syntax.Unmarshal([]byte(tc.alloyCfg), &args)) _, err := args.Convert() require.NoError(t, err) diff --git a/internal/component/prometheus/exporter/cloudwatch/config.go b/internal/component/prometheus/exporter/cloudwatch/config.go index 75680c83ac..02c73b33d4 100644 --- a/internal/component/prometheus/exporter/cloudwatch/config.go +++ b/internal/component/prometheus/exporter/cloudwatch/config.go @@ -74,8 +74,8 @@ type StaticJob struct { NilToZero *bool `alloy:"nil_to_zero,attr,optional"` } -// RegionAndRoles exposes for each supported job, the AWS regions and IAM roles in which the agent should perform the -// scrape. +// RegionAndRoles exposes for each supported job, the AWS regions and IAM roles +// in which Alloy should perform the scrape. type RegionAndRoles struct { Regions []string `alloy:"regions,attr"` Roles []Role `alloy:"role,block,optional"` @@ -103,9 +103,9 @@ func (a *Arguments) SetToDefault() { *a = defaults } -// ConvertToYACE converts the river config into YACE config model. Note that the conversion is -// not direct, some values have been opinionated to simplify the config model the agent exposes -// for this integration. +// ConvertToYACE converts the river config into YACE config model. Note that +// the conversion is not direct, some values have been opinionated to simplify +// the config model Alloy exposes for this integration. func ConvertToYACE(a Arguments) (yaceConf.ScrapeConf, error) { var discoveryJobs []*yaceConf.Job for _, job := range a.Discovery { @@ -175,7 +175,7 @@ func toYACEMetrics(ms []Metric, jobNilToZero *bool) []*yaceConf.Metric { // Length dictates the size of the window for whom we request metrics, that is, endTime - startTime. Period // dictates the size of the buckets in which we aggregate data, inside that window. Since data will be scraped - // by the agent every so often, dictated by the scrapedInterval, CloudWatch should return a single datapoint + // by Alloy every so often, dictated by the scrapedInterval, CloudWatch should return a single datapoint // for each requested metric. That is if Period >= Length, but is Period > Length, we will be getting not enough // data to fill the whole aggregation bucket. Therefore, Period == Length. Period: periodSeconds, diff --git a/internal/component/prometheus/exporter/self/self.go b/internal/component/prometheus/exporter/self/self.go index 90f046c52d..cc0d036a9c 100644 --- a/internal/component/prometheus/exporter/self/self.go +++ b/internal/component/prometheus/exporter/self/self.go @@ -15,7 +15,7 @@ func init() { Args: Arguments{}, Exports: exporter.Exports{}, - Build: exporter.New(createExporter, "agent"), + Build: exporter.New(createExporter, "self"), }) } diff --git a/internal/component/prometheus/fanout.go b/internal/component/prometheus/fanout.go index 323df69fcc..2272e4aa25 100644 --- a/internal/component/prometheus/fanout.go +++ b/internal/component/prometheus/fanout.go @@ -33,13 +33,13 @@ type Fanout struct { // NewFanout creates a fanout appendable. func NewFanout(children []storage.Appendable, componentID string, register prometheus.Registerer, ls labelstore.LabelStore) *Fanout { wl := prometheus.NewHistogram(prometheus.HistogramOpts{ - Name: "agent_prometheus_fanout_latency", + Name: "prometheus_fanout_latency", Help: "Write latency for sending to direct and indirect components", }) _ = register.Register(wl) s := prometheus.NewCounter(prometheus.CounterOpts{ - Name: "agent_prometheus_forwarded_samples_total", + Name: "prometheus_forwarded_samples_total", Help: "Total number of samples sent to downstream components.", }) _ = register.Register(s) diff --git a/internal/component/prometheus/operator/common/crdmanager.go b/internal/component/prometheus/operator/common/crdmanager.go index dd0d946adb..73da1e6cb0 100644 --- a/internal/component/prometheus/operator/common/crdmanager.go +++ b/internal/component/prometheus/operator/common/crdmanager.go @@ -312,7 +312,7 @@ func (c *crdManager) configureInformers(ctx context.Context, informers cache.Inf if err != nil { if errors.Is(informerCtx.Err(), context.DeadlineExceeded) { // Check the context to prevent GetInformer returning a fake timeout return fmt.Errorf("timeout exceeded while configuring informers. Check the connection"+ - " to the Kubernetes API is stable and that the Agent has appropriate RBAC permissions for %v", prototype) + " to the Kubernetes API is stable and that Alloy has appropriate RBAC permissions for %v", prototype) } return err diff --git a/internal/component/prometheus/receive_http/receive_http.go b/internal/component/prometheus/receive_http/receive_http.go index c718147c39..807fb08f68 100644 --- a/internal/component/prometheus/receive_http/receive_http.go +++ b/internal/component/prometheus/receive_http/receive_http.go @@ -11,7 +11,7 @@ import ( "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" fnet "github.com/grafana/alloy/internal/component/common/net" - agentprom "github.com/grafana/alloy/internal/component/prometheus" + alloyprom "github.com/grafana/alloy/internal/component/prometheus" "github.com/grafana/alloy/internal/featuregate" "github.com/grafana/alloy/internal/service/labelstore" "github.com/grafana/alloy/internal/util" @@ -47,7 +47,7 @@ func (args *Arguments) SetToDefault() { type Component struct { opts component.Options handler http.Handler - fanout *agentprom.Fanout + fanout *alloyprom.Fanout uncheckedCollector *util.UncheckedCollector updateMut sync.RWMutex @@ -61,7 +61,7 @@ func New(opts component.Options, args Arguments) (*Component, error) { return nil, err } ls := service.(labelstore.LabelStore) - fanout := agentprom.NewFanout(args.ForwardTo, opts.ID, opts.Registerer, ls) + fanout := alloyprom.NewFanout(args.ForwardTo, opts.ID, opts.Registerer, ls) uncheckedCollector := util.NewUncheckedCollector(nil) opts.Registerer.MustRegister(uncheckedCollector) diff --git a/internal/component/prometheus/receive_http/receive_http_test.go b/internal/component/prometheus/receive_http/receive_http_test.go index 9ce3eee33d..224a9adc0b 100644 --- a/internal/component/prometheus/receive_http/receive_http_test.go +++ b/internal/component/prometheus/receive_http/receive_http_test.go @@ -11,7 +11,7 @@ import ( "github.com/golang/snappy" "github.com/grafana/alloy/internal/component" fnet "github.com/grafana/alloy/internal/component/common/net" - agentprom "github.com/grafana/alloy/internal/component/prometheus" + alloyprom "github.com/grafana/alloy/internal/component/prometheus" "github.com/grafana/alloy/internal/service/labelstore" "github.com/grafana/alloy/internal/util" "github.com/phayes/freeport" @@ -349,10 +349,10 @@ func testAppendable(actualSamples chan testSample) []storage.Appendable { } ls := labelstore.New(nil, prometheus.DefaultRegisterer) - return []storage.Appendable{agentprom.NewInterceptor( + return []storage.Appendable{alloyprom.NewInterceptor( nil, ls, - agentprom.WithAppendHook( + alloyprom.WithAppendHook( hookFn))} } diff --git a/internal/component/prometheus/relabel/relabel.go b/internal/component/prometheus/relabel/relabel.go index e78596212e..653df6a977 100644 --- a/internal/component/prometheus/relabel/relabel.go +++ b/internal/component/prometheus/relabel/relabel.go @@ -109,27 +109,27 @@ func New(o component.Options, args Arguments) (*Component, error) { ls: data.(labelstore.LabelStore), } c.metricsProcessed = prometheus_client.NewCounter(prometheus_client.CounterOpts{ - Name: "agent_prometheus_relabel_metrics_processed", + Name: "alloy_prometheus_relabel_metrics_processed", Help: "Total number of metrics processed", }) c.metricsOutgoing = prometheus_client.NewCounter(prometheus_client.CounterOpts{ - Name: "agent_prometheus_relabel_metrics_written", + Name: "alloy_prometheus_relabel_metrics_written", Help: "Total number of metrics written", }) c.cacheMisses = prometheus_client.NewCounter(prometheus_client.CounterOpts{ - Name: "agent_prometheus_relabel_cache_misses", + Name: "alloy_prometheus_relabel_cache_misses", Help: "Total number of cache misses", }) c.cacheHits = prometheus_client.NewCounter(prometheus_client.CounterOpts{ - Name: "agent_prometheus_relabel_cache_hits", + Name: "alloy_prometheus_relabel_cache_hits", Help: "Total number of cache hits", }) c.cacheSize = prometheus_client.NewGauge(prometheus_client.GaugeOpts{ - Name: "agent_prometheus_relabel_cache_size", + Name: "alloy_prometheus_relabel_cache_size", Help: "Total size of relabel cache", }) c.cacheDeletes = prometheus_client.NewCounter(prometheus_client.CounterOpts{ - Name: "agent_prometheus_relabel_cache_deletes", + Name: "alloy_prometheus_relabel_cache_deletes", Help: "Total number of cache deletes", }) diff --git a/internal/component/prometheus/scrape/scrape.go b/internal/component/prometheus/scrape/scrape.go index 3a3554d95c..9bc4586575 100644 --- a/internal/component/prometheus/scrape/scrape.go +++ b/internal/component/prometheus/scrape/scrape.go @@ -168,7 +168,7 @@ func New(o component.Options, args Arguments) (*Component, error) { scraper := scrape.NewManager(scrapeOptions, o.Logger, alloyAppendable) targetsGauge := client_prometheus.NewGauge(client_prometheus.GaugeOpts{ - Name: "agent_prometheus_scrape_targets_gauge", + Name: "prometheus_scrape_targets_gauge", Help: "Number of targets this component is configured to scrape"}) err = o.Registerer.Register(targetsGauge) if err != nil { diff --git a/internal/component/prometheus/scrape/scrape_test.go b/internal/component/prometheus/scrape/scrape_test.go index 03c3081d5d..8849331580 100644 --- a/internal/component/prometheus/scrape/scrape_test.go +++ b/internal/component/prometheus/scrape/scrape_test.go @@ -80,7 +80,7 @@ func TestForwardingToAppendable(t *testing.T) { case http_service.ServiceName: return http_service.Data{ HTTPListenAddr: "localhost:12345", - MemoryListenAddr: "agent.internal:1245", + MemoryListenAddr: "alloy.internal:1245", BaseHTTPPath: "/", DialFunc: (&net.Dialer{}).DialContext, }, nil diff --git a/internal/component/pyroscope/java/asprof/asprof.go b/internal/component/pyroscope/java/asprof/asprof.go index e75a8a3ed5..570df77f26 100644 --- a/internal/component/pyroscope/java/asprof/asprof.go +++ b/internal/component/pyroscope/java/asprof/asprof.go @@ -69,7 +69,7 @@ type Archive struct { } func NewProfiler(tmpDir string, archive Archive) *Profiler { - res := &Profiler{tmpDir: tmpDir, glibcDist: new(Distribution), muslDist: new(Distribution), tmpDirMarker: "grafana-agent-asprof"} + res := &Profiler{tmpDir: tmpDir, glibcDist: new(Distribution), muslDist: new(Distribution), tmpDirMarker: "alloy-asprof"} sum := sha1.Sum(archive.data) hexSum := hex.EncodeToString(sum[:]) res.archiveHash = hexSum diff --git a/internal/component/pyroscope/java/asprof/asprof_test.go b/internal/component/pyroscope/java/asprof/asprof_test.go index 297665d024..1927e652be 100644 --- a/internal/component/pyroscope/java/asprof/asprof_test.go +++ b/internal/component/pyroscope/java/asprof/asprof_test.go @@ -24,7 +24,7 @@ import ( func TestStickyDir(t *testing.T) { dir := "/tmp" p := NewProfiler(dir, EmbeddedArchive) - p.tmpDirMarker = fmt.Sprintf("grafana-agent-asprof-%s", uuid.NewString()) + p.tmpDirMarker = fmt.Sprintf("alloy-asprof-%s", uuid.NewString()) t.Logf("tmpDirMarker: %s", p.tmpDirMarker) err := p.ExtractDistributions() assert.NoError(t, err) diff --git a/internal/component/pyroscope/java/loop.go b/internal/component/pyroscope/java/loop.go index fe741fed2f..2ba57330ac 100644 --- a/internal/component/pyroscope/java/loop.go +++ b/internal/component/pyroscope/java/loop.go @@ -23,7 +23,7 @@ import ( gopsutil "github.com/shirou/gopsutil/v3/process" ) -const spyName = "grafana-agent.java" +const spyName = "alloy.java" type profilingLoop struct { logger log.Logger @@ -92,7 +92,7 @@ func (p *profilingLoop) loop(ctx context.Context) { for { err := p.start() if err != nil { - // could happen when agent restarted - [ERROR] Profiler already started\n + // could happen when Alloy restarted - [ERROR] Profiler already started\n alive := p.onError(fmt.Errorf("failed to start: %w", err)) if !alive { return diff --git a/internal/component/remote/s3/s3.go b/internal/component/remote/s3/s3.go index cf1820b9b5..56c3e076d6 100644 --- a/internal/component/remote/s3/s3.go +++ b/internal/component/remote/s3/s3.go @@ -67,11 +67,11 @@ func New(o component.Options, args Arguments) (*Component, error) { health: component.Health{}, updateChan: make(chan result), s3Errors: prometheus.NewCounter(prometheus.CounterOpts{ - Name: "agent_remote_s3_errors_total", + Name: "remote_s3_errors_total", Help: "The number of errors while accessing s3", }), lastAccessed: prometheus.NewGauge(prometheus.GaugeOpts{ - Name: "agent_remote_s3_timestamp_last_accessed_unix_seconds", + Name: "remote_s3_timestamp_last_accessed_unix_seconds", Help: "The last successful access in unix seconds", }), } diff --git a/internal/converter/internal/promtailconvert/testdata/unsupported.diags b/internal/converter/internal/promtailconvert/testdata/unsupported.diags index eb0a979d3d..06cd17ce5a 100644 --- a/internal/converter/internal/promtailconvert/testdata/unsupported.diags +++ b/internal/converter/internal/promtailconvert/testdata/unsupported.diags @@ -2,7 +2,7 @@ (Error) limits_config is not yet supported in Alloy (Warning) If you have a tracing set up for Promtail, it cannot be migrated to Alloy automatically. Refer to the documentation on how to configure tracing in Alloy. (Error) reading targets from stdin is not supported in Alloy configuration file -(Warning) server.profiling_enabled is not supported - use Agent's main HTTP server's profiling endpoints instead +(Warning) server.profiling_enabled is not supported - use Alloy's main HTTP server's profiling endpoints instead (Warning) Alloy's metrics are different from the metrics emitted by Promtail. If you rely on Promtail's metrics, you must change your configuration, for example, your alerts and dashboards. (Warning) The converter does not support converting the provided server.log_level config: The equivalent feature in Alloy is to use the logging config block to set the level argument. (Error) server.http_path_prefix is not supported diff --git a/internal/converter/internal/promtailconvert/validate.go b/internal/converter/internal/promtailconvert/validate.go index fdb7454825..2d7be2b0f1 100644 --- a/internal/converter/internal/promtailconvert/validate.go +++ b/internal/converter/internal/promtailconvert/validate.go @@ -54,7 +54,7 @@ func validateTopLevelConfig(cfg *promtailcfg.Config, diags *diag.Diagnostics) { ) } if cfg.ServerConfig.ProfilingEnabled { - diags.Add(diag.SeverityLevelWarn, "server.profiling_enabled is not supported - use Agent's "+ + diags.Add(diag.SeverityLevelWarn, "server.profiling_enabled is not supported - use Alloy's "+ "main HTTP server's profiling endpoints instead") } diff --git a/internal/loki/client/client.go b/internal/loki/client/client.go index d52022939d..813d6d3f89 100644 --- a/internal/loki/client/client.go +++ b/internal/loki/client/client.go @@ -13,6 +13,7 @@ import ( log "github.com/go-kit/log" "github.com/grafana/alloy/internal/loki/client/internal" + "github.com/grafana/alloy/internal/useragent" "github.com/grafana/dskit/instrument" "github.com/grafana/dskit/user" "github.com/prometheus/client_golang/prometheus" @@ -60,7 +61,7 @@ func New(logger log.Logger, cfg Config, timingHistogram *prometheus.HistogramVec if err != nil { return nil, err } - client, err := config.NewClientFromConfig(cfg.HTTPClientConfig, "GrafanaAgent", config.WithHTTP2Disabled()) + client, err := config.NewClientFromConfig(cfg.HTTPClientConfig, useragent.ProductName, config.WithHTTP2Disabled()) if err != nil { return nil, err } diff --git a/internal/mimir/client/client.go b/internal/mimir/client/client.go index afa2516cf0..b3f86bf46b 100644 --- a/internal/mimir/client/client.go +++ b/internal/mimir/client/client.go @@ -13,6 +13,7 @@ import ( log "github.com/go-kit/log" "github.com/grafana/alloy/internal/mimir/client/internal" + "github.com/grafana/alloy/internal/useragent" "github.com/grafana/dskit/instrument" "github.com/grafana/dskit/user" "github.com/prometheus/client_golang/prometheus" @@ -56,7 +57,7 @@ func New(logger log.Logger, cfg Config, timingHistogram *prometheus.HistogramVec if err != nil { return nil, err } - client, err := config.NewClientFromConfig(cfg.HTTPClientConfig, "GrafanaAgent", config.WithHTTP2Disabled()) + client, err := config.NewClientFromConfig(cfg.HTTPClientConfig, useragent.ProductName, config.WithHTTP2Disabled()) if err != nil { return nil, err } diff --git a/internal/service/http/http.go b/internal/service/http/http.go index eaf6bfc2ae..61a6723853 100644 --- a/internal/service/http/http.go +++ b/internal/service/http/http.go @@ -159,7 +159,7 @@ func (s *Service) Run(ctx context.Context, host service.Host) error { r := mux.NewRouter() r.Use(otelmux.Middleware( - "grafana-agent", + "alloy", otelmux.WithTracerProvider(s.tracer), )) @@ -177,10 +177,10 @@ func (s *Service) Run(ctx context.Context, host service.Host) error { r.HandleFunc("/-/ready", func(w http.ResponseWriter, _ *http.Request) { if s.opts.ReadyFunc() { w.WriteHeader(http.StatusOK) - fmt.Fprintln(w, "Agent is ready.") + fmt.Fprintln(w, "Alloy is ready.") } else { w.WriteHeader(http.StatusServiceUnavailable) - fmt.Fprintln(w, "Agent is not ready.") + fmt.Fprintln(w, "Alloy is not ready.") } }) } diff --git a/internal/service/http/http_test.go b/internal/service/http/http_test.go index 7c7905bbed..90a80a4051 100644 --- a/internal/service/http/http_test.go +++ b/internal/service/http/http_test.go @@ -175,7 +175,7 @@ func newTestEnvironment(t *testing.T) (*testEnvironment, error) { ReloadFunc: func() (*alloy.Source, error) { return nil, nil }, HTTPListenAddr: fmt.Sprintf("127.0.0.1:%d", port), - MemoryListenAddr: "agent.internal:12345", + MemoryListenAddr: "alloy.internal:12345", EnablePProf: true, }) diff --git a/internal/service/labelstore/service.go b/internal/service/labelstore/service.go index 6d626ca589..52aee59b4a 100644 --- a/internal/service/labelstore/service.go +++ b/internal/service/labelstore/service.go @@ -47,10 +47,10 @@ func New(l log.Logger, r prometheus.Registerer) *service { mappings: make(map[string]*remoteWriteMapping), labelsHashToGlobal: make(map[uint64]uint64), staleGlobals: make(map[uint64]*staleMarker), - totalIDs: prometheus.NewDesc("agent_labelstore_global_ids_count", "Total number of global ids.", nil, nil), - idsInRemoteWrapping: prometheus.NewDesc("agent_labelstore_remote_store_ids_count", "Total number of ids per remote write", []string{"remote_name"}, nil), + totalIDs: prometheus.NewDesc("alloy_labelstore_global_ids_count", "Total number of global ids.", nil, nil), + idsInRemoteWrapping: prometheus.NewDesc("alloy_labelstore_remote_store_ids_count", "Total number of ids per remote write", []string{"remote_name"}, nil), lastStaleCheck: prometheus.NewGauge(prometheus.GaugeOpts{ - Name: "agent_labelstore_last_stale_check_timestamp", + Name: "alloy_labelstore_last_stale_check_timestamp", Help: "Last time stale check was ran expressed in unix timestamp.", }), } diff --git a/internal/static/agentctl/waltools/walstats.go b/internal/static/agentctl/waltools/walstats.go index 8df788c8ab..562a785668 100644 --- a/internal/static/agentctl/waltools/walstats.go +++ b/internal/static/agentctl/waltools/walstats.go @@ -38,9 +38,9 @@ type WALStats struct { // collision. A hash collision is any instance in which a hash of labels // is defined by two ref IDs. // - // For the Grafana Agent, a hash collision has no negative side effects - // on data sent to the remote_write endpoint but may have a noticeable impact - // on memory while the collision exists. + // For Grafana Alloy, a hash collision has no negative side effects on data + // sent to the remote_write endpoint but may have a noticeable impact on + // memory while the collision exists. HashCollisions int // Targets holds stats on specific scrape targets. diff --git a/internal/static/config/config.go b/internal/static/config/config.go index 411360f848..d832006c92 100644 --- a/internal/static/config/config.go +++ b/internal/static/config/config.go @@ -58,7 +58,7 @@ func DefaultConfig() Config { } } -// Config contains underlying configurations for the agent +// Config contains underlying configurations for Grafana Agent static mode. type Config struct { Server *server.Config `yaml:"server,omitempty"` Metrics metrics.Config `yaml:"metrics,omitempty"` diff --git a/internal/static/config/instrumentation/config_metrics.go b/internal/static/config/instrumentation/config_metrics.go index e87b227f78..add500eea7 100644 --- a/internal/static/config/instrumentation/config_metrics.go +++ b/internal/static/config/instrumentation/config_metrics.go @@ -29,33 +29,33 @@ func newConfigMetrics() *configMetrics { m.configHash = promauto.NewGaugeVec( prometheus.GaugeOpts{ - Name: "agent_config_hash", + Name: "alloy_config_hash", Help: "Hash of the currently active config file.", }, []string{"sha256"}, ) m.configLoadSuccess = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "agent_config_last_load_successful", + Name: "alloy_config_last_load_successful", Help: "Config loaded successfully.", }) m.configLoadSuccessSeconds = promauto.NewGauge(prometheus.GaugeOpts{ - Name: "agent_config_last_load_success_timestamp_seconds", + Name: "alloy_config_last_load_success_timestamp_seconds", Help: "Timestamp of the last successful configuration load.", }) m.configLoadFailures = promauto.NewCounter(prometheus.CounterOpts{ - Name: "agent_config_load_failures_total", + Name: "alloy_config_load_failures_total", Help: "Configuration load failures.", }) return &m } // Create a sha256 hash of the config before expansion and expose it via -// the agent_config_hash metric. +// the alloy_config_hash metric. func InstrumentConfig(buf []byte) { InstrumentSHA256(sha256.Sum256(buf)) } -// InstrumentSHA256 stores the provided hash to the agent_config_hash metric. +// InstrumentSHA256 stores the provided hash to the alloy_config_hash metric. func InstrumentSHA256(hash [sha256.Size]byte) { configMetricsInitializer.Do(initializeConfigMetrics) confMetrics.configHash.Reset() diff --git a/internal/static/logs/logs.go b/internal/static/logs/logs.go index a35da83f89..4ed7ea814d 100644 --- a/internal/static/logs/logs.go +++ b/internal/static/logs/logs.go @@ -1,4 +1,5 @@ -// Package logs implements logs support for the Grafana Agent. +// Package logs holds types for the logging subsystem of Grafana Agent static +// mode. package logs import ( diff --git a/internal/static/metrics/wal/wal.go b/internal/static/metrics/wal/wal.go index 513a43df5d..bab0fd4033 100644 --- a/internal/static/metrics/wal/wal.go +++ b/internal/static/metrics/wal/wal.go @@ -49,37 +49,37 @@ type storageMetrics struct { func newStorageMetrics(r prometheus.Registerer) *storageMetrics { m := storageMetrics{r: r} m.numActiveSeries = prometheus.NewGauge(prometheus.GaugeOpts{ - Name: "agent_wal_storage_active_series", + Name: "prometheus_remote_write_wal_storage_active_series", Help: "Current number of active series being tracked by the WAL storage", }) m.numDeletedSeries = prometheus.NewGauge(prometheus.GaugeOpts{ - Name: "agent_wal_storage_deleted_series", + Name: "prometheus_remote_write_wal_storage_deleted_series", Help: "Current number of series marked for deletion from memory", }) m.totalOutOfOrderSamples = prometheus.NewCounter(prometheus.CounterOpts{ - Name: "agent_wal_out_of_order_samples_total", + Name: "prometheus_remote_write_wal_out_of_order_samples_total", Help: "Total number of out of order samples ingestion failed attempts.", }) m.totalCreatedSeries = prometheus.NewCounter(prometheus.CounterOpts{ - Name: "agent_wal_storage_created_series_total", + Name: "prometheus_remote_write_wal_storage_created_series_total", Help: "Total number of created series appended to the WAL", }) m.totalRemovedSeries = prometheus.NewCounter(prometheus.CounterOpts{ - Name: "agent_wal_storage_removed_series_total", + Name: "prometheus_remote_write_wal_storage_removed_series_total", Help: "Total number of created series removed from the WAL", }) m.totalAppendedSamples = prometheus.NewCounter(prometheus.CounterOpts{ - Name: "agent_wal_samples_appended_total", + Name: "prometheus_remote_write_wal_samples_appended_total", Help: "Total number of samples appended to the WAL", }) m.totalAppendedExemplars = prometheus.NewCounter(prometheus.CounterOpts{ - Name: "agent_wal_exemplars_appended_total", + Name: "prometheus_remote_write_wal_exemplars_appended_total", Help: "Total number of exemplars appended to the WAL", }) diff --git a/internal/usagestats/reporter.go b/internal/usagestats/reporter.go index b5d37c55c1..3b4d9d186d 100644 --- a/internal/usagestats/reporter.go +++ b/internal/usagestats/reporter.go @@ -17,7 +17,7 @@ var ( reportInterval = 4 * time.Hour ) -// Reporter holds the agent seed information and sends report of usage +// Reporter holds the Alloy seed information and sends report of usage type Reporter struct { logger log.Logger @@ -55,7 +55,7 @@ func (rep *Reporter) Start(ctx context.Context, metricsFunc func() map[string]in if !next.Equal(now) && now.Sub(rep.lastReport) < reportInterval { continue } - level.Info(rep.logger).Log("msg", "reporting agent stats", "date", time.Now()) + level.Info(rep.logger).Log("msg", "reporting Alloy stats", "date", time.Now()) if err := rep.reportUsage(ctx, next, metricsFunc()); err != nil { level.Info(rep.logger).Log("msg", "failed to report usage", "err", err) continue @@ -90,7 +90,7 @@ func (rep *Reporter) reportUsage(ctx context.Context, interval time.Time, metric } // nextReport compute the next report time based on the interval. -// The interval is based off the creation of the agent seed to avoid all agents reporting at the same time. +// The interval is based off the creation of the Alloy seed to avoid all agents 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/usagestats/reporter_test.go b/internal/usagestats/reporter_test.go index 54e71aea16..39d82dccbd 100644 --- a/internal/usagestats/reporter_test.go +++ b/internal/usagestats/reporter_test.go @@ -22,7 +22,7 @@ func Test_ReportLoop(t *testing.T) { var ( mut sync.Mutex totalReports int - agentIDs []string + alloyIDs []string ) server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { @@ -33,7 +33,7 @@ func Test_ReportLoop(t *testing.T) { var received Report require.NoError(t, jsoniter.NewDecoder(r.Body).Decode(&received)) - agentIDs = append(agentIDs, received.UsageStatsID) + alloyIDs = append(alloyIDs, received.UsageStatsID) rw.WriteHeader(http.StatusOK) })) @@ -57,8 +57,8 @@ func Test_ReportLoop(t *testing.T) { defer mut.Unlock() require.GreaterOrEqual(t, totalReports, 5) - first := agentIDs[0] - for _, uid := range agentIDs { + first := alloyIDs[0] + for _, uid := range alloyIDs { require.Equal(t, first, uid) } require.Equal(t, first, r.seed.UID) diff --git a/internal/useragent/useragent.go b/internal/useragent/useragent.go index 82a6bd831b..09f346a007 100644 --- a/internal/useragent/useragent.go +++ b/internal/useragent/useragent.go @@ -14,7 +14,9 @@ import ( ) const ( - deployModeEnv = "AGENT_DEPLOY_MODE" + ProductName = "Alloy" + + deployModeEnv = "ALLOY_DEPLOY_MODE" ) // settable by tests @@ -31,10 +33,10 @@ func Get() string { if len(metadata) > 0 { parenthesis = fmt.Sprintf(" (%s)", strings.Join(metadata, "; ")) } - return fmt.Sprintf("Alloy/%s%s", build.Version, parenthesis) + return fmt.Sprintf("%s/%s%s", ProductName, build.Version, parenthesis) } -// GetDeployMode returns our best-effort guess at the way Grafana Agent was deployed. +// GetDeployMode returns our best-effort guess at the way Grafana Alloy was deployed. func GetDeployMode() string { op := os.Getenv(deployModeEnv) // only return known modes. Use "binary" as a default catch-all. diff --git a/internal/useragent/useragent_test.go b/internal/useragent/useragent_test.go index f950c603be..9eb4a1a8e9 100644 --- a/internal/useragent/useragent_test.go +++ b/internal/useragent/useragent_test.go @@ -59,7 +59,7 @@ func TestUserAgent(t *testing.T) { Name: "brew", Expected: "Alloy/v1.2.3 (darwin; brew)", GOOS: "darwin", - Exe: "/opt/homebrew/bin/agent", + Exe: "/opt/homebrew/bin/alloy", }, } for _, tst := range tests { @@ -67,7 +67,7 @@ func TestUserAgent(t *testing.T) { if tst.Exe != "" { executable = func() (string, error) { return tst.Exe, nil } } else { - executable = func() (string, error) { return "/agent", nil } + executable = func() (string, error) { return "/alloy", nil } } goos = tst.GOOS t.Setenv(deployModeEnv, tst.DeployMode) diff --git a/internal/util/otel_feature_gate_test.go b/internal/util/otel_feature_gate_test.go index 6001adfe8e..89d5421b8a 100644 --- a/internal/util/otel_feature_gate_test.go +++ b/internal/util/otel_feature_gate_test.go @@ -28,7 +28,7 @@ func Test_FeatureGates(t *testing.T) { // 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. - require.Falsef(t, g.IsEnabled(), "feature gate %s is enabled - should it be removed from the Agent?", g.ID()) + require.Falsef(t, g.IsEnabled(), "feature gate %s is enabled - should it be removed from Alloy?", g.ID()) }) require.NoError(t, SetupOtelFeatureGates()) @@ -37,7 +37,7 @@ func Test_FeatureGates(t *testing.T) { if _, ok := fgSet[g.ID()]; !ok { return } - // Make sure that the Agent enabled the gate. + // Make sure that Alloy enabled the gate. require.True(t, g.IsEnabled()) }) } diff --git a/internal/web/ui/package.json b/internal/web/ui/package.json index ac422d7246..bb3050dec6 100644 --- a/internal/web/ui/package.json +++ b/internal/web/ui/package.json @@ -1,5 +1,5 @@ { - "name": "grafana-agent", + "name": "alloy", "private": true, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.4.0", diff --git a/internal/web/ui/public/index.html b/internal/web/ui/public/index.html index 11165b17c2..3cb735f867 100644 --- a/internal/web/ui/public/index.html +++ b/internal/web/ui/public/index.html @@ -16,7 +16,7 @@ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ --> - Grafana Agent + Grafana Alloy diff --git a/internal/web/ui/src/features/layout/Navbar.tsx b/internal/web/ui/src/features/layout/Navbar.tsx index 0fbc6b79f5..dcc409921f 100644 --- a/internal/web/ui/src/features/layout/Navbar.tsx +++ b/internal/web/ui/src/features/layout/Navbar.tsx @@ -9,7 +9,7 @@ function Navbar() { diff --git a/internal/web/ui/ui.go b/internal/web/ui/ui.go index 0083395995..9c83d86625 100644 --- a/internal/web/ui/ui.go +++ b/internal/web/ui/ui.go @@ -22,7 +22,7 @@ import ( // pathPrefix is specified, the UI will be served at root. // // By default, the UI is retrieved from the ./internal/web/ui/build directory -// relative to working directory, assuming that the Agent is run from the repo +// relative to working directory, assuming that Alloy is run from the repo // root. However, if the builtinassets Go tag is present, the built UI will be // embedded into the binary; run go generate -tags builtinassets for this // package to generate the assets to embed. diff --git a/main.go b/main.go index 53c9442b09..0512ece784 100644 --- a/main.go +++ b/main.go @@ -18,7 +18,7 @@ import ( ) func init() { - prometheus.MustRegister(build.NewCollector("agent")) + prometheus.MustRegister(build.NewCollector("alloy")) } func main() { diff --git a/operations/alloy-mixin/alerts/clustering.libsonnet b/operations/alloy-mixin/alerts/clustering.libsonnet index f77cc171a8..fb9a2ff286 100644 --- a/operations/alloy-mixin/alerts/clustering.libsonnet +++ b/operations/alloy-mixin/alerts/clustering.libsonnet @@ -57,7 +57,7 @@ alert.newGroup( 'ClusterConfigurationDrift', ||| count without (sha256) ( - max by (cluster, namespace, sha256) (agent_config_hash and on(cluster, namespace) cluster_node_info) + max by (cluster, namespace, sha256) (alloy_config_hash and on(cluster, namespace) cluster_node_info) ) > 1 |||, 'Cluster nodes are not using the same configuration file.', diff --git a/operations/alloy-mixin/alerts/controller.libsonnet b/operations/alloy-mixin/alerts/controller.libsonnet index b1c419a168..082a963f09 100644 --- a/operations/alloy-mixin/alerts/controller.libsonnet +++ b/operations/alloy-mixin/alerts/controller.libsonnet @@ -6,7 +6,7 @@ alert.newGroup( // Component evaluations are taking too long, which can lead to e.g. stale targets. alert.newRule( 'SlowComponentEvaluations', - 'sum by (cluster, namespace, component_id) (rate(agent_component_evaluation_slow_seconds[10m])) > 0', + 'sum by (cluster, namespace, component_id) (rate(alloy_component_evaluation_slow_seconds[10m])) > 0', 'Flow component evaluations are taking too long.', '15m', ), @@ -14,7 +14,7 @@ alert.newGroup( // Unhealthy components detected. alert.newRule( 'UnhealthyComponents', - 'sum by (cluster, namespace) (agent_component_controller_running_components{health_type!="healthy"}) > 0', + 'sum by (cluster, namespace) (alloy_component_controller_running_components{health_type!="healthy"}) > 0', 'Unhealthy Flow components detected.', '15m', ), diff --git a/operations/alloy-mixin/dashboards/cluster-node.libsonnet b/operations/alloy-mixin/dashboards/cluster-node.libsonnet index e7de6b5a12..9064f77dcc 100644 --- a/operations/alloy-mixin/dashboards/cluster-node.libsonnet +++ b/operations/alloy-mixin/dashboards/cluster-node.libsonnet @@ -13,13 +13,13 @@ local filename = 'alloy-cluster-node.json'; dashboard.withUID(std.md5(filename)) + dashboard.withTemplateVariablesMixin([ dashboard.newTemplateVariable('cluster', ||| - label_values(agent_component_controller_running_components, cluster) + label_values(alloy_component_controller_running_components, cluster) |||), dashboard.newTemplateVariable('namespace', ||| - label_values(agent_component_controller_running_components{cluster="$cluster"}, namespace) + label_values(alloy_component_controller_running_components{cluster="$cluster"}, namespace) |||), dashboard.newTemplateVariable('instance', ||| - label_values(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) + label_values(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) |||), ]) + // TODO(@tpaschalis) Make the annotation optional. diff --git a/operations/alloy-mixin/dashboards/cluster-overview.libsonnet b/operations/alloy-mixin/dashboards/cluster-overview.libsonnet index 6537020e9f..5010c25341 100644 --- a/operations/alloy-mixin/dashboards/cluster-overview.libsonnet +++ b/operations/alloy-mixin/dashboards/cluster-overview.libsonnet @@ -14,10 +14,10 @@ local cluster_node_filename = 'alloy-cluster-node.json'; dashboard.withUID(std.md5(filename)) + dashboard.withTemplateVariablesMixin([ dashboard.newTemplateVariable('cluster', ||| - label_values(agent_component_controller_running_components, cluster) + label_values(alloy_component_controller_running_components, cluster) |||), dashboard.newTemplateVariable('namespace', ||| - label_values(agent_component_controller_running_components{cluster="$cluster"}, namespace) + label_values(alloy_component_controller_running_components{cluster="$cluster"}, namespace) |||), ]) + // TODO(@tpaschalis) Make the annotation optional. diff --git a/operations/alloy-mixin/dashboards/controller.libsonnet b/operations/alloy-mixin/dashboards/controller.libsonnet index a55b56a3fa..025465269e 100644 --- a/operations/alloy-mixin/dashboards/controller.libsonnet +++ b/operations/alloy-mixin/dashboards/controller.libsonnet @@ -13,10 +13,10 @@ local filename = 'alloy-controller.json'; dashboard.withUID(std.md5(filename)) + dashboard.withTemplateVariablesMixin([ dashboard.newTemplateVariable('cluster', ||| - label_values(agent_component_controller_running_components, cluster) + label_values(alloy_component_controller_running_components, cluster) |||), dashboard.newTemplateVariable('namespace', ||| - label_values(agent_component_controller_running_components{cluster="$cluster"}, namespace) + label_values(alloy_component_controller_running_components{cluster="$cluster"}, namespace) |||), ]) + // TODO(@tpaschalis) Make the annotation optional. @@ -34,7 +34,7 @@ local filename = 'alloy-controller.json'; panel.withPosition({ x: 0, y: 0, w: 10, h: 4 }) + panel.withQueries([ panel.newQuery( - expr='count(agent_component_controller_evaluating{cluster="$cluster", namespace="$namespace"})', + expr='count(alloy_component_controller_evaluating{cluster="$cluster", namespace="$namespace"})', ), ]) ), @@ -49,7 +49,7 @@ local filename = 'alloy-controller.json'; panel.withPosition({ x: 0, y: 4, w: 10, h: 4 }) + panel.withQueries([ panel.newQuery( - expr='sum(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace"})', + expr='sum(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace"})', ), ]) ), @@ -73,8 +73,8 @@ local filename = 'alloy-controller.json'; panel.withQueries([ panel.newQuery( expr=||| - sum(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace",health_type="healthy"}) / - sum(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace"}) + sum(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace",health_type="healthy"}) / + sum(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace"}) |||, ), ]) @@ -157,19 +157,19 @@ local filename = 'alloy-controller.json'; panel.withQueries([ panel.newInstantQuery( legendFormat='Healthy', - expr='sum(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace", health_type="healthy"}) or vector(0)', + expr='sum(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace", health_type="healthy"}) or vector(0)', ), panel.newInstantQuery( legendFormat='Unhealthy', - expr='sum(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace", health_type="unhealthy"}) or vector(0)', + expr='sum(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace", health_type="unhealthy"}) or vector(0)', ), panel.newInstantQuery( legendFormat='Unknown', - expr='sum(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace", health_type="unknown"}) or vector(0)', + expr='sum(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace", health_type="unknown"}) or vector(0)', ), panel.newInstantQuery( legendFormat='Exited', - expr='sum(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace", health_type="exited"}) or vector(0)', + expr='sum(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace", health_type="exited"}) or vector(0)', ), ]) ), @@ -194,7 +194,7 @@ local filename = 'alloy-controller.json'; panel.withMultiTooltip() + panel.withQueries([ panel.newQuery( - expr='sum by (instance) (rate(agent_component_evaluation_seconds_count{cluster="$cluster", namespace="$namespace"}[$__rate_interval]))', + expr='sum by (instance) (rate(alloy_component_evaluation_seconds_count{cluster="$cluster", namespace="$namespace"}[$__rate_interval]))', ), ]) ), @@ -219,30 +219,30 @@ local filename = 'alloy-controller.json'; panel.withQueries([ panel.newQuery( expr=||| - histogram_quantile(0.99, sum(rate(agent_component_evaluation_seconds{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) + histogram_quantile(0.99, sum(rate(alloy_component_evaluation_seconds{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) or - histogram_quantile(0.99, sum by (le) (rate(agent_component_evaluation_seconds_bucket{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) + histogram_quantile(0.99, sum by (le) (rate(alloy_component_evaluation_seconds_bucket{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) |||, legendFormat='99th percentile', ), panel.newQuery( expr=||| - histogram_quantile(0.50, sum(rate(agent_component_evaluation_seconds{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) + histogram_quantile(0.50, sum(rate(alloy_component_evaluation_seconds{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) or - histogram_quantile(0.50, sum by (le) (rate(agent_component_evaluation_seconds_bucket{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) + histogram_quantile(0.50, sum by (le) (rate(alloy_component_evaluation_seconds_bucket{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) |||, legendFormat='50th percentile', ), panel.newQuery( expr=||| ( - histogram_sum(sum(rate(agent_component_evaluation_seconds{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) / - histogram_count(sum(rate(agent_component_evaluation_seconds{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) + histogram_sum(sum(rate(alloy_component_evaluation_seconds{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) / + histogram_count(sum(rate(alloy_component_evaluation_seconds{cluster="$cluster",namespace="$namespace"}[$__rate_interval]))) ) or ( - sum(rate(agent_component_evaluation_seconds_sum{cluster="$cluster",namespace="$namespace"}[$__rate_interval])) / - sum(rate(agent_component_evaluation_seconds_count{cluster="$cluster",namespace="$namespace"}[$__rate_interval])) + sum(rate(alloy_component_evaluation_seconds_sum{cluster="$cluster",namespace="$namespace"}[$__rate_interval])) / + sum(rate(alloy_component_evaluation_seconds_count{cluster="$cluster",namespace="$namespace"}[$__rate_interval])) ) |||, legendFormat='Average', @@ -264,8 +264,8 @@ local filename = 'alloy-controller.json'; panel.withQueries([ panel.newQuery( expr=||| - sum by (component_id) (rate(agent_component_evaluation_slow_seconds{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) - / scalar(sum(rate(agent_component_evaluation_seconds_sum{cluster="$cluster", namespace="$namespace"}[$__rate_interval]))) + sum by (component_id) (rate(alloy_component_evaluation_slow_seconds{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) + / scalar(sum(rate(alloy_component_evaluation_seconds_sum{cluster="$cluster", namespace="$namespace"}[$__rate_interval]))) |||, legendFormat='{{component_id}}', ), @@ -287,9 +287,9 @@ local filename = 'alloy-controller.json'; panel.withQueries([ panel.newQuery( expr=||| - sum(increase(agent_component_evaluation_seconds{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) + sum(increase(alloy_component_evaluation_seconds{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) or ignoring (le) - sum by (le) (increase(agent_component_evaluation_seconds_bucket{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) + sum by (le) (increase(alloy_component_evaluation_seconds_bucket{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) |||, format='heatmap', legendFormat='{{le}}', @@ -312,9 +312,9 @@ local filename = 'alloy-controller.json'; panel.withQueries([ panel.newQuery( expr=||| - sum(increase(agent_component_dependencies_wait_seconds{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) + sum(increase(alloy_component_dependencies_wait_seconds{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) or ignoring (le) - sum by (le) (increase(agent_component_dependencies_wait_seconds_bucket{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) + sum by (le) (increase(alloy_component_dependencies_wait_seconds_bucket{cluster="$cluster", namespace="$namespace"}[$__rate_interval])) |||, format='heatmap', legendFormat='{{le}}', diff --git a/operations/alloy-mixin/dashboards/opentelemetry.libsonnet b/operations/alloy-mixin/dashboards/opentelemetry.libsonnet index 9ba72856b8..04aa577186 100644 --- a/operations/alloy-mixin/dashboards/opentelemetry.libsonnet +++ b/operations/alloy-mixin/dashboards/opentelemetry.libsonnet @@ -21,13 +21,13 @@ local stackedPanelMixin = { dashboard.withUID(std.md5(filename)) + dashboard.withTemplateVariablesMixin([ dashboard.newTemplateVariable('cluster', ||| - label_values(agent_component_controller_running_components, cluster) + label_values(alloy_component_controller_running_components, cluster) |||), dashboard.newTemplateVariable('namespace', ||| - label_values(agent_component_controller_running_components{cluster="$cluster"}, namespace) + label_values(alloy_component_controller_running_components{cluster="$cluster"}, namespace) |||), dashboard.newMultiTemplateVariable('instance', ||| - label_values(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) + label_values(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) |||), ]) + dashboard.withPanelsMixin([ diff --git a/operations/alloy-mixin/dashboards/prometheus.libsonnet b/operations/alloy-mixin/dashboards/prometheus.libsonnet index 0242388cb5..94dd0856d2 100644 --- a/operations/alloy-mixin/dashboards/prometheus.libsonnet +++ b/operations/alloy-mixin/dashboards/prometheus.libsonnet @@ -333,7 +333,7 @@ local remoteWritePanels(y_offset) = [ panel.withQueries([ panel.newQuery( expr=||| - sum(agent_wal_storage_active_series{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id=~"$component", url=~"$url"}) + sum(prometheus_remote_write_wal_storage_active_series{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id=~"$component", url=~"$url"}) |||, legendFormat='Series', ), @@ -356,7 +356,7 @@ local remoteWritePanels(y_offset) = [ panel.withQueries([ panel.newQuery( expr=||| - agent_wal_storage_active_series{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id!="", component_id=~"$component", url=~"$url"} + prometheus_remote_write_wal_storage_active_series{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id!="", component_id=~"$component", url=~"$url"} |||, legendFormat='{{instance}} / {{component_id}}', ), @@ -379,7 +379,7 @@ local remoteWritePanels(y_offset) = [ panel.withQueries([ panel.newQuery( expr=||| - sum by (component_id) (agent_wal_storage_active_series{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id!="", component_id=~"$component", url=~"$url"}) + sum by (component_id) (prometheus_remote_write_wal_storage_active_series{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id!="", component_id=~"$component", url=~"$url"}) |||, legendFormat='{{component_id}}', ), @@ -398,16 +398,16 @@ local remoteWritePanels(y_offset) = [ dashboard.withUID(std.md5(filename)) + dashboard.withTemplateVariablesMixin([ dashboard.newTemplateVariable('cluster', ||| - label_values(agent_component_controller_running_components, cluster) + label_values(alloy_component_controller_running_components, cluster) |||), dashboard.newTemplateVariable('namespace', ||| - label_values(agent_component_controller_running_components{cluster="$cluster"}, namespace) + label_values(alloy_component_controller_running_components{cluster="$cluster"}, namespace) |||), dashboard.newMultiTemplateVariable('instance', ||| - label_values(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) + label_values(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) |||), dashboard.newMultiTemplateVariable('component', ||| - label_values(agent_wal_samples_appended_total{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id=~"prometheus\\.remote_write\\..*"}, component_id) + label_values(prometheus_remote_write_wal_samples_appended_total{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id=~"prometheus\\.remote_write\\..*"}, component_id) |||), dashboard.newMultiTemplateVariable('url', ||| label_values(prometheus_remote_storage_sent_batch_duration_seconds_sum{cluster="$cluster", namespace="$namespace", instance=~"$instance", component_id=~"$component"}, url) diff --git a/operations/alloy-mixin/dashboards/resources.libsonnet b/operations/alloy-mixin/dashboards/resources.libsonnet index e1cd7a6209..aea409e140 100644 --- a/operations/alloy-mixin/dashboards/resources.libsonnet +++ b/operations/alloy-mixin/dashboards/resources.libsonnet @@ -33,13 +33,13 @@ local stackedPanelMixin = { dashboard.withUID(std.md5(filename)) + dashboard.withTemplateVariablesMixin([ dashboard.newTemplateVariable('cluster', ||| - label_values(agent_component_controller_running_components, cluster) + label_values(alloy_component_controller_running_components, cluster) |||), dashboard.newTemplateVariable('namespace', ||| - label_values(agent_component_controller_running_components{cluster="$cluster"}, namespace) + label_values(alloy_component_controller_running_components{cluster="$cluster"}, namespace) |||), dashboard.newMultiTemplateVariable('instance', ||| - label_values(agent_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) + label_values(alloy_component_controller_running_components{cluster="$cluster", namespace="$namespace"}, instance) |||), ]) + // TODO(@tpaschalis) Make the annotation optional. @@ -59,7 +59,7 @@ local stackedPanelMixin = { panel.withPosition({ x: 0, y: 0, w: 12, h: 8 }) + panel.withQueries([ panel.newQuery( - expr='rate(agent_resources_process_cpu_seconds_total{cluster="$cluster",namespace="$namespace",instance=~"$instance"}[$__rate_interval])', + expr='rate(alloy_resources_process_cpu_seconds_total{cluster="$cluster",namespace="$namespace",instance=~"$instance"}[$__rate_interval])', legendFormat='{{instance}}' ), ]) @@ -75,7 +75,7 @@ local stackedPanelMixin = { panel.withPosition({ x: 12, y: 0, w: 12, h: 8 }) + panel.withQueries([ panel.newQuery( - expr='agent_resources_process_resident_memory_bytes{cluster="$cluster",namespace="$namespace",instance=~"$instance"}', + expr='alloy_resources_process_resident_memory_bytes{cluster="$cluster",namespace="$namespace",instance=~"$instance"}', legendFormat='{{instance}}' ), ]) @@ -94,11 +94,11 @@ local stackedPanelMixin = { panel.newQuery( // Lots of programs export go_goroutines so we ignore anything that // doesn't also have an Alloy-specific metric (i.e., - // agent_build_info). + // alloy_build_info). expr=||| rate(go_gc_duration_seconds_count{cluster="$cluster",namespace="$namespace",instance=~"$instance"}[5m]) and on(instance) - agent_build_info{cluster="$cluster",namespace="$namespace",instance=~"$instance"} + alloy_build_info{cluster="$cluster",namespace="$namespace",instance=~"$instance"} |||, legendFormat='{{instance}}' ), @@ -118,11 +118,11 @@ local stackedPanelMixin = { panel.newQuery( // Lots of programs export go_goroutines so we ignore anything that // doesn't also have an Alloy-specific metric (i.e., - // agent_build_info). + // alloy_build_info). expr=||| go_goroutines{cluster="$cluster",namespace="$namespace",instance=~"$instance"} and on(instance) - agent_build_info{cluster="$cluster",namespace="$namespace",instance=~"$instance"} + alloy_build_info{cluster="$cluster",namespace="$namespace",instance=~"$instance"} |||, legendFormat='{{instance}}' ), @@ -141,11 +141,11 @@ local stackedPanelMixin = { panel.newQuery( // Lots of programs export go_memstats_heap_inuse_bytes so we ignore // anything that doesn't also have an Alloy-specific metric - // (i.e., agent_build_info). + // (i.e., alloy_build_info). expr=||| go_memstats_heap_inuse_bytes{cluster="$cluster",namespace="$namespace",instance=~"$instance"} and on(instance) - agent_build_info{cluster="$cluster",namespace="$namespace",instance=~"$instance"} + alloy_build_info{cluster="$cluster",namespace="$namespace",instance=~"$instance"} |||, legendFormat='{{instance}}' ), @@ -168,7 +168,7 @@ local stackedPanelMixin = { panel.withQueries([ panel.newQuery( expr=||| - rate(agent_resources_machine_rx_bytes_total{cluster="$cluster",namespace="$namespace",instance=~"$instance"}[$__rate_interval]) + rate(alloy_resources_machine_rx_bytes_total{cluster="$cluster",namespace="$namespace",instance=~"$instance"}[$__rate_interval]) |||, legendFormat='{{instance}}' ), @@ -191,7 +191,7 @@ local stackedPanelMixin = { panel.withQueries([ panel.newQuery( expr=||| - rate(agent_resources_machine_tx_bytes_total{cluster="$cluster",namespace="$namespace",instance=~"$instance"}[$__rate_interval]) + rate(alloy_resources_machine_tx_bytes_total{cluster="$cluster",namespace="$namespace",instance=~"$instance"}[$__rate_interval]) |||, legendFormat='{{instance}}' ), diff --git a/operations/helm/charts/alloy/templates/containers/_agent.yaml b/operations/helm/charts/alloy/templates/containers/_agent.yaml index 496a167ee0..a60508a09b 100644 --- a/operations/helm/charts/alloy/templates/containers/_agent.yaml +++ b/operations/helm/charts/alloy/templates/containers/_agent.yaml @@ -20,7 +20,7 @@ - {{ . }} {{- end}} env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/additional-serviceaccount-label/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/additional-serviceaccount-label/alloy/templates/controllers/daemonset.yaml index ca587b7b9c..f8e29f2fa1 100644 --- a/operations/helm/tests/additional-serviceaccount-label/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/additional-serviceaccount-label/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/clustering/alloy/templates/controllers/statefulset.yaml b/operations/helm/tests/clustering/alloy/templates/controllers/statefulset.yaml index b0c6c4b829..490b6c4bf5 100644 --- a/operations/helm/tests/clustering/alloy/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/clustering/alloy/templates/controllers/statefulset.yaml @@ -41,7 +41,7 @@ spec: - --cluster.enabled=true - --cluster.join-addresses=alloy-cluster env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/controller-volumes-extra/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/controller-volumes-extra/alloy/templates/controllers/daemonset.yaml index 0e09b6a17c..f350672349 100644 --- a/operations/helm/tests/controller-volumes-extra/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/controller-volumes-extra/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/create-daemonset-hostnetwork/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/create-daemonset-hostnetwork/alloy/templates/controllers/daemonset.yaml index 278ac6f3c8..e5d86cdcb3 100644 --- a/operations/helm/tests/create-daemonset-hostnetwork/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/create-daemonset-hostnetwork/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/create-daemonset/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/create-daemonset/alloy/templates/controllers/daemonset.yaml index ca587b7b9c..f8e29f2fa1 100644 --- a/operations/helm/tests/create-daemonset/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/create-daemonset/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/create-deployment-autoscaling/alloy/templates/controllers/deployment.yaml b/operations/helm/tests/create-deployment-autoscaling/alloy/templates/controllers/deployment.yaml index 3c4deb3a92..91f7b8b8bb 100644 --- a/operations/helm/tests/create-deployment-autoscaling/alloy/templates/controllers/deployment.yaml +++ b/operations/helm/tests/create-deployment-autoscaling/alloy/templates/controllers/deployment.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/create-deployment/alloy/templates/controllers/deployment.yaml b/operations/helm/tests/create-deployment/alloy/templates/controllers/deployment.yaml index 918ea5f642..a79782476e 100644 --- a/operations/helm/tests/create-deployment/alloy/templates/controllers/deployment.yaml +++ b/operations/helm/tests/create-deployment/alloy/templates/controllers/deployment.yaml @@ -37,7 +37,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/create-statefulset-autoscaling/alloy/templates/controllers/statefulset.yaml b/operations/helm/tests/create-statefulset-autoscaling/alloy/templates/controllers/statefulset.yaml index 978d9a7f80..79d4926665 100644 --- a/operations/helm/tests/create-statefulset-autoscaling/alloy/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/create-statefulset-autoscaling/alloy/templates/controllers/statefulset.yaml @@ -38,7 +38,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/create-statefulset/alloy/templates/controllers/statefulset.yaml b/operations/helm/tests/create-statefulset/alloy/templates/controllers/statefulset.yaml index 9598e99438..0042785594 100644 --- a/operations/helm/tests/create-statefulset/alloy/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/create-statefulset/alloy/templates/controllers/statefulset.yaml @@ -39,7 +39,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/custom-config/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/custom-config/alloy/templates/controllers/daemonset.yaml index ca587b7b9c..f8e29f2fa1 100644 --- a/operations/helm/tests/custom-config/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/custom-config/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/default-values/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/default-values/alloy/templates/controllers/daemonset.yaml index ca587b7b9c..f8e29f2fa1 100644 --- a/operations/helm/tests/default-values/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/default-values/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/enable-servicemonitor-tls/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/enable-servicemonitor-tls/alloy/templates/controllers/daemonset.yaml index 8d60204d1d..eb136d445a 100644 --- a/operations/helm/tests/enable-servicemonitor-tls/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/enable-servicemonitor-tls/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/enable-servicemonitor/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/enable-servicemonitor/alloy/templates/controllers/daemonset.yaml index ca587b7b9c..f8e29f2fa1 100644 --- a/operations/helm/tests/enable-servicemonitor/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/enable-servicemonitor/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/envFrom/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/envFrom/alloy/templates/controllers/daemonset.yaml index 605f24ed6d..3cc9a1898b 100644 --- a/operations/helm/tests/envFrom/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/envFrom/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/existing-config/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/existing-config/alloy/templates/controllers/daemonset.yaml index 596d8a71c1..8c46e62aae 100644 --- a/operations/helm/tests/existing-config/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/existing-config/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/extra-env/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/extra-env/alloy/templates/controllers/daemonset.yaml index 5198946515..22ae1a88db 100644 --- a/operations/helm/tests/extra-env/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/extra-env/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/extra-ports/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/extra-ports/alloy/templates/controllers/daemonset.yaml index 5cf9738e87..58a11aa88a 100644 --- a/operations/helm/tests/extra-ports/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/extra-ports/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/faro-ingress/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/faro-ingress/alloy/templates/controllers/daemonset.yaml index 1e55d3b51a..b19b62ea83 100644 --- a/operations/helm/tests/faro-ingress/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/faro-ingress/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/global-image-pullsecrets/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/global-image-pullsecrets/alloy/templates/controllers/daemonset.yaml index 7764c5c163..21154f8c2d 100644 --- a/operations/helm/tests/global-image-pullsecrets/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/global-image-pullsecrets/alloy/templates/controllers/daemonset.yaml @@ -41,7 +41,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/global-image-registry/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/global-image-registry/alloy/templates/controllers/daemonset.yaml index a6b6c4a8b7..6bd42bbd2a 100644 --- a/operations/helm/tests/global-image-registry/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/global-image-registry/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/initcontainers/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/initcontainers/alloy/templates/controllers/daemonset.yaml index 7ec77a461f..56707bbf93 100644 --- a/operations/helm/tests/initcontainers/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/initcontainers/alloy/templates/controllers/daemonset.yaml @@ -54,7 +54,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/local-image-pullsecrets/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/local-image-pullsecrets/alloy/templates/controllers/daemonset.yaml index a33405935e..b31b89a51a 100644 --- a/operations/helm/tests/local-image-pullsecrets/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/local-image-pullsecrets/alloy/templates/controllers/daemonset.yaml @@ -38,7 +38,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/local-image-registry/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/local-image-registry/alloy/templates/controllers/daemonset.yaml index a6b6c4a8b7..6bd42bbd2a 100644 --- a/operations/helm/tests/local-image-registry/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/local-image-registry/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/nodeselectors-and-tolerations/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/nodeselectors-and-tolerations/alloy/templates/controllers/daemonset.yaml index 308fa65407..083edf01ec 100644 --- a/operations/helm/tests/nodeselectors-and-tolerations/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/nodeselectors-and-tolerations/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/pod_annotations/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/pod_annotations/alloy/templates/controllers/daemonset.yaml index c8e328b3d9..261bbe66a3 100644 --- a/operations/helm/tests/pod_annotations/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/pod_annotations/alloy/templates/controllers/daemonset.yaml @@ -37,7 +37,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/sidecars/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/sidecars/alloy/templates/controllers/daemonset.yaml index 20629a6661..7519b87602 100644 --- a/operations/helm/tests/sidecars/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/sidecars/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/topologyspreadconstraints/alloy/templates/controllers/deployment.yaml b/operations/helm/tests/topologyspreadconstraints/alloy/templates/controllers/deployment.yaml index 7cd624885e..7aa128e90a 100644 --- a/operations/helm/tests/topologyspreadconstraints/alloy/templates/controllers/deployment.yaml +++ b/operations/helm/tests/topologyspreadconstraints/alloy/templates/controllers/deployment.yaml @@ -37,7 +37,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/operations/helm/tests/with-digests/alloy/templates/controllers/daemonset.yaml b/operations/helm/tests/with-digests/alloy/templates/controllers/daemonset.yaml index 4418f7f17a..22c1e1cd23 100644 --- a/operations/helm/tests/with-digests/alloy/templates/controllers/daemonset.yaml +++ b/operations/helm/tests/with-digests/alloy/templates/controllers/daemonset.yaml @@ -36,7 +36,7 @@ spec: - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ env: - - name: AGENT_DEPLOY_MODE + - name: ALLOY_DEPLOY_MODE value: "helm" - name: HOSTNAME valueFrom: diff --git a/packaging/deb/alloy.service b/packaging/deb/alloy.service index d525e159e5..c924dc1308 100644 --- a/packaging/deb/alloy.service +++ b/packaging/deb/alloy.service @@ -8,7 +8,7 @@ After=network-online.target Restart=always User=alloy Environment=HOSTNAME=%H -Environment=AGENT_DEPLOY_MODE=deb +Environment=ALLOY_DEPLOY_MODE=deb EnvironmentFile=/etc/default/alloy WorkingDirectory=/var/lib/alloy ExecStart=/usr/bin/alloy run $CUSTOM_ARGS --storage.path=/var/lib/alloy $CONFIG_FILE diff --git a/packaging/rpm/alloy.service b/packaging/rpm/alloy.service index c42dcb6a6a..192bacd884 100644 --- a/packaging/rpm/alloy.service +++ b/packaging/rpm/alloy.service @@ -8,7 +8,7 @@ After=network-online.target Restart=always User=alloy Environment=HOSTNAME=%H -Environment=AGENT_DEPLOY_MODE=rpm +Environment=ALLOY_DEPLOY_MODE=rpm EnvironmentFile=/etc/sysconfig/alloy WorkingDirectory=/var/lib/alloy ExecStart=/usr/bin/alloy run $CUSTOM_ARGS --storage.path=/var/lib/alloy $CONFIG_FILE