From ec5c806f9e23989741a5238bf3cd2ec9b726f4e8 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Mon, 25 Mar 2024 16:49:55 -0400 Subject: [PATCH 1/5] internal: rename flowmode to alloycli The flowmode package was originally the CLI for flow mode. As "flow mode" no longer exists as a concept, the package needs a more fitting name. --- cmd/alloy/main.go | 4 ++-- internal/{flowmode => alloycli}/cluster_builder.go | 2 +- internal/{flowmode => alloycli}/cluster_builder_test.go | 2 +- internal/{flowmode => alloycli}/cmd_convert.go | 2 +- internal/{flowmode => alloycli}/cmd_convert_test.go | 2 +- internal/{flowmode => alloycli}/cmd_fmt.go | 2 +- internal/{flowmode => alloycli}/cmd_run.go | 2 +- internal/{flowmode => alloycli}/cmd_tools.go | 2 +- internal/{flowmode => alloycli}/flowmode.go | 4 ++-- internal/{flowmode => alloycli}/resources_collector.go | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) rename internal/{flowmode => alloycli}/cluster_builder.go (99%) rename internal/{flowmode => alloycli}/cluster_builder_test.go (95%) rename internal/{flowmode => alloycli}/cmd_convert.go (99%) rename internal/{flowmode => alloycli}/cmd_convert_test.go (99%) rename internal/{flowmode => alloycli}/cmd_fmt.go (99%) rename internal/{flowmode => alloycli}/cmd_run.go (99%) rename internal/{flowmode => alloycli}/cmd_tools.go (97%) rename internal/{flowmode => alloycli}/flowmode.go (89%) rename internal/{flowmode => alloycli}/resources_collector.go (99%) diff --git a/cmd/alloy/main.go b/cmd/alloy/main.go index ec6bee2895..53c9442b09 100644 --- a/cmd/alloy/main.go +++ b/cmd/alloy/main.go @@ -1,8 +1,8 @@ package main import ( + "github.com/grafana/alloy/internal/alloycli" "github.com/grafana/alloy/internal/build" - "github.com/grafana/alloy/internal/flowmode" "github.com/prometheus/client_golang/prometheus" // Register Prometheus SD components @@ -22,5 +22,5 @@ func init() { } func main() { - flowmode.Run() + alloycli.Run() } diff --git a/internal/flowmode/cluster_builder.go b/internal/alloycli/cluster_builder.go similarity index 99% rename from internal/flowmode/cluster_builder.go rename to internal/alloycli/cluster_builder.go index 292f04c947..ab85490b88 100644 --- a/internal/flowmode/cluster_builder.go +++ b/internal/alloycli/cluster_builder.go @@ -1,4 +1,4 @@ -package flowmode +package alloycli import ( "fmt" diff --git a/internal/flowmode/cluster_builder_test.go b/internal/alloycli/cluster_builder_test.go similarity index 95% rename from internal/flowmode/cluster_builder_test.go rename to internal/alloycli/cluster_builder_test.go index d8dad09a6f..2da42c6633 100644 --- a/internal/flowmode/cluster_builder_test.go +++ b/internal/alloycli/cluster_builder_test.go @@ -1,4 +1,4 @@ -package flowmode +package alloycli import ( "testing" diff --git a/internal/flowmode/cmd_convert.go b/internal/alloycli/cmd_convert.go similarity index 99% rename from internal/flowmode/cmd_convert.go rename to internal/alloycli/cmd_convert.go index e7c77b82e4..c40e52f5ca 100644 --- a/internal/flowmode/cmd_convert.go +++ b/internal/alloycli/cmd_convert.go @@ -1,4 +1,4 @@ -package flowmode +package alloycli import ( "bytes" diff --git a/internal/flowmode/cmd_convert_test.go b/internal/alloycli/cmd_convert_test.go similarity index 99% rename from internal/flowmode/cmd_convert_test.go rename to internal/alloycli/cmd_convert_test.go index 4871a8d2b9..facad695d3 100644 --- a/internal/flowmode/cmd_convert_test.go +++ b/internal/alloycli/cmd_convert_test.go @@ -1,4 +1,4 @@ -package flowmode +package alloycli import ( "testing" diff --git a/internal/flowmode/cmd_fmt.go b/internal/alloycli/cmd_fmt.go similarity index 99% rename from internal/flowmode/cmd_fmt.go rename to internal/alloycli/cmd_fmt.go index a8251cd58b..bbf6f30bbf 100644 --- a/internal/flowmode/cmd_fmt.go +++ b/internal/alloycli/cmd_fmt.go @@ -1,4 +1,4 @@ -package flowmode +package alloycli import ( "bytes" diff --git a/internal/flowmode/cmd_run.go b/internal/alloycli/cmd_run.go similarity index 99% rename from internal/flowmode/cmd_run.go rename to internal/alloycli/cmd_run.go index fa37b1cac9..8ca304f87c 100644 --- a/internal/flowmode/cmd_run.go +++ b/internal/alloycli/cmd_run.go @@ -1,4 +1,4 @@ -package flowmode +package alloycli import ( "context" diff --git a/internal/flowmode/cmd_tools.go b/internal/alloycli/cmd_tools.go similarity index 97% rename from internal/flowmode/cmd_tools.go rename to internal/alloycli/cmd_tools.go index 3fdca9d1e0..ff499156af 100644 --- a/internal/flowmode/cmd_tools.go +++ b/internal/alloycli/cmd_tools.go @@ -1,4 +1,4 @@ -package flowmode +package alloycli import ( "fmt" diff --git a/internal/flowmode/flowmode.go b/internal/alloycli/flowmode.go similarity index 89% rename from internal/flowmode/flowmode.go rename to internal/alloycli/flowmode.go index 0c588fa15f..f63c99d5b3 100644 --- a/internal/flowmode/flowmode.go +++ b/internal/alloycli/flowmode.go @@ -1,5 +1,5 @@ -// Package flowmode is the entrypoint for Grafana Agent Flow. -package flowmode +// Package alloycli is the entrypoint for Grafana Alloy. +package alloycli import ( "fmt" diff --git a/internal/flowmode/resources_collector.go b/internal/alloycli/resources_collector.go similarity index 99% rename from internal/flowmode/resources_collector.go rename to internal/alloycli/resources_collector.go index c972c2cd1d..33ffa4d9d3 100644 --- a/internal/flowmode/resources_collector.go +++ b/internal/alloycli/resources_collector.go @@ -1,4 +1,4 @@ -package flowmode +package alloycli import ( "os" From 1ded1c0e728e6207a7d88bb58fc41e5de0e55a7c Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Mon, 25 Mar 2024 16:54:32 -0400 Subject: [PATCH 2/5] alloycli: remove references to Flow Remove all user-facing references to Flow in alloycli with "Alloy." --- docs/sources/reference/cli/run.md | 4 ++-- internal/alloycli/cmd_convert.go | 10 ++++---- internal/alloycli/cmd_fmt.go | 6 ++--- internal/alloycli/cmd_run.go | 38 +++++++++++++++---------------- internal/alloycli/cmd_tools.go | 4 ++-- internal/alloycli/flowmode.go | 6 ++--- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/sources/reference/cli/run.md b/docs/sources/reference/cli/run.md index 642fe6b9bf..5777903bd6 100644 --- a/docs/sources/reference/cli/run.md +++ b/docs/sources/reference/cli/run.md @@ -51,7 +51,7 @@ The following flags are supported: * `--cluster.advertise-interfaces`: List of interfaces used to infer an address to advertise. Set to `all` to use all available network interfaces on the system. (default `"eth0,en0"`). * `--cluster.max-join-peers`: Number of peers to join from the discovered set (default `5`). * `--cluster.name`: Name to prevent nodes without this identifier from joining the cluster (default `""`). -* `--config.format`: The format of the source file. Supported formats: `flow`, `prometheus`, `promtail`, `static` (default `"flow"`). +* `--config.format`: The format of the source file. Supported formats: `alloy`, `prometheus`, `promtail`, `static` (default `"alloy"`). * `--config.bypass-conversion-errors`: Enable bypassing errors when converting (default `false`). * `--config.extra-args`: Extra arguments from the original format used by the converter. @@ -128,7 +128,7 @@ The current state of a clustered {{< param "PRODUCT_ROOT_NAME" >}} is shown on t ## Configuration conversion (beta) -When you use the `--config.format` command-line argument with a value other than `flow`, {{< param "PRODUCT_ROOT_NAME" >}} converts the configuration file from the source format to River and immediately starts running with the new configuration. +When you use the `--config.format` command-line argument with a value other than `alloy`, {{< param "PRODUCT_ROOT_NAME" >}} converts the configuration file from the source format to River and immediately starts running with the new configuration. This conversion uses the converter API described in the [grafana-alloy convert][] docs. If you include the `--config.bypass-conversion-errors` command-line argument, diff --git a/internal/alloycli/cmd_convert.go b/internal/alloycli/cmd_convert.go index c40e52f5ca..aa6ca51474 100644 --- a/internal/alloycli/cmd_convert.go +++ b/internal/alloycli/cmd_convert.go @@ -17,7 +17,7 @@ import ( ) func convertCommand() *cobra.Command { - f := &flowConvert{ + f := &alloyConvert{ output: "", sourceFormat: "", bypassErrors: false, @@ -81,7 +81,7 @@ by separating them with a space.`, return cmd } -type flowConvert struct { +type alloyConvert struct { output string report string sourceFormat string @@ -89,7 +89,7 @@ type flowConvert struct { extraArgs string } -func (fc *flowConvert) Run(configFile string) error { +func (fc *alloyConvert) Run(configFile string) error { if fc.sourceFormat == "" { return fmt.Errorf("source-format is a required flag") } @@ -114,7 +114,7 @@ func (fc *flowConvert) Run(configFile string) error { return convert(f, fc) } -func convert(r io.Reader, fc *flowConvert) error { +func convert(r io.Reader, fc *alloyConvert) error { inputBytes, err := io.ReadAll(r) if err != nil { return err @@ -155,7 +155,7 @@ func convert(r io.Reader, fc *flowConvert) error { return err } -func generateConvertReport(diags convert_diag.Diagnostics, fc *flowConvert) error { +func generateConvertReport(diags convert_diag.Diagnostics, fc *alloyConvert) error { if fc.report != "" { file, err := os.Create(fc.report) if err != nil { diff --git a/internal/alloycli/cmd_fmt.go b/internal/alloycli/cmd_fmt.go index bbf6f30bbf..668b87986b 100644 --- a/internal/alloycli/cmd_fmt.go +++ b/internal/alloycli/cmd_fmt.go @@ -15,7 +15,7 @@ import ( ) func fmtCommand() *cobra.Command { - f := &flowFmt{ + f := &alloyFmt{ write: false, } @@ -58,11 +58,11 @@ The -w flag can be used to write the formatted file back to disk. -w can not be return cmd } -type flowFmt struct { +type alloyFmt struct { write bool } -func (ff *flowFmt) Run(configFile string) error { +func (ff *alloyFmt) Run(configFile string) error { switch configFile { case "-": if ff.write { diff --git a/internal/alloycli/cmd_run.go b/internal/alloycli/cmd_run.go index 8ca304f87c..aff557cff0 100644 --- a/internal/alloycli/cmd_run.go +++ b/internal/alloycli/cmd_run.go @@ -48,7 +48,7 @@ import ( ) func runCommand() *cobra.Command { - r := &flowRun{ + r := &alloyRun{ inMemoryAddr: "agent.internal:12345", httpListenAddr: "127.0.0.1:12345", storagePath: "data-agent/", @@ -56,7 +56,7 @@ func runCommand() *cobra.Command { uiPrefix: "/", disableReporting: false, enablePprof: true, - configFormat: "flow", + configFormat: "alloy", clusterAdvInterfaces: advertise.DefaultInterfaces, ClusterMaxJoinPeers: 5, clusterRejoinInterval: 60 * time.Second, @@ -64,8 +64,8 @@ func runCommand() *cobra.Command { cmd := &cobra.Command{ Use: "run [flags] path", - Short: "Run Grafana Agent Flow", - Long: `The run subcommand runs Grafana Agent Flow in the foreground until an interrupt + Short: "Run Grafana Alloy", + Long: `The run subcommand runs Grafana Alloy in the foreground until an interrupt is received. run must be provided an argument pointing at the Alloy configuration @@ -76,7 +76,7 @@ immediately. If path is a directory, all *.river files in that directory will be combined into a single unit. Subdirectories are not recursively searched for further merging. -run starts an HTTP server which can be used to debug Grafana Agent Flow or +run starts an HTTP server which can be used to debug Grafana Alloy or force it to reload (by sending a GET or POST request to /-/reload). The listen address can be changed through the --server.http.listen-addr flag. @@ -88,7 +88,7 @@ Additionally, the HTTP server exposes the following debug endpoints: /debug/pprof Go performance profiling tools -If reloading the config dir/file-path fails, Grafana Agent Flow will continue running in +If reloading the config dir/file-path fails, Grafana Alloy will continue running in its last valid state. Components which failed may be be listed as unhealthy, depending on the nature of the reload error. `, @@ -141,7 +141,7 @@ depending on the nature of the reload error. return cmd } -type flowRun struct { +type alloyRun struct { inMemoryAddr string httpListenAddr string storagePath string @@ -163,7 +163,7 @@ type flowRun struct { configExtraArgs string } -func (fr *flowRun) Run(configPath string) error { +func (fr *alloyRun) Run(configPath string) error { var wg sync.WaitGroup defer wg.Wait() @@ -213,11 +213,11 @@ func (fr *flowRun) Run(configPath string) error { reg := prometheus.DefaultRegisterer reg.MustRegister(newResourcesCollector(l)) - // There's a cyclic dependency between the definition of the Flow controller, + // There's a cyclic dependency between the definition of the Alloy controller, // the reload/ready functions, and the HTTP service. // // To work around this, we lazily create variables for the functions the HTTP - // service needs and set them after the Flow controller exists. + // service needs and set them after the Alloy controller exists. var ( reload func() (*flow.Source, error) ready func() bool @@ -294,21 +294,21 @@ func (fr *flowRun) Run(configPath string) error { ready = f.Ready reload = func() (*flow.Source, error) { - flowSource, err := loadFlowSource(configPath, fr.configFormat, fr.configBypassConversionErrors, fr.configExtraArgs) - defer instrumentation.InstrumentSHA256(flowSource.SHA256()) + alloySource, err := loadAlloySource(configPath, fr.configFormat, fr.configBypassConversionErrors, fr.configExtraArgs) + defer instrumentation.InstrumentSHA256(alloySource.SHA256()) defer instrumentation.InstrumentLoad(err == nil) if err != nil { return nil, fmt.Errorf("reading config path %q: %w", configPath, err) } - if err := f.LoadSource(flowSource, nil); err != nil { - return flowSource, fmt.Errorf("error during the initial load: %w", err) + if err := f.LoadSource(alloySource, nil); err != nil { + return alloySource, fmt.Errorf("error during the initial load: %w", err) } - return flowSource, nil + return alloySource, nil } - // Flow controller + // Alloy controller { wg.Add(1) go func() { @@ -332,7 +332,7 @@ func (fr *flowRun) Run(configPath string) error { } // Perform the initial reload. This is done after starting the HTTP server so - // that /metric and pprof endpoints are available while the Flow controller + // that /metric and pprof endpoints are available while the Alloy controller // is loading. if source, err := reload(); err != nil { var diags diag.Diagnostics @@ -396,7 +396,7 @@ func getEnabledComponentsFunc(f *flow.Flow) func() map[string]interface{} { } } -func loadFlowSource(path string, converterSourceFormat string, converterBypassErrors bool, configExtraArgs string) (*flow.Source, error) { +func loadAlloySource(path string, converterSourceFormat string, converterBypassErrors bool, configExtraArgs string) (*flow.Source, error) { fi, err := os.Stat(path) if err != nil { return nil, err @@ -435,7 +435,7 @@ func loadFlowSource(path string, converterSourceFormat string, converterBypassEr if err != nil { return nil, err } - if converterSourceFormat != "flow" { + if converterSourceFormat != "alloy" { var diags convert_diag.Diagnostics ea, err := parseExtraArgs(configExtraArgs) if err != nil { diff --git a/internal/alloycli/cmd_tools.go b/internal/alloycli/cmd_tools.go index ff499156af..811abff3d2 100644 --- a/internal/alloycli/cmd_tools.go +++ b/internal/alloycli/cmd_tools.go @@ -10,8 +10,8 @@ import ( func toolsCommand() *cobra.Command { cmd := &cobra.Command{ Use: "tools", - Short: "Utilties for various Flow components", - Long: `The tools command contains a collection of utilities for Grafana Agent Flow components.`, + Short: "Utilties for various components", + Long: `The tools command contains a collection of utilities for components.`, } cmd.AddCommand( diff --git a/internal/alloycli/flowmode.go b/internal/alloycli/flowmode.go index f63c99d5b3..9155895c6a 100644 --- a/internal/alloycli/flowmode.go +++ b/internal/alloycli/flowmode.go @@ -9,12 +9,12 @@ import ( "github.com/spf13/cobra" ) -// Run is the entrypoint to Flow mode. It is expected to be called -// directly from the main function. +// Run runs the Alloy CLI. It is expected to be called directly from the main +// function. func Run() { var cmd = &cobra.Command{ Use: fmt.Sprintf("%s [global options] ", os.Args[0]), - Short: "Grafana Agent Flow", + Short: "Grafana Alloy", Version: build.Print("agent"), RunE: func(cmd *cobra.Command, args []string) error { From ab353dbadc7ace76ee5f54e877f2b5ee04e08138 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Mon, 25 Mar 2024 17:00:58 -0400 Subject: [PATCH 3/5] misc: rename internal/flow to internal/alloy internal/flow, referring to the Flow system, is no longer an appropriate name and can be confusing to contributors. This commit renames it to internal/alloy, which is a slightly better name. However, internal/alloy is redundant with the full path (github.com/grafana/alloy/internal/alloy), so a better name in the future (such as controller) would be more appropriate, but would also require a more broad refactoring of the Alloy controller. --- .../componenttest/componenttest.go | 2 +- .../{flow => alloy}/componenttest/context.go | 0 .../componenttest/testfailmodule.go | 2 +- internal/{flow => alloy}/declare_test.go | 22 ++++++------ internal/{flow => alloy}/flow.go | 30 ++++++++-------- internal/{flow => alloy}/flow_components.go | 6 ++-- internal/{flow => alloy}/flow_services.go | 8 ++--- .../{flow => alloy}/flow_services_test.go | 8 ++--- internal/{flow => alloy}/flow_test.go | 10 +++--- internal/{flow => alloy}/flow_updates_test.go | 6 ++-- internal/{flow => alloy}/import_git_test.go | 2 +- internal/{flow => alloy}/import_test.go | 18 +++++----- .../internal/controller/block_node.go | 2 +- .../internal/controller/component_node.go | 0 .../controller/component_node_manager.go | 0 .../controller/component_references.go | 2 +- .../internal/controller/component_registry.go | 0 .../controller/custom_component_registry.go | 0 .../internal/controller/loader.go | 8 ++--- .../internal/controller/loader_test.go | 8 ++--- .../internal/controller/metrics.go | 0 .../internal/controller/module.go | 0 .../controller/node_builtin_component.go | 6 ++-- .../controller/node_builtin_component_test.go | 0 .../internal/controller/node_config.go | 2 +- .../controller/node_config_argument.go | 0 .../internal/controller/node_config_export.go | 0 .../internal/controller/node_config_import.go | 6 ++-- .../controller/node_config_logging.go | 2 +- .../controller/node_config_tracing.go | 2 +- .../controller/node_custom_component.go | 2 +- .../internal/controller/node_declare.go | 0 .../internal/controller/node_service.go | 0 .../internal/controller/queue.go | 0 .../internal/controller/queue_test.go | 0 .../internal/controller/scheduler.go | 0 .../internal/controller/scheduler_test.go | 2 +- .../internal/controller/service_map.go | 0 .../internal/controller/value_cache.go | 0 .../internal/controller/value_cache_test.go | 0 internal/{flow => alloy}/internal/dag/dag.go | 0 internal/{flow => alloy}/internal/dag/ops.go | 0 .../{flow => alloy}/internal/dag/ops_test.go | 0 .../{flow => alloy}/internal/dag/tarjan.go | 0 .../internal/dag/tarjan_test.go | 0 internal/{flow => alloy}/internal/dag/walk.go | 0 .../internal/importsource/import_file.go | 2 +- .../internal/importsource/import_git.go | 2 +- .../internal/importsource/import_http.go | 0 .../internal/importsource/import_source.go | 0 .../internal/importsource/import_string.go | 0 .../internal/testcomponents/count.go | 2 +- .../internal/testcomponents/doc.go | 0 .../internal/testcomponents/experimental.go | 0 .../internal/testcomponents/fake.go | 0 .../testcomponents/module/file/file.go | 2 +- .../internal/testcomponents/module/git/git.go | 4 +-- .../testcomponents/module/http/http.go | 2 +- .../internal/testcomponents/module/module.go | 2 +- .../testcomponents/module/string/string.go | 2 +- .../internal/testcomponents/passthrough.go | 2 +- .../internal/testcomponents/sumation.go | 2 +- .../internal/testcomponents/tick.go | 2 +- .../internal/testservices/doc.go | 0 .../internal/testservices/fake.go | 0 .../internal/worker/worker_pool.go | 0 .../internal/worker/worker_pool_test.go | 0 internal/{flow => alloy}/logging/handler.go | 0 .../{flow => alloy}/logging/handler_test.go | 0 .../{flow => alloy}/logging/level/level.go | 2 +- internal/{flow => alloy}/logging/logger.go | 0 .../{flow => alloy}/logging/logger_test.go | 4 +-- internal/{flow => alloy}/logging/options.go | 0 internal/{flow => alloy}/module.go | 12 +++---- internal/{flow => alloy}/module_eval_test.go | 34 +++++++++---------- internal/{flow => alloy}/module_fail_test.go | 6 ++-- internal/{flow => alloy}/module_registry.go | 2 +- internal/{flow => alloy}/module_test.go | 8 ++--- internal/{flow => alloy}/source.go | 2 +- internal/{flow => alloy}/source_test.go | 4 +-- .../import_error/import_error_1.txtar | 0 .../import_error/import_error_2.txtar | 0 .../import_error/import_error_3.txtar | 0 .../import_error/import_error_4.txtar | 0 .../testdata/import_file/import_file_1.txtar | 0 .../testdata/import_file/import_file_10.txtar | 0 .../testdata/import_file/import_file_11.txtar | 0 .../testdata/import_file/import_file_12.txtar | 0 .../testdata/import_file/import_file_13.txtar | 0 .../testdata/import_file/import_file_14.txtar | 0 .../testdata/import_file/import_file_15.txtar | 0 .../testdata/import_file/import_file_16.txtar | 0 .../testdata/import_file/import_file_2.txtar | 0 .../testdata/import_file/import_file_3.txtar | 0 .../testdata/import_file/import_file_4.txtar | 0 .../testdata/import_file/import_file_5.txtar | 0 .../testdata/import_file/import_file_6.txtar | 0 .../testdata/import_file/import_file_7.txtar | 0 .../testdata/import_file/import_file_8.txtar | 0 .../testdata/import_file/import_file_9.txtar | 0 .../import_file_folder_1.txtar | 0 .../import_file_folder_2.txtar | 0 .../import_file_folder_3.txtar | 0 .../import_file_folder_4.txtar | 0 .../import_file_folder_5.txtar | 0 .../testdata/import_git/import_git_1.txtar | 0 .../testdata/import_git/import_git_2.txtar | 0 .../testdata/import_http/import_http_1.txtar | 0 .../import_string/import_string_1.txtar | 0 .../tracing/internal/jaegerremote/LICENSE | 0 .../tracing/internal/jaegerremote/README.md | 0 .../internal/jaegerremote/constants.go | 0 .../tracing/internal/jaegerremote/doc.go | 0 .../tracing/internal/jaegerremote/sampler.go | 2 +- .../internal/jaegerremote/sampler_remote.go | 0 .../jaegerremote/sampler_remote_options.go | 0 .../internal/jaegerremote/utils/http_json.go | 0 .../jaegerremote/utils/rate_limiter.go | 0 .../{flow => alloy}/tracing/lazy_sampler.go | 0 .../{flow => alloy}/tracing/otelcol_client.go | 0 internal/{flow => alloy}/tracing/tracing.go | 2 +- .../{flow => alloy}/tracing/wrap_tracer.go | 0 internal/alloycli/cluster_builder.go | 2 +- internal/alloycli/cmd_run.go | 24 ++++++------- internal/alloycli/resources_collector.go | 2 +- internal/alloyseed/alloyseed.go | 2 +- internal/cmd/alloy-service/service_test.go | 2 +- internal/component/common/kubernetes/event.go | 2 +- .../component/common/kubernetes/kubernetes.go | 2 +- .../component/common/loki/client/client.go | 2 +- .../loki/client/internal/marker_handler.go | 2 +- .../component/common/loki/client/manager.go | 2 +- .../common/loki/positions/positions.go | 2 +- .../common/loki/wal/internal/watcher_state.go | 2 +- internal/component/common/loki/wal/wal.go | 2 +- internal/component/common/loki/wal/watcher.go | 2 +- .../component/common/loki/wal/watcher_test.go | 2 +- internal/component/common/loki/wal/writer.go | 2 +- .../component/common/loki/wal/writer_test.go | 2 +- internal/component/common/net/server.go | 2 +- .../consulagent/promtail_consulagent.go | 2 +- .../discovery/process/process_stub.go | 2 +- .../discovery/relabel/relabel_test.go | 2 +- internal/component/faro/receiver/exporters.go | 2 +- internal/component/faro/receiver/handler.go | 2 +- internal/component/faro/receiver/receiver.go | 2 +- .../component/faro/receiver/receiver_test.go | 2 +- internal/component/faro/receiver/server.go | 2 +- .../component/faro/receiver/sourcemaps.go | 2 +- internal/component/local/file/file.go | 2 +- internal/component/local/file/file_test.go | 2 +- internal/component/local/file_match/file.go | 2 +- internal/component/local/file_match/watch.go | 2 +- internal/component/loki/echo/echo.go | 2 +- .../component/loki/process/process_test.go | 2 +- .../component/loki/process/stages/drop.go | 2 +- .../loki/process/stages/eventlogmessage.go | 2 +- .../loki/process/stages/extensions.go | 2 +- .../component/loki/process/stages/geoip.go | 2 +- .../component/loki/process/stages/json.go | 2 +- .../component/loki/process/stages/labels.go | 2 +- .../component/loki/process/stages/limit.go | 2 +- .../component/loki/process/stages/logfmt.go | 2 +- .../component/loki/process/stages/metric.go | 2 +- .../loki/process/stages/multiline.go | 2 +- .../component/loki/process/stages/output.go | 2 +- .../component/loki/process/stages/pack.go | 2 +- .../loki/process/stages/pipeline_test.go | 2 +- .../component/loki/process/stages/regex.go | 2 +- .../component/loki/process/stages/replace.go | 2 +- .../loki/process/stages/static_labels.go | 2 +- .../component/loki/process/stages/template.go | 2 +- .../component/loki/process/stages/tenant.go | 2 +- .../loki/process/stages/timestamp.go | 2 +- internal/component/loki/relabel/relabel.go | 2 +- .../component/loki/relabel/relabel_test.go | 2 +- .../component/loki/rules/kubernetes/events.go | 2 +- .../component/loki/rules/kubernetes/rules.go | 2 +- .../api/internal/lokipush/push_api_server.go | 2 +- .../source/aws_firehose/internal/handler.go | 2 +- .../azure_event_hubs/azure_event_hubs.go | 2 +- .../loki/source/cloudflare/cloudflare.go | 2 +- .../internal/cloudflaretarget/target.go | 2 +- .../component/loki/source/docker/docker.go | 2 +- .../loki/source/docker/docker_test.go | 2 +- .../docker/internal/dockertarget/target.go | 2 +- .../component/loki/source/docker/runner.go | 2 +- .../loki/source/file/decompresser.go | 2 +- internal/component/loki/source/file/file.go | 2 +- .../component/loki/source/file/file_test.go | 2 +- internal/component/loki/source/file/tailer.go | 2 +- .../component/loki/source/gcplog/gcplog.go | 2 +- .../internal/gcplogtarget/pull_target.go | 2 +- .../internal/gcplogtarget/push_target.go | 2 +- .../source/gelf/internal/target/gelftarget.go | 2 +- .../component/loki/source/heroku/heroku.go | 2 +- .../internal/herokutarget/herokutarget.go | 2 +- .../source/internal/kafkatarget/consumer.go | 2 +- .../internal/kafkatarget/kafkatarget.go | 2 +- .../internal/kafkatarget/target_syncer.go | 2 +- .../journal/internal/target/journaltarget.go | 2 +- .../loki/source/journal/journal_stub.go | 2 +- internal/component/loki/source/kafka/kafka.go | 2 +- .../loki/source/kubernetes/kubernetes.go | 2 +- .../source/kubernetes/kubetail/kubetail.go | 2 +- .../loki/source/kubernetes/kubetail/tailer.go | 2 +- .../kubernetes_events/event_controller.go | 2 +- .../kubernetes_events/kubernetes_events.go | 2 +- .../loki/source/podlogs/controller.go | 2 +- .../component/loki/source/podlogs/podlogs.go | 2 +- .../loki/source/podlogs/reconciler.go | 2 +- .../internal/syslogtarget/syslogtarget.go | 2 +- .../syslog/internal/syslogtarget/transport.go | 2 +- .../component/loki/source/syslog/syslog.go | 2 +- .../source/windowsevent/component_stub.go | 2 +- internal/component/loki/write/write_test.go | 2 +- .../mimir/rules/kubernetes/events.go | 2 +- .../component/mimir/rules/kubernetes/rules.go | 2 +- internal/component/otelcol/auth/auth_test.go | 2 +- .../otelcol/auth/basic/basic_test.go | 2 +- .../otelcol/auth/bearer/bearer_test.go | 2 +- .../otelcol/auth/headers/headers_test.go | 2 +- .../otelcol/auth/oauth2/oauth2_test.go | 2 +- .../otelcol/auth/sigv4/sigv4_test.go | 2 +- .../otelcol/connector/spanlogs/spanlogs.go | 2 +- .../connector/spanlogs/spanlogs_test.go | 2 +- .../connector/spanmetrics/spanmetrics_test.go | 2 +- .../otelcol/exporter/exporter_test.go | 2 +- .../exporter/loki/internal/convert/convert.go | 2 +- .../otelcol/exporter/otlp/otlp_test.go | 4 +-- .../exporter/otlphttp/otlphttp_test.go | 4 +-- .../prometheus/internal/convert/convert.go | 2 +- .../otelcol/extension/extension_test.go | 2 +- .../jaeger_remote_sampling_test.go | 2 +- .../otelcol/internal/scheduler/host.go | 2 +- .../otelcol/internal/scheduler/scheduler.go | 2 +- .../internal/scheduler/scheduler_test.go | 2 +- .../processor/attributes/attributes_test.go | 2 +- .../otelcol/processor/batch/batch_test.go | 4 +-- .../otelcol/processor/discovery/discovery.go | 2 +- .../processor/discovery/discovery_test.go | 2 +- .../memorylimiter/memorylimiter_test.go | 4 +-- .../probabilistic_sampler_test.go | 2 +- .../otelcol/processor/processor_test.go | 2 +- .../processor/processortest/processortest.go | 4 +-- .../otelcol/processor/span/span_test.go | 2 +- .../tail_sampling/tail_sampling_test.go | 4 +-- .../otelcol/receiver/jaeger/jaeger_test.go | 2 +- .../component/otelcol/receiver/loki/loki.go | 2 +- .../otelcol/receiver/loki/loki_test.go | 2 +- .../receiver/opencensus/opencensus_test.go | 2 +- .../otelcol/receiver/otlp/otlp_test.go | 4 +-- .../receiver/prometheus/prometheus_test.go | 2 +- .../otelcol/receiver/receiver_test.go | 2 +- .../otelcol/receiver/zipkin/zipkin_test.go | 2 +- .../component/prometheus/exporter/exporter.go | 2 +- .../prometheus/operator/common/component.go | 2 +- .../prometheus/operator/common/crdmanager.go | 2 +- .../prometheus/receive_http/receive_http.go | 2 +- .../prometheus/relabel/relabel_test.go | 2 +- .../prometheus/remotewrite/remote_write.go | 2 +- .../remotewrite/remote_write_test.go | 2 +- .../component/prometheus/scrape/scrape.go | 2 +- .../component/pyroscope/ebpf/ebpf_linux.go | 2 +- .../pyroscope/ebpf/ebpf_placeholder.go | 2 +- internal/component/pyroscope/java/java.go | 2 +- .../component/pyroscope/java/java_stub.go | 2 +- internal/component/pyroscope/java/loop.go | 2 +- .../component/pyroscope/scrape/manager.go | 2 +- internal/component/pyroscope/scrape/scrape.go | 2 +- .../component/pyroscope/scrape/scrape_loop.go | 2 +- internal/component/pyroscope/write/write.go | 2 +- internal/component/remote/http/http.go | 2 +- internal/component/remote/http/http_test.go | 4 +-- internal/component/remote/vault/refresher.go | 2 +- internal/component/remote/vault/vault.go | 2 +- internal/component/remote/vault/vault_test.go | 2 +- .../internal/build/builder_logging.go | 2 +- .../converter/internal/test_common/testing.go | 8 ++--- internal/filedetector/detector.go | 2 +- internal/service/cluster/cluster.go | 2 +- internal/service/http/http.go | 6 ++-- internal/service/http/http_test.go | 6 ++-- internal/service/labelstore/service.go | 2 +- internal/service/remotecfg/remotecfg.go | 2 +- internal/service/remotecfg/remotecfg_test.go | 12 +++---- internal/static/server/config.go | 2 +- internal/util/test_logger.go | 2 +- 288 files changed, 326 insertions(+), 326 deletions(-) rename internal/{flow => alloy}/componenttest/componenttest.go (98%) rename internal/{flow => alloy}/componenttest/context.go (100%) rename internal/{flow => alloy}/componenttest/testfailmodule.go (95%) rename internal/{flow => alloy}/declare_test.go (94%) rename internal/{flow => alloy}/flow.go (91%) rename internal/{flow => alloy}/flow_components.go (96%) rename internal/{flow => alloy}/flow_services.go (94%) rename internal/{flow => alloy}/flow_services_test.go (97%) rename internal/{flow => alloy}/flow_test.go (90%) rename internal/{flow => alloy}/flow_updates_test.go (98%) rename internal/{flow => alloy}/import_git_test.go (99%) rename internal/{flow => alloy}/import_test.go (95%) rename internal/{flow => alloy}/internal/controller/block_node.go (92%) rename internal/{flow => alloy}/internal/controller/component_node.go (100%) rename internal/{flow => alloy}/internal/controller/component_node_manager.go (100%) rename internal/{flow => alloy}/internal/controller/component_references.go (98%) rename internal/{flow => alloy}/internal/controller/component_registry.go (100%) rename internal/{flow => alloy}/internal/controller/custom_component_registry.go (100%) rename internal/{flow => alloy}/internal/controller/loader.go (99%) rename internal/{flow => alloy}/internal/controller/loader_test.go (98%) rename internal/{flow => alloy}/internal/controller/metrics.go (100%) rename internal/{flow => alloy}/internal/controller/module.go (100%) rename internal/{flow => alloy}/internal/controller/node_builtin_component.go (98%) rename internal/{flow => alloy}/internal/controller/node_builtin_component_test.go (100%) rename internal/{flow => alloy}/internal/controller/node_config.go (98%) rename internal/{flow => alloy}/internal/controller/node_config_argument.go (100%) rename internal/{flow => alloy}/internal/controller/node_config_export.go (100%) rename internal/{flow => alloy}/internal/controller/node_config_import.go (98%) rename internal/{flow => alloy}/internal/controller/node_config_logging.go (98%) rename internal/{flow => alloy}/internal/controller/node_config_tracing.go (98%) rename internal/{flow => alloy}/internal/controller/node_custom_component.go (99%) rename internal/{flow => alloy}/internal/controller/node_declare.go (100%) rename internal/{flow => alloy}/internal/controller/node_service.go (100%) rename internal/{flow => alloy}/internal/controller/queue.go (100%) rename internal/{flow => alloy}/internal/controller/queue_test.go (100%) rename internal/{flow => alloy}/internal/controller/scheduler.go (100%) rename internal/{flow => alloy}/internal/controller/scheduler_test.go (97%) rename internal/{flow => alloy}/internal/controller/service_map.go (100%) rename internal/{flow => alloy}/internal/controller/value_cache.go (100%) rename internal/{flow => alloy}/internal/controller/value_cache_test.go (100%) rename internal/{flow => alloy}/internal/dag/dag.go (100%) rename internal/{flow => alloy}/internal/dag/ops.go (100%) rename internal/{flow => alloy}/internal/dag/ops_test.go (100%) rename internal/{flow => alloy}/internal/dag/tarjan.go (100%) rename internal/{flow => alloy}/internal/dag/tarjan_test.go (100%) rename internal/{flow => alloy}/internal/dag/walk.go (100%) rename internal/{flow => alloy}/internal/importsource/import_file.go (99%) rename internal/{flow => alloy}/internal/importsource/import_git.go (99%) rename internal/{flow => alloy}/internal/importsource/import_http.go (100%) rename internal/{flow => alloy}/internal/importsource/import_source.go (100%) rename internal/{flow => alloy}/internal/importsource/import_string.go (100%) rename internal/{flow => alloy}/internal/testcomponents/count.go (97%) rename internal/{flow => alloy}/internal/testcomponents/doc.go (100%) rename internal/{flow => alloy}/internal/testcomponents/experimental.go (100%) rename internal/{flow => alloy}/internal/testcomponents/fake.go (100%) rename internal/{flow => alloy}/internal/testcomponents/module/file/file.go (98%) rename internal/{flow => alloy}/internal/testcomponents/module/git/git.go (97%) rename internal/{flow => alloy}/internal/testcomponents/module/http/http.go (98%) rename internal/{flow => alloy}/internal/testcomponents/module/module.go (98%) rename internal/{flow => alloy}/internal/testcomponents/module/string/string.go (96%) rename internal/{flow => alloy}/internal/testcomponents/passthrough.go (97%) rename internal/{flow => alloy}/internal/testcomponents/sumation.go (96%) rename internal/{flow => alloy}/internal/testcomponents/tick.go (97%) rename internal/{flow => alloy}/internal/testservices/doc.go (100%) rename internal/{flow => alloy}/internal/testservices/fake.go (100%) rename internal/{flow => alloy}/internal/worker/worker_pool.go (100%) rename internal/{flow => alloy}/internal/worker/worker_pool_test.go (100%) rename internal/{flow => alloy}/logging/handler.go (100%) rename internal/{flow => alloy}/logging/handler_test.go (100%) rename internal/{flow => alloy}/logging/level/level.go (96%) rename internal/{flow => alloy}/logging/logger.go (100%) rename internal/{flow => alloy}/logging/logger_test.go (98%) rename internal/{flow => alloy}/logging/options.go (100%) rename internal/{flow => alloy}/module.go (95%) rename internal/{flow => alloy}/module_eval_test.go (90%) rename internal/{flow => alloy}/module_fail_test.go (94%) rename internal/{flow => alloy}/module_registry.go (98%) rename internal/{flow => alloy}/module_test.go (98%) rename internal/{flow => alloy}/source.go (99%) rename internal/{flow => alloy}/source_test.go (96%) rename internal/{flow => alloy}/testdata/import_error/import_error_1.txtar (100%) rename internal/{flow => alloy}/testdata/import_error/import_error_2.txtar (100%) rename internal/{flow => alloy}/testdata/import_error/import_error_3.txtar (100%) rename internal/{flow => alloy}/testdata/import_error/import_error_4.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_1.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_10.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_11.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_12.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_13.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_14.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_15.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_16.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_2.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_3.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_4.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_5.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_6.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_7.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_8.txtar (100%) rename internal/{flow => alloy}/testdata/import_file/import_file_9.txtar (100%) rename internal/{flow => alloy}/testdata/import_file_folder/import_file_folder_1.txtar (100%) rename internal/{flow => alloy}/testdata/import_file_folder/import_file_folder_2.txtar (100%) rename internal/{flow => alloy}/testdata/import_file_folder/import_file_folder_3.txtar (100%) rename internal/{flow => alloy}/testdata/import_file_folder/import_file_folder_4.txtar (100%) rename internal/{flow => alloy}/testdata/import_file_folder/import_file_folder_5.txtar (100%) rename internal/{flow => alloy}/testdata/import_git/import_git_1.txtar (100%) rename internal/{flow => alloy}/testdata/import_git/import_git_2.txtar (100%) rename internal/{flow => alloy}/testdata/import_http/import_http_1.txtar (100%) rename internal/{flow => alloy}/testdata/import_string/import_string_1.txtar (100%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/LICENSE (100%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/README.md (100%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/constants.go (100%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/doc.go (100%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/sampler.go (99%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/sampler_remote.go (100%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/sampler_remote_options.go (100%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/utils/http_json.go (100%) rename internal/{flow => alloy}/tracing/internal/jaegerremote/utils/rate_limiter.go (100%) rename internal/{flow => alloy}/tracing/lazy_sampler.go (100%) rename internal/{flow => alloy}/tracing/otelcol_client.go (100%) rename internal/{flow => alloy}/tracing/tracing.go (98%) rename internal/{flow => alloy}/tracing/wrap_tracer.go (100%) diff --git a/internal/flow/componenttest/componenttest.go b/internal/alloy/componenttest/componenttest.go similarity index 98% rename from internal/flow/componenttest/componenttest.go rename to internal/alloy/componenttest/componenttest.go index b3b4de7af4..45c0b9b3b0 100644 --- a/internal/flow/componenttest/componenttest.go +++ b/internal/alloy/componenttest/componenttest.go @@ -14,8 +14,8 @@ import ( "go.uber.org/atomic" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/logging" "go.opentelemetry.io/otel/trace/noop" ) diff --git a/internal/flow/componenttest/context.go b/internal/alloy/componenttest/context.go similarity index 100% rename from internal/flow/componenttest/context.go rename to internal/alloy/componenttest/context.go diff --git a/internal/flow/componenttest/testfailmodule.go b/internal/alloy/componenttest/testfailmodule.go similarity index 95% rename from internal/flow/componenttest/testfailmodule.go rename to internal/alloy/componenttest/testfailmodule.go index 996467a337..f5f8f5552e 100644 --- a/internal/flow/componenttest/testfailmodule.go +++ b/internal/alloy/componenttest/testfailmodule.go @@ -4,9 +4,9 @@ import ( "context" "fmt" + mod "github.com/grafana/alloy/internal/alloy/internal/testcomponents/module" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - mod "github.com/grafana/alloy/internal/flow/internal/testcomponents/module" ) func init() { diff --git a/internal/flow/declare_test.go b/internal/alloy/declare_test.go similarity index 94% rename from internal/flow/declare_test.go rename to internal/alloy/declare_test.go index 20fca527bf..270aea92ab 100644 --- a/internal/flow/declare_test.go +++ b/internal/alloy/declare_test.go @@ -1,4 +1,4 @@ -package flow_test +package alloy_test import ( "context" @@ -7,10 +7,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow" - "github.com/grafana/alloy/internal/flow/internal/testcomponents" - "github.com/grafana/alloy/internal/flow/logging" "github.com/grafana/alloy/internal/service" "github.com/stretchr/testify/require" ) @@ -265,8 +265,8 @@ func TestDeclare(t *testing.T) { for _, tc := range tt { t.Run(tc.name, func(t *testing.T) { - ctrl := flow.New(testOptions(t)) - f, err := flow.ParseSource(t.Name(), []byte(tc.config)) + ctrl := alloy.New(testOptions(t)) + f, err := alloy.ParseSource(t.Name(), []byte(tc.config)) require.NoError(t, err) require.NotNil(t, f) @@ -384,14 +384,14 @@ func TestDeclareError(t *testing.T) { defer verifyNoGoroutineLeaks(t) s, err := logging.New(os.Stderr, logging.DefaultOptions) require.NoError(t, err) - ctrl := flow.New(flow.Options{ + ctrl := alloy.New(alloy.Options{ Logger: s, DataPath: t.TempDir(), MinStability: featuregate.StabilityBeta, Reg: nil, Services: []service.Service{}, }) - f, err := flow.ParseSource(t.Name(), []byte(tc.config)) + f, err := alloy.ParseSource(t.Name(), []byte(tc.config)) require.NoError(t, err) require.NotNil(t, f) @@ -474,8 +474,8 @@ func TestDeclareUpdateConfig(t *testing.T) { for _, tc := range tt { t.Run(tc.name, func(t *testing.T) { - ctrl := flow.New(testOptions(t)) - f, err := flow.ParseSource(t.Name(), []byte(tc.config)) + ctrl := alloy.New(testOptions(t)) + f, err := alloy.ParseSource(t.Name(), []byte(tc.config)) require.NoError(t, err) require.NotNil(t, f) @@ -498,7 +498,7 @@ func TestDeclareUpdateConfig(t *testing.T) { return export.LastAdded == tc.expected }, 3*time.Second, 10*time.Millisecond) - f, err = flow.ParseSource(t.Name(), []byte(tc.newConfig)) + f, err = alloy.ParseSource(t.Name(), []byte(tc.newConfig)) require.NoError(t, err) require.NotNil(t, f) diff --git a/internal/flow/flow.go b/internal/alloy/flow.go similarity index 91% rename from internal/flow/flow.go rename to internal/alloy/flow.go index 2bf4048259..26d3187ece 100644 --- a/internal/flow/flow.go +++ b/internal/alloy/flow.go @@ -1,5 +1,5 @@ -// Package flow implements the Flow component graph system. Flow configuration -// sources are parsed from River, which contain a listing of components to run. +// Package alloy implements the Alloy component graph system. Alloy configuration +// sources are parsed from Alloy syntax, which contain a listing of components to run. // // # Components // @@ -23,7 +23,7 @@ // and a message providing more detail for the health state. // // Components can report their own health states. The health state reported by -// a component is merged with the Flow-level health of that component: an error +// a component is merged with the Alloy-level health of that component: an error // when evaluating the configuration for a component will always be reported as // unhealthy until the next successful evaluation. // @@ -43,7 +43,7 @@ // state if a node shuts down or is given an invalid config. This prevents // a domino effect of a single failed node taking down other node // which are otherwise healthy. -package flow +package alloy import ( "context" @@ -51,24 +51,24 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/internal/controller" + "github.com/grafana/alloy/internal/alloy/internal/worker" + "github.com/grafana/alloy/internal/alloy/logging" + "github.com/grafana/alloy/internal/alloy/logging/level" + "github.com/grafana/alloy/internal/alloy/tracing" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/controller" - "github.com/grafana/alloy/internal/flow/internal/worker" - "github.com/grafana/alloy/internal/flow/logging" - "github.com/grafana/alloy/internal/flow/logging/level" - "github.com/grafana/alloy/internal/flow/tracing" "github.com/grafana/alloy/internal/service" "github.com/prometheus/client_golang/prometheus" "go.uber.org/atomic" ) -// Options holds static options for a flow controller. +// Options holds static options for an Alloy controller. type Options struct { // ControllerID is an identifier used to represent the controller. // ControllerID is used to generate a globally unique display name for // components in a binary where multiple controllers are used. // - // If running multiple Flow controllers, each controller must have a + // If running multiple Alloy controllers, each controller must have a // different value for ControllerID to be able to differentiate between // components in telemetry data. ControllerID string @@ -84,7 +84,7 @@ type Options struct { // Directory where components can write data. Constructed components will be // given a subdirectory of DataPath using the local ID of the component. // - // If running multiple Flow controllers, each controller must have a + // If running multiple Alloy controllers, each controller must have a // different value for DataPath to prevent components from colliding. DataPath string @@ -101,14 +101,14 @@ type Options struct { // loaded config source. OnExportsChange func(exports map[string]any) - // List of Services to run with the Flow controller. + // List of Services to run with the Alloy controller. // // Services are configured when LoadFile is invoked. Services are started - // when the Flow controller runs after LoadFile is invoked at least once. + // when the Alloy controller runs after LoadFile is invoked at least once. Services []service.Service } -// Flow is the Flow system. +// Alloy is the Alloy system. type Flow struct { log *logging.Logger tracer *tracing.Tracer diff --git a/internal/flow/flow_components.go b/internal/alloy/flow_components.go similarity index 96% rename from internal/flow/flow_components.go rename to internal/alloy/flow_components.go index 63ea62fa89..2eb5f2fc65 100644 --- a/internal/flow/flow_components.go +++ b/internal/alloy/flow_components.go @@ -1,11 +1,11 @@ -package flow +package alloy import ( "fmt" + "github.com/grafana/alloy/internal/alloy/internal/controller" + "github.com/grafana/alloy/internal/alloy/internal/dag" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/internal/controller" - "github.com/grafana/alloy/internal/flow/internal/dag" ) // GetComponent implements [component.Provider]. diff --git a/internal/flow/flow_services.go b/internal/alloy/flow_services.go similarity index 94% rename from internal/flow/flow_services.go rename to internal/alloy/flow_services.go index d04298ef39..062e579b75 100644 --- a/internal/flow/flow_services.go +++ b/internal/alloy/flow_services.go @@ -1,11 +1,11 @@ -package flow +package alloy import ( "context" - "github.com/grafana/alloy/internal/flow/internal/controller" - "github.com/grafana/alloy/internal/flow/internal/dag" - "github.com/grafana/alloy/internal/flow/internal/worker" + "github.com/grafana/alloy/internal/alloy/internal/controller" + "github.com/grafana/alloy/internal/alloy/internal/dag" + "github.com/grafana/alloy/internal/alloy/internal/worker" "github.com/grafana/alloy/internal/service" ) diff --git a/internal/flow/flow_services_test.go b/internal/alloy/flow_services_test.go similarity index 97% rename from internal/flow/flow_services_test.go rename to internal/alloy/flow_services_test.go index 4ec5d6d359..c5a6f3e885 100644 --- a/internal/flow/flow_services_test.go +++ b/internal/alloy/flow_services_test.go @@ -1,15 +1,15 @@ -package flow +package alloy import ( "context" "testing" "time" + "github.com/grafana/alloy/internal/alloy/internal/controller" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents" + "github.com/grafana/alloy/internal/alloy/internal/testservices" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/controller" - "github.com/grafana/alloy/internal/flow/internal/testcomponents" - "github.com/grafana/alloy/internal/flow/internal/testservices" "github.com/grafana/alloy/internal/service" "github.com/grafana/alloy/internal/util" "github.com/stretchr/testify/require" diff --git a/internal/flow/flow_test.go b/internal/alloy/flow_test.go similarity index 90% rename from internal/flow/flow_test.go rename to internal/alloy/flow_test.go index 7a29e48d36..36e1a93728 100644 --- a/internal/flow/flow_test.go +++ b/internal/alloy/flow_test.go @@ -1,16 +1,16 @@ -package flow +package alloy import ( "context" "os" "testing" + "github.com/grafana/alloy/internal/alloy/internal/controller" + "github.com/grafana/alloy/internal/alloy/internal/dag" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/controller" - "github.com/grafana/alloy/internal/flow/internal/dag" - "github.com/grafana/alloy/internal/flow/internal/testcomponents" - "github.com/grafana/alloy/internal/flow/logging" "github.com/stretchr/testify/require" "go.uber.org/goleak" ) diff --git a/internal/flow/flow_updates_test.go b/internal/alloy/flow_updates_test.go similarity index 98% rename from internal/flow/flow_updates_test.go rename to internal/alloy/flow_updates_test.go index fa8efdd915..d5d7e61bca 100644 --- a/internal/flow/flow_updates_test.go +++ b/internal/alloy/flow_updates_test.go @@ -1,12 +1,12 @@ -package flow +package alloy import ( "context" "testing" "time" - "github.com/grafana/alloy/internal/flow/internal/testcomponents" - "github.com/grafana/alloy/internal/flow/internal/worker" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents" + "github.com/grafana/alloy/internal/alloy/internal/worker" "github.com/stretchr/testify/require" ) diff --git a/internal/flow/import_git_test.go b/internal/alloy/import_git_test.go similarity index 99% rename from internal/flow/import_git_test.go rename to internal/alloy/import_git_test.go index c2b4c4f921..aa6f96f3a8 100644 --- a/internal/flow/import_git_test.go +++ b/internal/alloy/import_git_test.go @@ -1,6 +1,6 @@ //go:build linux -package flow_test +package alloy_test import ( "context" diff --git a/internal/flow/import_test.go b/internal/alloy/import_test.go similarity index 95% rename from internal/flow/import_test.go rename to internal/alloy/import_test.go index 707c203867..6ae51b75cf 100644 --- a/internal/flow/import_test.go +++ b/internal/alloy/import_test.go @@ -1,4 +1,4 @@ -package flow_test +package alloy_test import ( "context" @@ -10,15 +10,15 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow" - "github.com/grafana/alloy/internal/flow/internal/testcomponents" - "github.com/grafana/alloy/internal/flow/logging" "github.com/grafana/alloy/internal/service" "github.com/stretchr/testify/require" "golang.org/x/tools/txtar" - _ "github.com/grafana/alloy/internal/flow/internal/testcomponents/module/string" + _ "github.com/grafana/alloy/internal/alloy/internal/testcomponents/module/string" ) // use const to avoid lint error @@ -287,7 +287,7 @@ func testConfig(t *testing.T, config string, reloadConfig string, update func()) } if reloadConfig != "" { - f, err = flow.ParseSource(t.Name(), []byte(reloadConfig)) + f, err = alloy.ParseSource(t.Name(), []byte(reloadConfig)) require.NoError(t, err) require.NotNil(t, f) @@ -322,17 +322,17 @@ func testConfigError(t *testing.T, config string, expectedError string) { }() } -func setup(t *testing.T, config string) (*flow.Flow, *flow.Source) { +func setup(t *testing.T, config string) (*alloy.Flow, *alloy.Source) { s, err := logging.New(os.Stderr, logging.DefaultOptions) require.NoError(t, err) - ctrl := flow.New(flow.Options{ + ctrl := alloy.New(alloy.Options{ Logger: s, DataPath: t.TempDir(), MinStability: featuregate.StabilityBeta, Reg: nil, Services: []service.Service{}, }) - f, err := flow.ParseSource(t.Name(), []byte(config)) + f, err := alloy.ParseSource(t.Name(), []byte(config)) require.NoError(t, err) require.NotNil(t, f) return ctrl, f diff --git a/internal/flow/internal/controller/block_node.go b/internal/alloy/internal/controller/block_node.go similarity index 92% rename from internal/flow/internal/controller/block_node.go rename to internal/alloy/internal/controller/block_node.go index 83d0ed1263..b4cf4f1b04 100644 --- a/internal/flow/internal/controller/block_node.go +++ b/internal/alloy/internal/controller/block_node.go @@ -1,7 +1,7 @@ package controller import ( - "github.com/grafana/alloy/internal/flow/internal/dag" + "github.com/grafana/alloy/internal/alloy/internal/dag" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/vm" ) diff --git a/internal/flow/internal/controller/component_node.go b/internal/alloy/internal/controller/component_node.go similarity index 100% rename from internal/flow/internal/controller/component_node.go rename to internal/alloy/internal/controller/component_node.go diff --git a/internal/flow/internal/controller/component_node_manager.go b/internal/alloy/internal/controller/component_node_manager.go similarity index 100% rename from internal/flow/internal/controller/component_node_manager.go rename to internal/alloy/internal/controller/component_node_manager.go diff --git a/internal/flow/internal/controller/component_references.go b/internal/alloy/internal/controller/component_references.go similarity index 98% rename from internal/flow/internal/controller/component_references.go rename to internal/alloy/internal/controller/component_references.go index 7f505a0b35..143fb27d19 100644 --- a/internal/flow/internal/controller/component_references.go +++ b/internal/alloy/internal/controller/component_references.go @@ -3,7 +3,7 @@ package controller import ( "fmt" - "github.com/grafana/alloy/internal/flow/internal/dag" + "github.com/grafana/alloy/internal/alloy/internal/dag" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/diag" "github.com/grafana/alloy/syntax/vm" diff --git a/internal/flow/internal/controller/component_registry.go b/internal/alloy/internal/controller/component_registry.go similarity index 100% rename from internal/flow/internal/controller/component_registry.go rename to internal/alloy/internal/controller/component_registry.go diff --git a/internal/flow/internal/controller/custom_component_registry.go b/internal/alloy/internal/controller/custom_component_registry.go similarity index 100% rename from internal/flow/internal/controller/custom_component_registry.go rename to internal/alloy/internal/controller/custom_component_registry.go diff --git a/internal/flow/internal/controller/loader.go b/internal/alloy/internal/controller/loader.go similarity index 99% rename from internal/flow/internal/controller/loader.go rename to internal/alloy/internal/controller/loader.go index d99a9c5256..88bb31dbca 100644 --- a/internal/flow/internal/controller/loader.go +++ b/internal/alloy/internal/controller/loader.go @@ -10,11 +10,11 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/internal/dag" + "github.com/grafana/alloy/internal/alloy/internal/worker" + "github.com/grafana/alloy/internal/alloy/logging/level" + "github.com/grafana/alloy/internal/alloy/tracing" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/dag" - "github.com/grafana/alloy/internal/flow/internal/worker" - "github.com/grafana/alloy/internal/flow/logging/level" - "github.com/grafana/alloy/internal/flow/tracing" "github.com/grafana/alloy/internal/service" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/diag" diff --git a/internal/flow/internal/controller/loader_test.go b/internal/alloy/internal/controller/loader_test.go similarity index 98% rename from internal/flow/internal/controller/loader_test.go rename to internal/alloy/internal/controller/loader_test.go index dec59e98ce..af047c327f 100644 --- a/internal/flow/internal/controller/loader_test.go +++ b/internal/alloy/internal/controller/loader_test.go @@ -7,11 +7,11 @@ import ( "strings" "testing" + "github.com/grafana/alloy/internal/alloy/internal/controller" + "github.com/grafana/alloy/internal/alloy/internal/dag" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/controller" - "github.com/grafana/alloy/internal/flow/internal/dag" - "github.com/grafana/alloy/internal/flow/logging" "github.com/grafana/alloy/internal/service" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/diag" @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/trace/noop" - _ "github.com/grafana/alloy/internal/flow/internal/testcomponents" // Include test components + _ "github.com/grafana/alloy/internal/alloy/internal/testcomponents" // Include test components ) func TestLoader(t *testing.T) { diff --git a/internal/flow/internal/controller/metrics.go b/internal/alloy/internal/controller/metrics.go similarity index 100% rename from internal/flow/internal/controller/metrics.go rename to internal/alloy/internal/controller/metrics.go diff --git a/internal/flow/internal/controller/module.go b/internal/alloy/internal/controller/module.go similarity index 100% rename from internal/flow/internal/controller/module.go rename to internal/alloy/internal/controller/module.go diff --git a/internal/flow/internal/controller/node_builtin_component.go b/internal/alloy/internal/controller/node_builtin_component.go similarity index 98% rename from internal/flow/internal/controller/node_builtin_component.go rename to internal/alloy/internal/controller/node_builtin_component.go index 313a77f9a5..aadc9140e5 100644 --- a/internal/flow/internal/controller/node_builtin_component.go +++ b/internal/alloy/internal/controller/node_builtin_component.go @@ -13,11 +13,11 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging" + "github.com/grafana/alloy/internal/alloy/logging/level" + "github.com/grafana/alloy/internal/alloy/tracing" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging" - "github.com/grafana/alloy/internal/flow/logging/level" - "github.com/grafana/alloy/internal/flow/tracing" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/vm" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/flow/internal/controller/node_builtin_component_test.go b/internal/alloy/internal/controller/node_builtin_component_test.go similarity index 100% rename from internal/flow/internal/controller/node_builtin_component_test.go rename to internal/alloy/internal/controller/node_builtin_component_test.go diff --git a/internal/flow/internal/controller/node_config.go b/internal/alloy/internal/controller/node_config.go similarity index 98% rename from internal/flow/internal/controller/node_config.go rename to internal/alloy/internal/controller/node_config.go index f10d02a899..d36a43e91e 100644 --- a/internal/flow/internal/controller/node_config.go +++ b/internal/alloy/internal/controller/node_config.go @@ -3,7 +3,7 @@ package controller import ( "fmt" - "github.com/grafana/alloy/internal/flow/internal/importsource" + "github.com/grafana/alloy/internal/alloy/internal/importsource" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/diag" ) diff --git a/internal/flow/internal/controller/node_config_argument.go b/internal/alloy/internal/controller/node_config_argument.go similarity index 100% rename from internal/flow/internal/controller/node_config_argument.go rename to internal/alloy/internal/controller/node_config_argument.go diff --git a/internal/flow/internal/controller/node_config_export.go b/internal/alloy/internal/controller/node_config_export.go similarity index 100% rename from internal/flow/internal/controller/node_config_export.go rename to internal/alloy/internal/controller/node_config_export.go diff --git a/internal/flow/internal/controller/node_config_import.go b/internal/alloy/internal/controller/node_config_import.go similarity index 98% rename from internal/flow/internal/controller/node_config_import.go rename to internal/alloy/internal/controller/node_config_import.go index 4c268b5857..74ac148f84 100644 --- a/internal/flow/internal/controller/node_config_import.go +++ b/internal/alloy/internal/controller/node_config_import.go @@ -14,10 +14,10 @@ import ( "go.uber.org/atomic" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/internal/importsource" + "github.com/grafana/alloy/internal/alloy/logging/level" + "github.com/grafana/alloy/internal/alloy/tracing" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/internal/importsource" - "github.com/grafana/alloy/internal/flow/logging/level" - "github.com/grafana/alloy/internal/flow/tracing" "github.com/grafana/alloy/internal/runner" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/parser" diff --git a/internal/flow/internal/controller/node_config_logging.go b/internal/alloy/internal/controller/node_config_logging.go similarity index 98% rename from internal/flow/internal/controller/node_config_logging.go rename to internal/alloy/internal/controller/node_config_logging.go index e18532988b..9b18e42540 100644 --- a/internal/flow/internal/controller/node_config_logging.go +++ b/internal/alloy/internal/controller/node_config_logging.go @@ -6,7 +6,7 @@ import ( "sync" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/vm" ) diff --git a/internal/flow/internal/controller/node_config_tracing.go b/internal/alloy/internal/controller/node_config_tracing.go similarity index 98% rename from internal/flow/internal/controller/node_config_tracing.go rename to internal/alloy/internal/controller/node_config_tracing.go index c87fa4dfa9..07db48e4e8 100644 --- a/internal/flow/internal/controller/node_config_tracing.go +++ b/internal/alloy/internal/controller/node_config_tracing.go @@ -5,7 +5,7 @@ import ( "strings" "sync" - "github.com/grafana/alloy/internal/flow/tracing" + "github.com/grafana/alloy/internal/alloy/tracing" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/vm" "go.opentelemetry.io/otel/trace" diff --git a/internal/flow/internal/controller/node_custom_component.go b/internal/alloy/internal/controller/node_custom_component.go similarity index 99% rename from internal/flow/internal/controller/node_custom_component.go rename to internal/alloy/internal/controller/node_custom_component.go index d8a50d94a6..554e3c4030 100644 --- a/internal/flow/internal/controller/node_custom_component.go +++ b/internal/alloy/internal/controller/node_custom_component.go @@ -10,8 +10,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/vm" ) diff --git a/internal/flow/internal/controller/node_declare.go b/internal/alloy/internal/controller/node_declare.go similarity index 100% rename from internal/flow/internal/controller/node_declare.go rename to internal/alloy/internal/controller/node_declare.go diff --git a/internal/flow/internal/controller/node_service.go b/internal/alloy/internal/controller/node_service.go similarity index 100% rename from internal/flow/internal/controller/node_service.go rename to internal/alloy/internal/controller/node_service.go diff --git a/internal/flow/internal/controller/queue.go b/internal/alloy/internal/controller/queue.go similarity index 100% rename from internal/flow/internal/controller/queue.go rename to internal/alloy/internal/controller/queue.go diff --git a/internal/flow/internal/controller/queue_test.go b/internal/alloy/internal/controller/queue_test.go similarity index 100% rename from internal/flow/internal/controller/queue_test.go rename to internal/alloy/internal/controller/queue_test.go diff --git a/internal/flow/internal/controller/scheduler.go b/internal/alloy/internal/controller/scheduler.go similarity index 100% rename from internal/flow/internal/controller/scheduler.go rename to internal/alloy/internal/controller/scheduler.go diff --git a/internal/flow/internal/controller/scheduler_test.go b/internal/alloy/internal/controller/scheduler_test.go similarity index 97% rename from internal/flow/internal/controller/scheduler_test.go rename to internal/alloy/internal/controller/scheduler_test.go index 41561733eb..42f496a4e8 100644 --- a/internal/flow/internal/controller/scheduler_test.go +++ b/internal/alloy/internal/controller/scheduler_test.go @@ -5,8 +5,8 @@ import ( "sync" "testing" + "github.com/grafana/alloy/internal/alloy/internal/controller" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/internal/controller" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/vm" "github.com/stretchr/testify/require" diff --git a/internal/flow/internal/controller/service_map.go b/internal/alloy/internal/controller/service_map.go similarity index 100% rename from internal/flow/internal/controller/service_map.go rename to internal/alloy/internal/controller/service_map.go diff --git a/internal/flow/internal/controller/value_cache.go b/internal/alloy/internal/controller/value_cache.go similarity index 100% rename from internal/flow/internal/controller/value_cache.go rename to internal/alloy/internal/controller/value_cache.go diff --git a/internal/flow/internal/controller/value_cache_test.go b/internal/alloy/internal/controller/value_cache_test.go similarity index 100% rename from internal/flow/internal/controller/value_cache_test.go rename to internal/alloy/internal/controller/value_cache_test.go diff --git a/internal/flow/internal/dag/dag.go b/internal/alloy/internal/dag/dag.go similarity index 100% rename from internal/flow/internal/dag/dag.go rename to internal/alloy/internal/dag/dag.go diff --git a/internal/flow/internal/dag/ops.go b/internal/alloy/internal/dag/ops.go similarity index 100% rename from internal/flow/internal/dag/ops.go rename to internal/alloy/internal/dag/ops.go diff --git a/internal/flow/internal/dag/ops_test.go b/internal/alloy/internal/dag/ops_test.go similarity index 100% rename from internal/flow/internal/dag/ops_test.go rename to internal/alloy/internal/dag/ops_test.go diff --git a/internal/flow/internal/dag/tarjan.go b/internal/alloy/internal/dag/tarjan.go similarity index 100% rename from internal/flow/internal/dag/tarjan.go rename to internal/alloy/internal/dag/tarjan.go diff --git a/internal/flow/internal/dag/tarjan_test.go b/internal/alloy/internal/dag/tarjan_test.go similarity index 100% rename from internal/flow/internal/dag/tarjan_test.go rename to internal/alloy/internal/dag/tarjan_test.go diff --git a/internal/flow/internal/dag/walk.go b/internal/alloy/internal/dag/walk.go similarity index 100% rename from internal/flow/internal/dag/walk.go rename to internal/alloy/internal/dag/walk.go diff --git a/internal/flow/internal/importsource/import_file.go b/internal/alloy/internal/importsource/import_file.go similarity index 99% rename from internal/flow/internal/importsource/import_file.go rename to internal/alloy/internal/importsource/import_file.go index a5106a132f..4bd8a9c466 100644 --- a/internal/flow/internal/importsource/import_file.go +++ b/internal/alloy/internal/importsource/import_file.go @@ -13,9 +13,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" filedetector "github.com/grafana/alloy/internal/filedetector" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/syntax/vm" ) diff --git a/internal/flow/internal/importsource/import_git.go b/internal/alloy/internal/importsource/import_git.go similarity index 99% rename from internal/flow/internal/importsource/import_git.go rename to internal/alloy/internal/importsource/import_git.go index 6bb3a02fea..90c3898d9d 100644 --- a/internal/flow/internal/importsource/import_git.go +++ b/internal/alloy/internal/importsource/import_git.go @@ -12,8 +12,8 @@ import ( "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/vcs" "github.com/grafana/alloy/syntax/vm" ) diff --git a/internal/flow/internal/importsource/import_http.go b/internal/alloy/internal/importsource/import_http.go similarity index 100% rename from internal/flow/internal/importsource/import_http.go rename to internal/alloy/internal/importsource/import_http.go diff --git a/internal/flow/internal/importsource/import_source.go b/internal/alloy/internal/importsource/import_source.go similarity index 100% rename from internal/flow/internal/importsource/import_source.go rename to internal/alloy/internal/importsource/import_source.go diff --git a/internal/flow/internal/importsource/import_string.go b/internal/alloy/internal/importsource/import_string.go similarity index 100% rename from internal/flow/internal/importsource/import_string.go rename to internal/alloy/internal/importsource/import_string.go diff --git a/internal/flow/internal/testcomponents/count.go b/internal/alloy/internal/testcomponents/count.go similarity index 97% rename from internal/flow/internal/testcomponents/count.go rename to internal/alloy/internal/testcomponents/count.go index 0cb1f11a43..7d3fb2c9af 100644 --- a/internal/flow/internal/testcomponents/count.go +++ b/internal/alloy/internal/testcomponents/count.go @@ -7,9 +7,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "go.uber.org/atomic" ) diff --git a/internal/flow/internal/testcomponents/doc.go b/internal/alloy/internal/testcomponents/doc.go similarity index 100% rename from internal/flow/internal/testcomponents/doc.go rename to internal/alloy/internal/testcomponents/doc.go diff --git a/internal/flow/internal/testcomponents/experimental.go b/internal/alloy/internal/testcomponents/experimental.go similarity index 100% rename from internal/flow/internal/testcomponents/experimental.go rename to internal/alloy/internal/testcomponents/experimental.go diff --git a/internal/flow/internal/testcomponents/fake.go b/internal/alloy/internal/testcomponents/fake.go similarity index 100% rename from internal/flow/internal/testcomponents/fake.go rename to internal/alloy/internal/testcomponents/fake.go diff --git a/internal/flow/internal/testcomponents/module/file/file.go b/internal/alloy/internal/testcomponents/module/file/file.go similarity index 98% rename from internal/flow/internal/testcomponents/module/file/file.go rename to internal/alloy/internal/testcomponents/module/file/file.go index 0941df8418..46f5ac5b8c 100644 --- a/internal/flow/internal/testcomponents/module/file/file.go +++ b/internal/alloy/internal/testcomponents/module/file/file.go @@ -6,10 +6,10 @@ import ( "go.uber.org/atomic" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents/module" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/local/file" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/testcomponents/module" "github.com/grafana/alloy/syntax/alloytypes" ) diff --git a/internal/flow/internal/testcomponents/module/git/git.go b/internal/alloy/internal/testcomponents/module/git/git.go similarity index 97% rename from internal/flow/internal/testcomponents/module/git/git.go rename to internal/alloy/internal/testcomponents/module/git/git.go index d5e9a2ec4e..7d79cb405e 100644 --- a/internal/flow/internal/testcomponents/module/git/git.go +++ b/internal/alloy/internal/testcomponents/module/git/git.go @@ -10,10 +10,10 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents/module" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/testcomponents/module" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/vcs" ) diff --git a/internal/flow/internal/testcomponents/module/http/http.go b/internal/alloy/internal/testcomponents/module/http/http.go similarity index 98% rename from internal/flow/internal/testcomponents/module/http/http.go rename to internal/alloy/internal/testcomponents/module/http/http.go index ffb18d4e17..d615b59258 100644 --- a/internal/flow/internal/testcomponents/module/http/http.go +++ b/internal/alloy/internal/testcomponents/module/http/http.go @@ -6,10 +6,10 @@ import ( "go.uber.org/atomic" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents/module" "github.com/grafana/alloy/internal/component" remote_http "github.com/grafana/alloy/internal/component/remote/http" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/testcomponents/module" "github.com/grafana/alloy/syntax/alloytypes" ) diff --git a/internal/flow/internal/testcomponents/module/module.go b/internal/alloy/internal/testcomponents/module/module.go similarity index 98% rename from internal/flow/internal/testcomponents/module/module.go rename to internal/alloy/internal/testcomponents/module/module.go index 2fe70e5e8e..3407929fa5 100644 --- a/internal/flow/internal/testcomponents/module/module.go +++ b/internal/alloy/internal/testcomponents/module/module.go @@ -7,8 +7,8 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/logging/level" ) // ModuleComponent holds the common properties for module components. diff --git a/internal/flow/internal/testcomponents/module/string/string.go b/internal/alloy/internal/testcomponents/module/string/string.go similarity index 96% rename from internal/flow/internal/testcomponents/module/string/string.go rename to internal/alloy/internal/testcomponents/module/string/string.go index 7012aa1b9a..6cc0bf8396 100644 --- a/internal/flow/internal/testcomponents/module/string/string.go +++ b/internal/alloy/internal/testcomponents/module/string/string.go @@ -3,9 +3,9 @@ package string import ( "context" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents/module" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/testcomponents/module" "github.com/grafana/alloy/syntax/alloytypes" ) diff --git a/internal/flow/internal/testcomponents/passthrough.go b/internal/alloy/internal/testcomponents/passthrough.go similarity index 97% rename from internal/flow/internal/testcomponents/passthrough.go rename to internal/alloy/internal/testcomponents/passthrough.go index 278f35b578..46c694a43a 100644 --- a/internal/flow/internal/testcomponents/passthrough.go +++ b/internal/alloy/internal/testcomponents/passthrough.go @@ -5,9 +5,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/flow/internal/testcomponents/sumation.go b/internal/alloy/internal/testcomponents/sumation.go similarity index 96% rename from internal/flow/internal/testcomponents/sumation.go rename to internal/alloy/internal/testcomponents/sumation.go index c4207c2892..6fc28ab7e0 100644 --- a/internal/flow/internal/testcomponents/sumation.go +++ b/internal/alloy/internal/testcomponents/sumation.go @@ -4,9 +4,9 @@ import ( "context" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "go.uber.org/atomic" ) diff --git a/internal/flow/internal/testcomponents/tick.go b/internal/alloy/internal/testcomponents/tick.go similarity index 97% rename from internal/flow/internal/testcomponents/tick.go rename to internal/alloy/internal/testcomponents/tick.go index 1be12fda39..d94eceeef3 100644 --- a/internal/flow/internal/testcomponents/tick.go +++ b/internal/alloy/internal/testcomponents/tick.go @@ -7,9 +7,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/flow/internal/testservices/doc.go b/internal/alloy/internal/testservices/doc.go similarity index 100% rename from internal/flow/internal/testservices/doc.go rename to internal/alloy/internal/testservices/doc.go diff --git a/internal/flow/internal/testservices/fake.go b/internal/alloy/internal/testservices/fake.go similarity index 100% rename from internal/flow/internal/testservices/fake.go rename to internal/alloy/internal/testservices/fake.go diff --git a/internal/flow/internal/worker/worker_pool.go b/internal/alloy/internal/worker/worker_pool.go similarity index 100% rename from internal/flow/internal/worker/worker_pool.go rename to internal/alloy/internal/worker/worker_pool.go diff --git a/internal/flow/internal/worker/worker_pool_test.go b/internal/alloy/internal/worker/worker_pool_test.go similarity index 100% rename from internal/flow/internal/worker/worker_pool_test.go rename to internal/alloy/internal/worker/worker_pool_test.go diff --git a/internal/flow/logging/handler.go b/internal/alloy/logging/handler.go similarity index 100% rename from internal/flow/logging/handler.go rename to internal/alloy/logging/handler.go diff --git a/internal/flow/logging/handler_test.go b/internal/alloy/logging/handler_test.go similarity index 100% rename from internal/flow/logging/handler_test.go rename to internal/alloy/logging/handler_test.go diff --git a/internal/flow/logging/level/level.go b/internal/alloy/logging/level/level.go similarity index 96% rename from internal/flow/logging/level/level.go rename to internal/alloy/logging/level/level.go index 0cce098d37..bb46c29af9 100644 --- a/internal/flow/logging/level/level.go +++ b/internal/alloy/logging/level/level.go @@ -6,7 +6,7 @@ import ( "github.com/go-kit/log" gokitlevel "github.com/go-kit/log/level" - "github.com/grafana/alloy/internal/flow/logging" + "github.com/grafana/alloy/internal/alloy/logging" ) const ( diff --git a/internal/flow/logging/logger.go b/internal/alloy/logging/logger.go similarity index 100% rename from internal/flow/logging/logger.go rename to internal/alloy/logging/logger.go diff --git a/internal/flow/logging/logger_test.go b/internal/alloy/logging/logger_test.go similarity index 98% rename from internal/flow/logging/logger_test.go rename to internal/alloy/logging/logger_test.go index cb6823fe4a..f70fd0e927 100644 --- a/internal/flow/logging/logger_test.go +++ b/internal/alloy/logging/logger_test.go @@ -11,9 +11,9 @@ import ( "github.com/go-kit/log" gokitlevel "github.com/go-kit/log/level" + "github.com/grafana/alloy/internal/alloy/logging" + flowlevel "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" - "github.com/grafana/alloy/internal/flow/logging" - flowlevel "github.com/grafana/alloy/internal/flow/logging/level" "github.com/stretchr/testify/require" ) diff --git a/internal/flow/logging/options.go b/internal/alloy/logging/options.go similarity index 100% rename from internal/flow/logging/options.go rename to internal/alloy/logging/options.go diff --git a/internal/flow/module.go b/internal/alloy/module.go similarity index 95% rename from internal/flow/module.go rename to internal/alloy/module.go index 9684e631cd..8d0c79cd70 100644 --- a/internal/flow/module.go +++ b/internal/alloy/module.go @@ -1,4 +1,4 @@ -package flow +package alloy import ( "context" @@ -6,13 +6,13 @@ import ( "path" "sync" + "github.com/grafana/alloy/internal/alloy/internal/controller" + "github.com/grafana/alloy/internal/alloy/internal/worker" + "github.com/grafana/alloy/internal/alloy/logging" + "github.com/grafana/alloy/internal/alloy/logging/level" + "github.com/grafana/alloy/internal/alloy/tracing" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/controller" - "github.com/grafana/alloy/internal/flow/internal/worker" - "github.com/grafana/alloy/internal/flow/logging" - "github.com/grafana/alloy/internal/flow/logging/level" - "github.com/grafana/alloy/internal/flow/tracing" "github.com/grafana/alloy/syntax/ast" "github.com/grafana/alloy/syntax/scanner" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/flow/module_eval_test.go b/internal/alloy/module_eval_test.go similarity index 90% rename from internal/flow/module_eval_test.go rename to internal/alloy/module_eval_test.go index 0eeb41b58c..b97f543203 100644 --- a/internal/flow/module_eval_test.go +++ b/internal/alloy/module_eval_test.go @@ -1,4 +1,4 @@ -package flow_test +package alloy_test // This file contains tests which verify that the Flow controller correctly evaluates and updates modules, including // the module's arguments and exports. @@ -10,11 +10,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy" + "github.com/grafana/alloy/internal/alloy/internal/testcomponents" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow" - "github.com/grafana/alloy/internal/flow/internal/testcomponents" - "github.com/grafana/alloy/internal/flow/logging" "github.com/grafana/alloy/internal/service" cluster_service "github.com/grafana/alloy/internal/service/cluster" http_service "github.com/grafana/alloy/internal/service/http" @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - _ "github.com/grafana/alloy/internal/flow/internal/testcomponents/module/string" + _ "github.com/grafana/alloy/internal/alloy/internal/testcomponents/module/string" ) func TestUpdates_EmptyModule(t *testing.T) { @@ -56,8 +56,8 @@ func TestUpdates_EmptyModule(t *testing.T) { } ` - ctrl := flow.New(testOptions(t)) - f, err := flow.ParseSource(t.Name(), []byte(config)) + ctrl := alloy.New(testOptions(t)) + f, err := alloy.ParseSource(t.Name(), []byte(config)) require.NoError(t, err) require.NotNil(t, f) @@ -117,8 +117,8 @@ func TestUpdates_ThroughModule(t *testing.T) { } ` - ctrl := flow.New(testOptions(t)) - f, err := flow.ParseSource(t.Name(), []byte(config)) + ctrl := alloy.New(testOptions(t)) + f, err := alloy.ParseSource(t.Name(), []byte(config)) require.NoError(t, err) require.NotNil(t, f) @@ -179,8 +179,8 @@ func TestUpdates_TwoModules_SameCompNames(t *testing.T) { } ` - ctrl := flow.New(testOptions(t)) - f, err := flow.ParseSource(t.Name(), []byte(config)) + ctrl := alloy.New(testOptions(t)) + f, err := alloy.ParseSource(t.Name(), []byte(config)) require.NoError(t, err) require.NotNil(t, f) @@ -246,8 +246,8 @@ func TestUpdates_ReloadConfig(t *testing.T) { } ` - ctrl := flow.New(testOptions(t)) - f, err := flow.ParseSource(t.Name(), []byte(config)) + ctrl := alloy.New(testOptions(t)) + f, err := alloy.ParseSource(t.Name(), []byte(config)) require.NoError(t, err) require.NotNil(t, f) @@ -302,7 +302,7 @@ func TestUpdates_ReloadConfig(t *testing.T) { input = module.string.test.exports.output } ` - f, err = flow.ParseSource(t.Name(), []byte(config)) + f, err = alloy.ParseSource(t.Name(), []byte(config)) require.NoError(t, err) require.NotNil(t, f) @@ -315,7 +315,7 @@ func TestUpdates_ReloadConfig(t *testing.T) { }, 3*time.Second, 10*time.Millisecond) } -func testOptions(t *testing.T) flow.Options { +func testOptions(t *testing.T) alloy.Options { t.Helper() s, err := logging.New(os.Stderr, logging.DefaultOptions) require.NoError(t, err) @@ -331,7 +331,7 @@ func testOptions(t *testing.T) flow.Options { otelService := otel_service.New(s) require.NotNil(t, otelService) - return flow.Options{ + return alloy.Options{ Logger: s, DataPath: t.TempDir(), MinStability: featuregate.StabilityBeta, @@ -345,7 +345,7 @@ func testOptions(t *testing.T) flow.Options { } } -func getExport[T any](t *testing.T, ctrl *flow.Flow, moduleId string, nodeId string) T { +func getExport[T any](t *testing.T, ctrl *alloy.Flow, moduleId string, nodeId string) T { t.Helper() info, err := ctrl.GetComponent(component.ID{ ModuleID: moduleId, diff --git a/internal/flow/module_fail_test.go b/internal/alloy/module_fail_test.go similarity index 94% rename from internal/flow/module_fail_test.go rename to internal/alloy/module_fail_test.go index 0c300b71e7..1742816466 100644 --- a/internal/flow/module_fail_test.go +++ b/internal/alloy/module_fail_test.go @@ -1,12 +1,12 @@ -package flow +package alloy import ( "context" "testing" "time" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/internal/controller" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/internal/controller" "github.com/stretchr/testify/require" ) diff --git a/internal/flow/module_registry.go b/internal/alloy/module_registry.go similarity index 98% rename from internal/flow/module_registry.go rename to internal/alloy/module_registry.go index 34e89fb6f4..266cf68d3b 100644 --- a/internal/flow/module_registry.go +++ b/internal/alloy/module_registry.go @@ -1,4 +1,4 @@ -package flow +package alloy import ( "fmt" diff --git a/internal/flow/module_test.go b/internal/alloy/module_test.go similarity index 98% rename from internal/flow/module_test.go rename to internal/alloy/module_test.go index 3f262e9308..12837fce1d 100644 --- a/internal/flow/module_test.go +++ b/internal/alloy/module_test.go @@ -1,4 +1,4 @@ -package flow +package alloy import ( "context" @@ -6,11 +6,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/internal/controller" + "github.com/grafana/alloy/internal/alloy/internal/worker" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/internal/controller" - "github.com/grafana/alloy/internal/flow/internal/worker" - "github.com/grafana/alloy/internal/flow/logging" "github.com/grafana/alloy/internal/service" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" diff --git a/internal/flow/source.go b/internal/alloy/source.go similarity index 99% rename from internal/flow/source.go rename to internal/alloy/source.go index 70953591e1..05cb7eef15 100644 --- a/internal/flow/source.go +++ b/internal/alloy/source.go @@ -1,4 +1,4 @@ -package flow +package alloy import ( "crypto/sha256" diff --git a/internal/flow/source_test.go b/internal/alloy/source_test.go similarity index 96% rename from internal/flow/source_test.go rename to internal/alloy/source_test.go index d453d2b530..5847cabe43 100644 --- a/internal/flow/source_test.go +++ b/internal/alloy/source_test.go @@ -1,4 +1,4 @@ -package flow +package alloy import ( "strings" @@ -8,7 +8,7 @@ import ( "github.com/grafana/alloy/syntax/diag" "github.com/stretchr/testify/require" - _ "github.com/grafana/alloy/internal/flow/internal/testcomponents" // Include test components + _ "github.com/grafana/alloy/internal/alloy/internal/testcomponents" // Include test components ) func TestParseSource(t *testing.T) { diff --git a/internal/flow/testdata/import_error/import_error_1.txtar b/internal/alloy/testdata/import_error/import_error_1.txtar similarity index 100% rename from internal/flow/testdata/import_error/import_error_1.txtar rename to internal/alloy/testdata/import_error/import_error_1.txtar diff --git a/internal/flow/testdata/import_error/import_error_2.txtar b/internal/alloy/testdata/import_error/import_error_2.txtar similarity index 100% rename from internal/flow/testdata/import_error/import_error_2.txtar rename to internal/alloy/testdata/import_error/import_error_2.txtar diff --git a/internal/flow/testdata/import_error/import_error_3.txtar b/internal/alloy/testdata/import_error/import_error_3.txtar similarity index 100% rename from internal/flow/testdata/import_error/import_error_3.txtar rename to internal/alloy/testdata/import_error/import_error_3.txtar diff --git a/internal/flow/testdata/import_error/import_error_4.txtar b/internal/alloy/testdata/import_error/import_error_4.txtar similarity index 100% rename from internal/flow/testdata/import_error/import_error_4.txtar rename to internal/alloy/testdata/import_error/import_error_4.txtar diff --git a/internal/flow/testdata/import_file/import_file_1.txtar b/internal/alloy/testdata/import_file/import_file_1.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_1.txtar rename to internal/alloy/testdata/import_file/import_file_1.txtar diff --git a/internal/flow/testdata/import_file/import_file_10.txtar b/internal/alloy/testdata/import_file/import_file_10.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_10.txtar rename to internal/alloy/testdata/import_file/import_file_10.txtar diff --git a/internal/flow/testdata/import_file/import_file_11.txtar b/internal/alloy/testdata/import_file/import_file_11.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_11.txtar rename to internal/alloy/testdata/import_file/import_file_11.txtar diff --git a/internal/flow/testdata/import_file/import_file_12.txtar b/internal/alloy/testdata/import_file/import_file_12.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_12.txtar rename to internal/alloy/testdata/import_file/import_file_12.txtar diff --git a/internal/flow/testdata/import_file/import_file_13.txtar b/internal/alloy/testdata/import_file/import_file_13.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_13.txtar rename to internal/alloy/testdata/import_file/import_file_13.txtar diff --git a/internal/flow/testdata/import_file/import_file_14.txtar b/internal/alloy/testdata/import_file/import_file_14.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_14.txtar rename to internal/alloy/testdata/import_file/import_file_14.txtar diff --git a/internal/flow/testdata/import_file/import_file_15.txtar b/internal/alloy/testdata/import_file/import_file_15.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_15.txtar rename to internal/alloy/testdata/import_file/import_file_15.txtar diff --git a/internal/flow/testdata/import_file/import_file_16.txtar b/internal/alloy/testdata/import_file/import_file_16.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_16.txtar rename to internal/alloy/testdata/import_file/import_file_16.txtar diff --git a/internal/flow/testdata/import_file/import_file_2.txtar b/internal/alloy/testdata/import_file/import_file_2.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_2.txtar rename to internal/alloy/testdata/import_file/import_file_2.txtar diff --git a/internal/flow/testdata/import_file/import_file_3.txtar b/internal/alloy/testdata/import_file/import_file_3.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_3.txtar rename to internal/alloy/testdata/import_file/import_file_3.txtar diff --git a/internal/flow/testdata/import_file/import_file_4.txtar b/internal/alloy/testdata/import_file/import_file_4.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_4.txtar rename to internal/alloy/testdata/import_file/import_file_4.txtar diff --git a/internal/flow/testdata/import_file/import_file_5.txtar b/internal/alloy/testdata/import_file/import_file_5.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_5.txtar rename to internal/alloy/testdata/import_file/import_file_5.txtar diff --git a/internal/flow/testdata/import_file/import_file_6.txtar b/internal/alloy/testdata/import_file/import_file_6.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_6.txtar rename to internal/alloy/testdata/import_file/import_file_6.txtar diff --git a/internal/flow/testdata/import_file/import_file_7.txtar b/internal/alloy/testdata/import_file/import_file_7.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_7.txtar rename to internal/alloy/testdata/import_file/import_file_7.txtar diff --git a/internal/flow/testdata/import_file/import_file_8.txtar b/internal/alloy/testdata/import_file/import_file_8.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_8.txtar rename to internal/alloy/testdata/import_file/import_file_8.txtar diff --git a/internal/flow/testdata/import_file/import_file_9.txtar b/internal/alloy/testdata/import_file/import_file_9.txtar similarity index 100% rename from internal/flow/testdata/import_file/import_file_9.txtar rename to internal/alloy/testdata/import_file/import_file_9.txtar diff --git a/internal/flow/testdata/import_file_folder/import_file_folder_1.txtar b/internal/alloy/testdata/import_file_folder/import_file_folder_1.txtar similarity index 100% rename from internal/flow/testdata/import_file_folder/import_file_folder_1.txtar rename to internal/alloy/testdata/import_file_folder/import_file_folder_1.txtar diff --git a/internal/flow/testdata/import_file_folder/import_file_folder_2.txtar b/internal/alloy/testdata/import_file_folder/import_file_folder_2.txtar similarity index 100% rename from internal/flow/testdata/import_file_folder/import_file_folder_2.txtar rename to internal/alloy/testdata/import_file_folder/import_file_folder_2.txtar diff --git a/internal/flow/testdata/import_file_folder/import_file_folder_3.txtar b/internal/alloy/testdata/import_file_folder/import_file_folder_3.txtar similarity index 100% rename from internal/flow/testdata/import_file_folder/import_file_folder_3.txtar rename to internal/alloy/testdata/import_file_folder/import_file_folder_3.txtar diff --git a/internal/flow/testdata/import_file_folder/import_file_folder_4.txtar b/internal/alloy/testdata/import_file_folder/import_file_folder_4.txtar similarity index 100% rename from internal/flow/testdata/import_file_folder/import_file_folder_4.txtar rename to internal/alloy/testdata/import_file_folder/import_file_folder_4.txtar diff --git a/internal/flow/testdata/import_file_folder/import_file_folder_5.txtar b/internal/alloy/testdata/import_file_folder/import_file_folder_5.txtar similarity index 100% rename from internal/flow/testdata/import_file_folder/import_file_folder_5.txtar rename to internal/alloy/testdata/import_file_folder/import_file_folder_5.txtar diff --git a/internal/flow/testdata/import_git/import_git_1.txtar b/internal/alloy/testdata/import_git/import_git_1.txtar similarity index 100% rename from internal/flow/testdata/import_git/import_git_1.txtar rename to internal/alloy/testdata/import_git/import_git_1.txtar diff --git a/internal/flow/testdata/import_git/import_git_2.txtar b/internal/alloy/testdata/import_git/import_git_2.txtar similarity index 100% rename from internal/flow/testdata/import_git/import_git_2.txtar rename to internal/alloy/testdata/import_git/import_git_2.txtar diff --git a/internal/flow/testdata/import_http/import_http_1.txtar b/internal/alloy/testdata/import_http/import_http_1.txtar similarity index 100% rename from internal/flow/testdata/import_http/import_http_1.txtar rename to internal/alloy/testdata/import_http/import_http_1.txtar diff --git a/internal/flow/testdata/import_string/import_string_1.txtar b/internal/alloy/testdata/import_string/import_string_1.txtar similarity index 100% rename from internal/flow/testdata/import_string/import_string_1.txtar rename to internal/alloy/testdata/import_string/import_string_1.txtar diff --git a/internal/flow/tracing/internal/jaegerremote/LICENSE b/internal/alloy/tracing/internal/jaegerremote/LICENSE similarity index 100% rename from internal/flow/tracing/internal/jaegerremote/LICENSE rename to internal/alloy/tracing/internal/jaegerremote/LICENSE diff --git a/internal/flow/tracing/internal/jaegerremote/README.md b/internal/alloy/tracing/internal/jaegerremote/README.md similarity index 100% rename from internal/flow/tracing/internal/jaegerremote/README.md rename to internal/alloy/tracing/internal/jaegerremote/README.md diff --git a/internal/flow/tracing/internal/jaegerremote/constants.go b/internal/alloy/tracing/internal/jaegerremote/constants.go similarity index 100% rename from internal/flow/tracing/internal/jaegerremote/constants.go rename to internal/alloy/tracing/internal/jaegerremote/constants.go diff --git a/internal/flow/tracing/internal/jaegerremote/doc.go b/internal/alloy/tracing/internal/jaegerremote/doc.go similarity index 100% rename from internal/flow/tracing/internal/jaegerremote/doc.go rename to internal/alloy/tracing/internal/jaegerremote/doc.go diff --git a/internal/flow/tracing/internal/jaegerremote/sampler.go b/internal/alloy/tracing/internal/jaegerremote/sampler.go similarity index 99% rename from internal/flow/tracing/internal/jaegerremote/sampler.go rename to internal/alloy/tracing/internal/jaegerremote/sampler.go index a21359cbb5..40be8544d7 100644 --- a/internal/flow/tracing/internal/jaegerremote/sampler.go +++ b/internal/alloy/tracing/internal/jaegerremote/sampler.go @@ -23,7 +23,7 @@ import ( "math" "sync" - "github.com/grafana/alloy/internal/flow/tracing/internal/jaegerremote/utils" + "github.com/grafana/alloy/internal/alloy/tracing/internal/jaegerremote/utils" jaeger_api_v2 "github.com/jaegertracing/jaeger/proto-gen/api_v2" "go.opentelemetry.io/otel/sdk/trace" oteltrace "go.opentelemetry.io/otel/trace" diff --git a/internal/flow/tracing/internal/jaegerremote/sampler_remote.go b/internal/alloy/tracing/internal/jaegerremote/sampler_remote.go similarity index 100% rename from internal/flow/tracing/internal/jaegerremote/sampler_remote.go rename to internal/alloy/tracing/internal/jaegerremote/sampler_remote.go diff --git a/internal/flow/tracing/internal/jaegerremote/sampler_remote_options.go b/internal/alloy/tracing/internal/jaegerremote/sampler_remote_options.go similarity index 100% rename from internal/flow/tracing/internal/jaegerremote/sampler_remote_options.go rename to internal/alloy/tracing/internal/jaegerremote/sampler_remote_options.go diff --git a/internal/flow/tracing/internal/jaegerremote/utils/http_json.go b/internal/alloy/tracing/internal/jaegerremote/utils/http_json.go similarity index 100% rename from internal/flow/tracing/internal/jaegerremote/utils/http_json.go rename to internal/alloy/tracing/internal/jaegerremote/utils/http_json.go diff --git a/internal/flow/tracing/internal/jaegerremote/utils/rate_limiter.go b/internal/alloy/tracing/internal/jaegerremote/utils/rate_limiter.go similarity index 100% rename from internal/flow/tracing/internal/jaegerremote/utils/rate_limiter.go rename to internal/alloy/tracing/internal/jaegerremote/utils/rate_limiter.go diff --git a/internal/flow/tracing/lazy_sampler.go b/internal/alloy/tracing/lazy_sampler.go similarity index 100% rename from internal/flow/tracing/lazy_sampler.go rename to internal/alloy/tracing/lazy_sampler.go diff --git a/internal/flow/tracing/otelcol_client.go b/internal/alloy/tracing/otelcol_client.go similarity index 100% rename from internal/flow/tracing/otelcol_client.go rename to internal/alloy/tracing/otelcol_client.go diff --git a/internal/flow/tracing/tracing.go b/internal/alloy/tracing/tracing.go similarity index 98% rename from internal/flow/tracing/tracing.go rename to internal/alloy/tracing/tracing.go index 69b29a41c5..65831de9db 100644 --- a/internal/flow/tracing/tracing.go +++ b/internal/alloy/tracing/tracing.go @@ -8,9 +8,9 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/tracing/internal/jaegerremote" "github.com/grafana/alloy/internal/build" "github.com/grafana/alloy/internal/component/otelcol" - "github.com/grafana/alloy/internal/flow/tracing/internal/jaegerremote" "go.opentelemetry.io/otel/exporters/otlp/otlptrace" "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" diff --git a/internal/flow/tracing/wrap_tracer.go b/internal/alloy/tracing/wrap_tracer.go similarity index 100% rename from internal/flow/tracing/wrap_tracer.go rename to internal/alloy/tracing/wrap_tracer.go diff --git a/internal/alloycli/cluster_builder.go b/internal/alloycli/cluster_builder.go index ab85490b88..d97f9352a8 100644 --- a/internal/alloycli/cluster_builder.go +++ b/internal/alloycli/cluster_builder.go @@ -9,7 +9,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/service/cluster" "github.com/grafana/ckit/advertise" "github.com/hashicorp/go-discover" diff --git a/internal/alloycli/cmd_run.go b/internal/alloycli/cmd_run.go index aff557cff0..6635f28eaf 100644 --- a/internal/alloycli/cmd_run.go +++ b/internal/alloycli/cmd_run.go @@ -17,16 +17,16 @@ import ( "github.com/fatih/color" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy" + "github.com/grafana/alloy/internal/alloy/logging" + "github.com/grafana/alloy/internal/alloy/logging/level" + "github.com/grafana/alloy/internal/alloy/tracing" "github.com/grafana/alloy/internal/alloyseed" "github.com/grafana/alloy/internal/boringcrypto" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/converter" convert_diag "github.com/grafana/alloy/internal/converter/diag" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow" - "github.com/grafana/alloy/internal/flow/logging" - "github.com/grafana/alloy/internal/flow/logging/level" - "github.com/grafana/alloy/internal/flow/tracing" "github.com/grafana/alloy/internal/service" httpservice "github.com/grafana/alloy/internal/service/http" "github.com/grafana/alloy/internal/service/labelstore" @@ -219,7 +219,7 @@ func (fr *alloyRun) Run(configPath string) error { // To work around this, we lazily create variables for the functions the HTTP // service needs and set them after the Alloy controller exists. var ( - reload func() (*flow.Source, error) + reload func() (*alloy.Source, error) ready func() bool ) @@ -249,7 +249,7 @@ func (fr *alloyRun) Run(configPath string) error { Gatherer: prometheus.DefaultGatherer, ReadyFunc: func() bool { return ready() }, - ReloadFunc: func() (*flow.Source, error) { return reload() }, + ReloadFunc: func() (*alloy.Source, error) { return reload() }, HTTPListenAddr: fr.httpListenAddr, MemoryListenAddr: fr.inMemoryAddr, @@ -276,7 +276,7 @@ func (fr *alloyRun) Run(configPath string) error { labelService := labelstore.New(l, reg) alloyseed.Init(fr.storagePath, l) - f := flow.New(flow.Options{ + f := alloy.New(alloy.Options{ Logger: l, Tracer: t, DataPath: fr.storagePath, @@ -293,7 +293,7 @@ func (fr *alloyRun) Run(configPath string) error { }) ready = f.Ready - reload = func() (*flow.Source, error) { + reload = func() (*alloy.Source, error) { alloySource, err := loadAlloySource(configPath, fr.configFormat, fr.configBypassConversionErrors, fr.configExtraArgs) defer instrumentation.InstrumentSHA256(alloySource.SHA256()) defer instrumentation.InstrumentLoad(err == nil) @@ -382,7 +382,7 @@ func (fr *alloyRun) Run(configPath string) error { } // getEnabledComponentsFunc returns a function that gets the current enabled components -func getEnabledComponentsFunc(f *flow.Flow) func() map[string]interface{} { +func getEnabledComponentsFunc(f *alloy.Flow) func() map[string]interface{} { return func() map[string]interface{} { components := component.GetAllComponents(f, component.InfoOptions{}) componentNames := map[string]struct{}{} @@ -396,7 +396,7 @@ func getEnabledComponentsFunc(f *flow.Flow) func() map[string]interface{} { } } -func loadAlloySource(path string, converterSourceFormat string, converterBypassErrors bool, configExtraArgs string) (*flow.Source, error) { +func loadAlloySource(path string, converterSourceFormat string, converterBypassErrors bool, configExtraArgs string) (*alloy.Source, error) { fi, err := os.Stat(path) if err != nil { return nil, err @@ -428,7 +428,7 @@ func loadAlloySource(path string, converterSourceFormat string, converterBypassE return nil, err } - return flow.ParseSources(sources) + return alloy.ParseSources(sources) } bb, err := os.ReadFile(path) @@ -452,7 +452,7 @@ func loadAlloySource(path string, converterSourceFormat string, converterBypassE instrumentation.InstrumentConfig(bb) - return flow.ParseSource(path, bb) + return alloy.ParseSource(path, bb) } func interruptContext() (context.Context, context.CancelFunc) { diff --git a/internal/alloycli/resources_collector.go b/internal/alloycli/resources_collector.go index 33ffa4d9d3..02336330a8 100644 --- a/internal/alloycli/resources_collector.go +++ b/internal/alloycli/resources_collector.go @@ -5,7 +5,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/shirou/gopsutil/v3/net" "github.com/shirou/gopsutil/v3/process" diff --git a/internal/alloyseed/alloyseed.go b/internal/alloyseed/alloyseed.go index 13f1f661f7..4eba022858 100644 --- a/internal/alloyseed/alloyseed.go +++ b/internal/alloyseed/alloyseed.go @@ -11,7 +11,7 @@ import ( "github.com/go-kit/log" "github.com/google/uuid" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/version" ) diff --git a/internal/cmd/alloy-service/service_test.go b/internal/cmd/alloy-service/service_test.go index 561db0ce54..d67958f060 100644 --- a/internal/cmd/alloy-service/service_test.go +++ b/internal/cmd/alloy-service/service_test.go @@ -13,7 +13,7 @@ import ( "testing" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/componenttest" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/util" "github.com/phayes/freeport" "github.com/stretchr/testify/require" diff --git a/internal/component/common/kubernetes/event.go b/internal/component/common/kubernetes/event.go index 785c743ca5..557ee0ee57 100644 --- a/internal/component/common/kubernetes/event.go +++ b/internal/component/common/kubernetes/event.go @@ -2,7 +2,7 @@ package kubernetes import ( "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" ) diff --git a/internal/component/common/kubernetes/kubernetes.go b/internal/component/common/kubernetes/kubernetes.go index 1a6ad2aff4..949a49e2cd 100644 --- a/internal/component/common/kubernetes/kubernetes.go +++ b/internal/component/common/kubernetes/kubernetes.go @@ -5,8 +5,8 @@ import ( "reflect" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" commoncfg "github.com/grafana/alloy/internal/component/common/config" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/useragent" promconfig "github.com/prometheus/common/config" "k8s.io/client-go/rest" diff --git a/internal/component/common/loki/client/client.go b/internal/component/common/loki/client/client.go index 857f56041f..c61225f6a6 100644 --- a/internal/component/common/loki/client/client.go +++ b/internal/component/common/loki/client/client.go @@ -13,7 +13,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/useragent" "github.com/grafana/dskit/backoff" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/component/common/loki/client/internal/marker_handler.go b/internal/component/common/loki/client/internal/marker_handler.go index 7bb78a9f6a..c51ecb51dc 100644 --- a/internal/component/common/loki/client/internal/marker_handler.go +++ b/internal/component/common/loki/client/internal/marker_handler.go @@ -7,8 +7,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki/wal" - "github.com/grafana/alloy/internal/flow/logging/level" ) type MarkerHandler interface { diff --git a/internal/component/common/loki/client/manager.go b/internal/component/common/loki/client/manager.go index b57b93e9cf..b4ebbb3806 100644 --- a/internal/component/common/loki/client/manager.go +++ b/internal/component/common/loki/client/manager.go @@ -7,8 +7,8 @@ import ( "sync" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki/client/internal" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/grafana/alloy/internal/component/common/loki" diff --git a/internal/component/common/loki/positions/positions.go b/internal/component/common/loki/positions/positions.go index cefcd17386..6591e93fa2 100644 --- a/internal/component/common/loki/positions/positions.go +++ b/internal/component/common/loki/positions/positions.go @@ -15,7 +15,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" yaml "gopkg.in/yaml.v2" ) diff --git a/internal/component/common/loki/wal/internal/watcher_state.go b/internal/component/common/loki/wal/internal/watcher_state.go index 5de6aacc43..74336d2680 100644 --- a/internal/component/common/loki/wal/internal/watcher_state.go +++ b/internal/component/common/loki/wal/internal/watcher_state.go @@ -4,7 +4,7 @@ import ( "sync" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" ) const ( diff --git a/internal/component/common/loki/wal/wal.go b/internal/component/common/loki/wal/wal.go index eb23b4e631..83614a21b2 100644 --- a/internal/component/common/loki/wal/wal.go +++ b/internal/component/common/loki/wal/wal.go @@ -5,7 +5,7 @@ import ( "os" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/tsdb/wlog" diff --git a/internal/component/common/loki/wal/watcher.go b/internal/component/common/loki/wal/watcher.go index 6de3cf2578..bfbd324fb2 100644 --- a/internal/component/common/loki/wal/watcher.go +++ b/internal/component/common/loki/wal/watcher.go @@ -10,8 +10,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki/wal/internal" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/prometheus/prometheus/tsdb/record" "github.com/prometheus/prometheus/tsdb/wlog" diff --git a/internal/component/common/loki/wal/watcher_test.go b/internal/component/common/loki/wal/watcher_test.go index 714495860d..13292186d4 100644 --- a/internal/component/common/loki/wal/watcher_test.go +++ b/internal/component/common/loki/wal/watcher_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/tsdb/record" diff --git a/internal/component/common/loki/wal/writer.go b/internal/component/common/loki/wal/writer.go index a3d29ad571..46df4cb9f9 100644 --- a/internal/component/common/loki/wal/writer.go +++ b/internal/component/common/loki/wal/writer.go @@ -10,7 +10,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/internal/component/common/loki/wal/writer_test.go b/internal/component/common/loki/wal/writer_test.go index cbfb378d5f..24f7880109 100644 --- a/internal/component/common/loki/wal/writer_test.go +++ b/internal/component/common/loki/wal/writer_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/stretchr/testify/require" diff --git a/internal/component/common/net/server.go b/internal/component/common/net/server.go index eec9fb3a6e..1f526bd2d7 100644 --- a/internal/component/common/net/server.go +++ b/internal/component/common/net/server.go @@ -5,7 +5,7 @@ import ( "github.com/go-kit/log" "github.com/gorilla/mux" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" dskit "github.com/grafana/dskit/server" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/internal/component/discovery/consulagent/promtail_consulagent.go b/internal/component/discovery/consulagent/promtail_consulagent.go index 7144394f30..7bf6d6eb7e 100644 --- a/internal/component/discovery/consulagent/promtail_consulagent.go +++ b/internal/component/discovery/consulagent/promtail_consulagent.go @@ -22,7 +22,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" consul "github.com/hashicorp/consul/api" conntrack "github.com/mwitkow/go-conntrack" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/component/discovery/process/process_stub.go b/internal/component/discovery/process/process_stub.go index 6266d77d99..a793c3897f 100644 --- a/internal/component/discovery/process/process_stub.go +++ b/internal/component/discovery/process/process_stub.go @@ -5,10 +5,10 @@ package process import ( "context" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/component/discovery/relabel/relabel_test.go b/internal/component/discovery/relabel/relabel_test.go index 536ab7dd62..4c217a39d5 100644 --- a/internal/component/discovery/relabel/relabel_test.go +++ b/internal/component/discovery/relabel/relabel_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" flow_relabel "github.com/grafana/alloy/internal/component/common/relabel" "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/component/discovery/relabel" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/syntax" "github.com/stretchr/testify/require" ) diff --git a/internal/component/faro/receiver/exporters.go b/internal/component/faro/receiver/exporters.go index 6609aa1aa9..73eb04b52d 100644 --- a/internal/component/faro/receiver/exporters.go +++ b/internal/component/faro/receiver/exporters.go @@ -8,10 +8,10 @@ import ( "github.com/go-kit/log" "github.com/go-logfmt/logfmt" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/faro/receiver/internal/payload" "github.com/grafana/alloy/internal/component/otelcol" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/internal/component/faro/receiver/handler.go b/internal/component/faro/receiver/handler.go index 68efa9c633..37f16e340f 100644 --- a/internal/component/faro/receiver/handler.go +++ b/internal/component/faro/receiver/handler.go @@ -8,8 +8,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/faro/receiver/internal/payload" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/rs/cors" "golang.org/x/time/rate" diff --git a/internal/component/faro/receiver/receiver.go b/internal/component/faro/receiver/receiver.go index 2e7531950b..c5af132071 100644 --- a/internal/component/faro/receiver/receiver.go +++ b/internal/component/faro/receiver/receiver.go @@ -8,9 +8,9 @@ import ( "github.com/go-kit/log" "github.com/go-sourcemap/sourcemap" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/component/faro/receiver/receiver_test.go b/internal/component/faro/receiver/receiver_test.go index 920faad024..0ac9f3bdd6 100644 --- a/internal/component/faro/receiver/receiver_test.go +++ b/internal/component/faro/receiver/receiver_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/otelcol" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/loki/pkg/logproto" "github.com/phayes/freeport" diff --git a/internal/component/faro/receiver/server.go b/internal/component/faro/receiver/server.go index 8207594700..8c20131041 100644 --- a/internal/component/faro/receiver/server.go +++ b/internal/component/faro/receiver/server.go @@ -8,7 +8,7 @@ import ( "github.com/go-kit/log" "github.com/gorilla/mux" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/dskit/instrument" "github.com/grafana/dskit/middleware" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/component/faro/receiver/sourcemaps.go b/internal/component/faro/receiver/sourcemaps.go index 4de618b983..3ff638700f 100644 --- a/internal/component/faro/receiver/sourcemaps.go +++ b/internal/component/faro/receiver/sourcemaps.go @@ -16,8 +16,8 @@ import ( "github.com/go-kit/log" "github.com/go-sourcemap/sourcemap" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/faro/receiver/internal/payload" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util/wildcard" "github.com/prometheus/client_golang/prometheus" "github.com/vincent-petithory/dataurl" diff --git a/internal/component/local/file/file.go b/internal/component/local/file/file.go index 941d1c5140..36cb9c7d50 100644 --- a/internal/component/local/file/file.go +++ b/internal/component/local/file/file.go @@ -10,10 +10,10 @@ import ( "github.com/prometheus/client_golang/prometheus" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" filedetector "github.com/grafana/alloy/internal/filedetector" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/syntax/alloytypes" ) diff --git a/internal/component/local/file/file_test.go b/internal/component/local/file/file_test.go index 3f119a46d5..b7adbf2a31 100644 --- a/internal/component/local/file/file_test.go +++ b/internal/component/local/file/file_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/local/file" filedetector "github.com/grafana/alloy/internal/filedetector" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/syntax/alloytypes" "github.com/stretchr/testify/require" ) diff --git a/internal/component/local/file_match/file.go b/internal/component/local/file_match/file.go index c2421610fa..15c9fdae95 100644 --- a/internal/component/local/file_match/file.go +++ b/internal/component/local/file_match/file.go @@ -5,10 +5,10 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/component/local/file_match/watch.go b/internal/component/local/file_match/watch.go index e66544478c..7572eeb525 100644 --- a/internal/component/local/file_match/watch.go +++ b/internal/component/local/file_match/watch.go @@ -7,8 +7,8 @@ import ( "github.com/go-kit/log" "github.com/bmatcuk/doublestar" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/discovery" - "github.com/grafana/alloy/internal/flow/logging/level" ) // watch handles a single discovery.target for file watching. diff --git a/internal/component/loki/echo/echo.go b/internal/component/loki/echo/echo.go index 1596893c2c..556042fc75 100644 --- a/internal/component/loki/echo/echo.go +++ b/internal/component/loki/echo/echo.go @@ -4,10 +4,10 @@ import ( "context" "sync" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/component/loki/process/process_test.go b/internal/component/loki/process/process_test.go index 57db4bcfde..456f4bbefd 100644 --- a/internal/component/loki/process/process_test.go +++ b/internal/component/loki/process/process_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/component/loki/process/stages" lsf "github.com/grafana/alloy/internal/component/loki/source/file" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/loki/pkg/logproto" diff --git a/internal/component/loki/process/stages/drop.go b/internal/component/loki/process/stages/drop.go index 1cdc6a2f70..fae4c4559e 100644 --- a/internal/component/loki/process/stages/drop.go +++ b/internal/component/loki/process/stages/drop.go @@ -10,7 +10,7 @@ import ( "github.com/alecthomas/units" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/client_golang/prometheus" ) diff --git a/internal/component/loki/process/stages/eventlogmessage.go b/internal/component/loki/process/stages/eventlogmessage.go index 884238bbe8..08a35679e2 100644 --- a/internal/component/loki/process/stages/eventlogmessage.go +++ b/internal/component/loki/process/stages/eventlogmessage.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/extensions.go b/internal/component/loki/process/stages/extensions.go index a2734542a3..3038048cf7 100644 --- a/internal/component/loki/process/stages/extensions.go +++ b/internal/component/loki/process/stages/extensions.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/syntax" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/internal/component/loki/process/stages/geoip.go b/internal/component/loki/process/stages/geoip.go index c60ce79e40..664dc5924b 100644 --- a/internal/component/loki/process/stages/geoip.go +++ b/internal/component/loki/process/stages/geoip.go @@ -7,7 +7,7 @@ import ( "reflect" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/jmespath/go-jmespath" "github.com/oschwald/geoip2-golang" "github.com/oschwald/maxminddb-golang" diff --git a/internal/component/loki/process/stages/json.go b/internal/component/loki/process/stages/json.go index c80535a1f4..026f9ebd7b 100644 --- a/internal/component/loki/process/stages/json.go +++ b/internal/component/loki/process/stages/json.go @@ -6,7 +6,7 @@ import ( "reflect" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/jmespath/go-jmespath" json "github.com/json-iterator/go" ) diff --git a/internal/component/loki/process/stages/labels.go b/internal/component/loki/process/stages/labels.go index 978faa506a..3baf15b26c 100644 --- a/internal/component/loki/process/stages/labels.go +++ b/internal/component/loki/process/stages/labels.go @@ -7,7 +7,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/limit.go b/internal/component/loki/process/stages/limit.go index 3179ec099b..9a7ebe5fb7 100644 --- a/internal/component/loki/process/stages/limit.go +++ b/internal/component/loki/process/stages/limit.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "golang.org/x/time/rate" diff --git a/internal/component/loki/process/stages/logfmt.go b/internal/component/loki/process/stages/logfmt.go index aee22bfc7a..bf077049fe 100644 --- a/internal/component/loki/process/stages/logfmt.go +++ b/internal/component/loki/process/stages/logfmt.go @@ -9,7 +9,7 @@ import ( "github.com/go-kit/log" "github.com/go-logfmt/logfmt" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/metric.go b/internal/component/loki/process/stages/metric.go index 92f63da512..7d39460eb0 100644 --- a/internal/component/loki/process/stages/metric.go +++ b/internal/component/loki/process/stages/metric.go @@ -9,8 +9,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/loki/process/metric" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/multiline.go b/internal/component/loki/process/stages/multiline.go index 2b7b0af971..5647a2aa2b 100644 --- a/internal/component/loki/process/stages/multiline.go +++ b/internal/component/loki/process/stages/multiline.go @@ -9,8 +9,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/output.go b/internal/component/loki/process/stages/output.go index 0a44f02f3d..c7f116a16b 100644 --- a/internal/component/loki/process/stages/output.go +++ b/internal/component/loki/process/stages/output.go @@ -6,7 +6,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/pack.go b/internal/component/loki/process/stages/pack.go index 11d223a7cc..32117861c3 100644 --- a/internal/component/loki/process/stages/pack.go +++ b/internal/component/loki/process/stages/pack.go @@ -9,7 +9,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/loki/pkg/logqlmodel" json "github.com/json-iterator/go" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/component/loki/process/stages/pipeline_test.go b/internal/component/loki/process/stages/pipeline_test.go index 8f50203d48..62b4c91124 100644 --- a/internal/component/loki/process/stages/pipeline_test.go +++ b/internal/component/loki/process/stages/pipeline_test.go @@ -9,8 +9,8 @@ import ( "github.com/grafana/alloy/internal/component/common/loki/client/fake" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/syntax" "github.com/grafana/loki/pkg/logproto" util_log "github.com/grafana/loki/pkg/util/log" diff --git a/internal/component/loki/process/stages/regex.go b/internal/component/loki/process/stages/regex.go index cd1b754931..bf02a258d4 100644 --- a/internal/component/loki/process/stages/regex.go +++ b/internal/component/loki/process/stages/regex.go @@ -8,7 +8,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/mitchellh/mapstructure" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/replace.go b/internal/component/loki/process/stages/replace.go index 35e63a7943..098255dc3b 100644 --- a/internal/component/loki/process/stages/replace.go +++ b/internal/component/loki/process/stages/replace.go @@ -10,7 +10,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/static_labels.go b/internal/component/loki/process/stages/static_labels.go index 113d561111..2d9a7713d0 100644 --- a/internal/component/loki/process/stages/static_labels.go +++ b/internal/component/loki/process/stages/static_labels.go @@ -7,7 +7,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/template.go b/internal/component/loki/process/stages/template.go index 342b2254c0..020042f720 100644 --- a/internal/component/loki/process/stages/template.go +++ b/internal/component/loki/process/stages/template.go @@ -13,7 +13,7 @@ import ( "github.com/Masterminds/sprig/v3" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/model" "golang.org/x/crypto/sha3" diff --git a/internal/component/loki/process/stages/tenant.go b/internal/component/loki/process/stages/tenant.go index 4e93ab2ebb..e9c452132b 100644 --- a/internal/component/loki/process/stages/tenant.go +++ b/internal/component/loki/process/stages/tenant.go @@ -6,7 +6,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/process/stages/timestamp.go b/internal/component/loki/process/stages/timestamp.go index 7474cf089a..65dddfacdc 100644 --- a/internal/component/loki/process/stages/timestamp.go +++ b/internal/component/loki/process/stages/timestamp.go @@ -7,7 +7,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" lru "github.com/hashicorp/golang-lru" "github.com/prometheus/common/model" diff --git a/internal/component/loki/relabel/relabel.go b/internal/component/loki/relabel/relabel.go index d094ddffe6..dd1304b276 100644 --- a/internal/component/loki/relabel/relabel.go +++ b/internal/component/loki/relabel/relabel.go @@ -5,11 +5,11 @@ import ( "reflect" "sync" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" flow_relabel "github.com/grafana/alloy/internal/component/common/relabel" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" lru "github.com/hashicorp/golang-lru" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/loki/relabel/relabel_test.go b/internal/component/loki/relabel/relabel_test.go index 51f7837650..6de0322bbf 100644 --- a/internal/component/loki/relabel/relabel_test.go +++ b/internal/component/loki/relabel/relabel_test.go @@ -7,12 +7,12 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" flow_relabel "github.com/grafana/alloy/internal/component/common/relabel" "github.com/grafana/alloy/internal/component/discovery" lsf "github.com/grafana/alloy/internal/component/loki/source/file" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/loki/pkg/logproto" diff --git a/internal/component/loki/rules/kubernetes/events.go b/internal/component/loki/rules/kubernetes/events.go index 78d184339d..6b7cd29a95 100644 --- a/internal/component/loki/rules/kubernetes/events.go +++ b/internal/component/loki/rules/kubernetes/events.go @@ -6,8 +6,8 @@ import ( "regexp" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/kubernetes" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/hashicorp/go-multierror" promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/prometheus/prometheus/model/rulefmt" diff --git a/internal/component/loki/rules/kubernetes/rules.go b/internal/component/loki/rules/kubernetes/rules.go index c38da8d005..9a74aba5a1 100644 --- a/internal/component/loki/rules/kubernetes/rules.go +++ b/internal/component/loki/rules/kubernetes/rules.go @@ -7,10 +7,10 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" commonK8s "github.com/grafana/alloy/internal/component/common/kubernetes" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" lokiClient "github.com/grafana/alloy/internal/loki/client" "github.com/grafana/dskit/backoff" "github.com/grafana/dskit/instrument" diff --git a/internal/component/loki/source/api/internal/lokipush/push_api_server.go b/internal/component/loki/source/api/internal/lokipush/push_api_server.go index 33f06fc1ef..a0340e5d4a 100644 --- a/internal/component/loki/source/api/internal/lokipush/push_api_server.go +++ b/internal/component/loki/source/api/internal/lokipush/push_api_server.go @@ -11,10 +11,10 @@ import ( "github.com/go-kit/log" "github.com/gorilla/mux" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" fnet "github.com/grafana/alloy/internal/component/common/net" frelabel "github.com/grafana/alloy/internal/component/common/relabel" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/dskit/tenant" "github.com/grafana/loki/pkg/loghttp/push" "github.com/grafana/loki/pkg/logproto" diff --git a/internal/component/loki/source/aws_firehose/internal/handler.go b/internal/component/loki/source/aws_firehose/internal/handler.go index 1a755065b0..34a53033f7 100644 --- a/internal/component/loki/source/aws_firehose/internal/handler.go +++ b/internal/component/loki/source/aws_firehose/internal/handler.go @@ -15,7 +15,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/loki/source/azure_event_hubs/azure_event_hubs.go b/internal/component/loki/source/azure_event_hubs/azure_event_hubs.go index b96486aa55..6a420a066f 100644 --- a/internal/component/loki/source/azure_event_hubs/azure_event_hubs.go +++ b/internal/component/loki/source/azure_event_hubs/azure_event_hubs.go @@ -7,13 +7,13 @@ import ( "sync" "github.com/IBM/sarama" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" flow_relabel "github.com/grafana/alloy/internal/component/common/relabel" "github.com/grafana/alloy/internal/component/loki/source/azure_event_hubs/internal/parser" kt "github.com/grafana/alloy/internal/component/loki/source/internal/kafkatarget" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/dskit/flagext" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/cloudflare/cloudflare.go b/internal/component/loki/source/cloudflare/cloudflare.go index 3f8e514799..34ff6e317f 100644 --- a/internal/component/loki/source/cloudflare/cloudflare.go +++ b/internal/component/loki/source/cloudflare/cloudflare.go @@ -13,12 +13,12 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" cft "github.com/grafana/alloy/internal/component/loki/source/cloudflare/internal/cloudflaretarget" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/syntax/alloytypes" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/source/cloudflare/internal/cloudflaretarget/target.go b/internal/component/loki/source/cloudflare/internal/cloudflaretarget/target.go index 58a7aaf24f..9d1de17c42 100644 --- a/internal/component/loki/source/cloudflare/internal/cloudflaretarget/target.go +++ b/internal/component/loki/source/cloudflare/internal/cloudflaretarget/target.go @@ -13,9 +13,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/cloudflare-go" "github.com/grafana/dskit/backoff" "github.com/grafana/dskit/concurrency" diff --git a/internal/component/loki/source/docker/docker.go b/internal/component/loki/source/docker/docker.go index 453e1667bb..05f9af5097 100644 --- a/internal/component/loki/source/docker/docker.go +++ b/internal/component/loki/source/docker/docker.go @@ -15,6 +15,7 @@ import ( "github.com/docker/docker/client" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" types "github.com/grafana/alloy/internal/component/common/config" "github.com/grafana/alloy/internal/component/common/loki" @@ -23,7 +24,6 @@ import ( "github.com/grafana/alloy/internal/component/discovery" dt "github.com/grafana/alloy/internal/component/loki/source/docker/internal/dockertarget" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/useragent" "github.com/prometheus/common/config" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/docker/docker_test.go b/internal/component/loki/source/docker/docker_test.go index 9e529764cf..7fbfada83d 100644 --- a/internal/component/loki/source/docker/docker_test.go +++ b/internal/component/loki/source/docker/docker_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/component/loki/source/docker/internal/dockertarget/target.go b/internal/component/loki/source/docker/internal/dockertarget/target.go index 7960484113..bea38cddec 100644 --- a/internal/component/loki/source/docker/internal/dockertarget/target.go +++ b/internal/component/loki/source/docker/internal/dockertarget/target.go @@ -18,9 +18,9 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/loki/source/docker/runner.go b/internal/component/loki/source/docker/runner.go index 360df33a18..2afe48adef 100644 --- a/internal/component/loki/source/docker/runner.go +++ b/internal/component/loki/source/docker/runner.go @@ -9,10 +9,10 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" dt "github.com/grafana/alloy/internal/component/loki/source/docker/internal/dockertarget" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/runner" ) diff --git a/internal/component/loki/source/file/decompresser.go b/internal/component/loki/source/file/decompresser.go index 6336a388c3..14fb680427 100644 --- a/internal/component/loki/source/file/decompresser.go +++ b/internal/component/loki/source/file/decompresser.go @@ -19,9 +19,9 @@ import ( "unsafe" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" "go.uber.org/atomic" diff --git a/internal/component/loki/source/file/file.go b/internal/component/loki/source/file/file.go index 7bdb04048c..a21210be9b 100644 --- a/internal/component/loki/source/file/file.go +++ b/internal/component/loki/source/file/file.go @@ -9,12 +9,12 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/tail/watch" "github.com/prometheus/common/model" ) diff --git a/internal/component/loki/source/file/file_test.go b/internal/component/loki/source/file/file_test.go index c1aa90912f..ad7a8c030d 100644 --- a/internal/component/loki/source/file/file_test.go +++ b/internal/component/loki/source/file/file_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/discovery" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/file/tailer.go b/internal/component/loki/source/file/tailer.go index a3d8af4f66..ebab33277a 100644 --- a/internal/component/loki/source/file/tailer.go +++ b/internal/component/loki/source/file/tailer.go @@ -12,9 +12,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/util" "github.com/grafana/tail" diff --git a/internal/component/loki/source/gcplog/gcplog.go b/internal/component/loki/source/gcplog/gcplog.go index 3f25c5c8c0..836549d8cd 100644 --- a/internal/component/loki/source/gcplog/gcplog.go +++ b/internal/component/loki/source/gcplog/gcplog.go @@ -6,8 +6,8 @@ import ( "strings" "sync" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/model/relabel" diff --git a/internal/component/loki/source/gcplog/internal/gcplogtarget/pull_target.go b/internal/component/loki/source/gcplog/internal/gcplogtarget/pull_target.go index 1a9536bb39..5dc4a8a619 100644 --- a/internal/component/loki/source/gcplog/internal/gcplogtarget/pull_target.go +++ b/internal/component/loki/source/gcplog/internal/gcplogtarget/pull_target.go @@ -13,7 +13,7 @@ import ( "cloud.google.com/go/pubsub" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/dskit/backoff" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/relabel" diff --git a/internal/component/loki/source/gcplog/internal/gcplogtarget/push_target.go b/internal/component/loki/source/gcplog/internal/gcplogtarget/push_target.go index c0a013a035..ed446076c5 100644 --- a/internal/component/loki/source/gcplog/internal/gcplogtarget/push_target.go +++ b/internal/component/loki/source/gcplog/internal/gcplogtarget/push_target.go @@ -14,7 +14,7 @@ import ( "github.com/go-kit/log" "github.com/gorilla/mux" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/relabel" diff --git a/internal/component/loki/source/gelf/internal/target/gelftarget.go b/internal/component/loki/source/gelf/internal/target/gelftarget.go index a1dce76315..563eae6db8 100644 --- a/internal/component/loki/source/gelf/internal/target/gelftarget.go +++ b/internal/component/loki/source/gelf/internal/target/gelftarget.go @@ -14,7 +14,7 @@ import ( "github.com/grafana/alloy/internal/component/common/loki" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/go-gelf/v2/gelf" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/loki/source/heroku/heroku.go b/internal/component/loki/source/heroku/heroku.go index ca8015fe06..800f4a9e82 100644 --- a/internal/component/loki/source/heroku/heroku.go +++ b/internal/component/loki/source/heroku/heroku.go @@ -5,13 +5,13 @@ import ( "reflect" "sync" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" fnet "github.com/grafana/alloy/internal/component/common/net" flow_relabel "github.com/grafana/alloy/internal/component/common/relabel" ht "github.com/grafana/alloy/internal/component/loki/source/heroku/internal/herokutarget" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/heroku/internal/herokutarget/herokutarget.go b/internal/component/loki/source/heroku/internal/herokutarget/herokutarget.go index 93725f938f..053dc3c79b 100644 --- a/internal/component/loki/source/heroku/internal/herokutarget/herokutarget.go +++ b/internal/component/loki/source/heroku/internal/herokutarget/herokutarget.go @@ -12,9 +12,9 @@ import ( "github.com/go-kit/log" "github.com/gorilla/mux" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" fnet "github.com/grafana/alloy/internal/component/common/net" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/loki/pkg/logproto" herokuEncoding "github.com/heroku/x/logplex/encoding" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/component/loki/source/internal/kafkatarget/consumer.go b/internal/component/loki/source/internal/kafkatarget/consumer.go index 74fe76bb2a..0eb514f209 100644 --- a/internal/component/loki/source/internal/kafkatarget/consumer.go +++ b/internal/component/loki/source/internal/kafkatarget/consumer.go @@ -12,7 +12,7 @@ import ( "github.com/IBM/sarama" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/dskit/backoff" "github.com/grafana/loki/clients/pkg/promtail/targets/target" diff --git a/internal/component/loki/source/internal/kafkatarget/kafkatarget.go b/internal/component/loki/source/internal/kafkatarget/kafkatarget.go index 3bf5662db8..ad3d4b1eb1 100644 --- a/internal/component/loki/source/internal/kafkatarget/kafkatarget.go +++ b/internal/component/loki/source/internal/kafkatarget/kafkatarget.go @@ -10,8 +10,8 @@ import ( "github.com/IBM/sarama" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/loki/clients/pkg/promtail/targets/target" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/loki/source/internal/kafkatarget/target_syncer.go b/internal/component/loki/source/internal/kafkatarget/target_syncer.go index 9514d39138..e17325cd2e 100644 --- a/internal/component/loki/source/internal/kafkatarget/target_syncer.go +++ b/internal/component/loki/source/internal/kafkatarget/target_syncer.go @@ -13,7 +13,7 @@ import ( "github.com/IBM/sarama" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" promconfig "github.com/prometheus/common/config" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/loki/source/journal/internal/target/journaltarget.go b/internal/component/loki/source/journal/internal/target/journaltarget.go index b7dbeea4dc..92b70b3fc4 100644 --- a/internal/component/loki/source/journal/internal/target/journaltarget.go +++ b/internal/component/loki/source/journal/internal/target/journaltarget.go @@ -18,7 +18,7 @@ import ( "github.com/coreos/go-systemd/sdjournal" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/journal/journal_stub.go b/internal/component/loki/source/journal/journal_stub.go index 10cc145181..246458a431 100644 --- a/internal/component/loki/source/journal/journal_stub.go +++ b/internal/component/loki/source/journal/journal_stub.go @@ -5,9 +5,9 @@ package journal import ( "context" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/component/loki/source/kafka/kafka.go b/internal/component/loki/source/kafka/kafka.go index d44c8369df..9167b24137 100644 --- a/internal/component/loki/source/kafka/kafka.go +++ b/internal/component/loki/source/kafka/kafka.go @@ -5,13 +5,13 @@ import ( "sync" "github.com/IBM/sarama" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/config" "github.com/grafana/alloy/internal/component/common/loki" flow_relabel "github.com/grafana/alloy/internal/component/common/relabel" kt "github.com/grafana/alloy/internal/component/loki/source/internal/kafkatarget" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/syntax/alloytypes" "github.com/grafana/dskit/flagext" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/kubernetes/kubernetes.go b/internal/component/loki/source/kubernetes/kubernetes.go index b32942417c..9d95ae4566 100644 --- a/internal/component/loki/source/kubernetes/kubernetes.go +++ b/internal/component/loki/source/kubernetes/kubernetes.go @@ -11,6 +11,7 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" commonk8s "github.com/grafana/alloy/internal/component/common/kubernetes" "github.com/grafana/alloy/internal/component/common/loki" @@ -18,7 +19,6 @@ import ( "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/component/loki/source/kubernetes/kubetail" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/cluster" "k8s.io/client-go/kubernetes" ) diff --git a/internal/component/loki/source/kubernetes/kubetail/kubetail.go b/internal/component/loki/source/kubernetes/kubetail/kubetail.go index c40d44978b..5df3651d46 100644 --- a/internal/component/loki/source/kubernetes/kubetail/kubetail.go +++ b/internal/component/loki/source/kubernetes/kubetail/kubetail.go @@ -6,9 +6,9 @@ import ( "sync" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/runner" "k8s.io/client-go/kubernetes" ) diff --git a/internal/component/loki/source/kubernetes/kubetail/tailer.go b/internal/component/loki/source/kubernetes/kubetail/tailer.go index 477879c7c4..01fcc24fcf 100644 --- a/internal/component/loki/source/kubernetes/kubetail/tailer.go +++ b/internal/component/loki/source/kubernetes/kubetail/tailer.go @@ -10,8 +10,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/runner" "github.com/grafana/dskit/backoff" "github.com/grafana/loki/pkg/logproto" diff --git a/internal/component/loki/source/kubernetes_events/event_controller.go b/internal/component/loki/source/kubernetes_events/event_controller.go index 686fa0ad8e..623a1f783d 100644 --- a/internal/component/loki/source/kubernetes_events/event_controller.go +++ b/internal/component/loki/source/kubernetes_events/event_controller.go @@ -10,9 +10,9 @@ import ( "github.com/cespare/xxhash/v2" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/runner" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/kubernetes_events/kubernetes_events.go b/internal/component/loki/source/kubernetes_events/kubernetes_events.go index 40e4878289..bb2116b998 100644 --- a/internal/component/loki/source/kubernetes_events/kubernetes_events.go +++ b/internal/component/loki/source/kubernetes_events/kubernetes_events.go @@ -12,12 +12,12 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/kubernetes" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/positions" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/runner" "github.com/oklog/run" "k8s.io/client-go/rest" diff --git a/internal/component/loki/source/podlogs/controller.go b/internal/component/loki/source/podlogs/controller.go index 0abdeea595..b126673852 100644 --- a/internal/component/loki/source/podlogs/controller.go +++ b/internal/component/loki/source/podlogs/controller.go @@ -8,8 +8,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" monitoringv1alpha2 "github.com/grafana/alloy/internal/component/loki/source/podlogs/internal/apis/monitoring/v1alpha2" - "github.com/grafana/alloy/internal/flow/logging/level" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" diff --git a/internal/component/loki/source/podlogs/podlogs.go b/internal/component/loki/source/podlogs/podlogs.go index 4ec3bffba0..9d5618942b 100644 --- a/internal/component/loki/source/podlogs/podlogs.go +++ b/internal/component/loki/source/podlogs/podlogs.go @@ -10,6 +10,7 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/config" commonk8s "github.com/grafana/alloy/internal/component/common/kubernetes" @@ -18,7 +19,6 @@ import ( "github.com/grafana/alloy/internal/component/loki/source/kubernetes" "github.com/grafana/alloy/internal/component/loki/source/kubernetes/kubetail" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/cluster" "github.com/oklog/run" kubeclient "k8s.io/client-go/kubernetes" diff --git a/internal/component/loki/source/podlogs/reconciler.go b/internal/component/loki/source/podlogs/reconciler.go index 068dcdce06..66219d4cc1 100644 --- a/internal/component/loki/source/podlogs/reconciler.go +++ b/internal/component/loki/source/podlogs/reconciler.go @@ -9,9 +9,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/loki/source/kubernetes/kubetail" monitoringv1alpha2 "github.com/grafana/alloy/internal/component/loki/source/podlogs/internal/apis/monitoring/v1alpha2" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/cluster" "github.com/grafana/ckit/shard" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/syslog/internal/syslogtarget/syslogtarget.go b/internal/component/loki/source/syslog/internal/syslogtarget/syslogtarget.go index d48512b31d..cec1eda45a 100644 --- a/internal/component/loki/source/syslog/internal/syslogtarget/syslogtarget.go +++ b/internal/component/loki/source/syslog/internal/syslogtarget/syslogtarget.go @@ -12,7 +12,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/influxdata/go-syslog/v3" "github.com/influxdata/go-syslog/v3/rfc5424" "github.com/prometheus/common/model" diff --git a/internal/component/loki/source/syslog/internal/syslogtarget/transport.go b/internal/component/loki/source/syslog/internal/syslogtarget/transport.go index 6539b4594b..90218193d5 100644 --- a/internal/component/loki/source/syslog/internal/syslogtarget/transport.go +++ b/internal/component/loki/source/syslog/internal/syslogtarget/transport.go @@ -21,7 +21,7 @@ import ( "github.com/mwitkow/go-conntrack" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/influxdata/go-syslog/v3" "github.com/prometheus/common/config" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/loki/source/syslog/syslog.go b/internal/component/loki/source/syslog/syslog.go index 03a0150291..5c4643df3d 100644 --- a/internal/component/loki/source/syslog/syslog.go +++ b/internal/component/loki/source/syslog/syslog.go @@ -5,12 +5,12 @@ import ( "reflect" "sync" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" flow_relabel "github.com/grafana/alloy/internal/component/common/relabel" st "github.com/grafana/alloy/internal/component/loki/source/syslog/internal/syslogtarget" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/prometheus/prometheus/model/relabel" ) diff --git a/internal/component/loki/source/windowsevent/component_stub.go b/internal/component/loki/source/windowsevent/component_stub.go index 6081c08e78..c465e8df0a 100644 --- a/internal/component/loki/source/windowsevent/component_stub.go +++ b/internal/component/loki/source/windowsevent/component_stub.go @@ -5,9 +5,9 @@ package windowsevent import ( "context" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/component/loki/write/write_test.go b/internal/component/loki/write/write_test.go index 63bdfb64b8..cb5c4b33b6 100644 --- a/internal/component/loki/write/write_test.go +++ b/internal/component/loki/write/write_test.go @@ -10,11 +10,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/common/loki/wal" "github.com/grafana/alloy/internal/component/discovery" lsf "github.com/grafana/alloy/internal/component/loki/source/file" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/prometheus/common/model" diff --git a/internal/component/mimir/rules/kubernetes/events.go b/internal/component/mimir/rules/kubernetes/events.go index 94f2155e56..01ca34fafd 100644 --- a/internal/component/mimir/rules/kubernetes/events.go +++ b/internal/component/mimir/rules/kubernetes/events.go @@ -6,8 +6,8 @@ import ( "regexp" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/kubernetes" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/hashicorp/go-multierror" promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/prometheus/prometheus/model/rulefmt" diff --git a/internal/component/mimir/rules/kubernetes/rules.go b/internal/component/mimir/rules/kubernetes/rules.go index 1f3106cc9a..ed08b2da5a 100644 --- a/internal/component/mimir/rules/kubernetes/rules.go +++ b/internal/component/mimir/rules/kubernetes/rules.go @@ -7,10 +7,10 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" commonK8s "github.com/grafana/alloy/internal/component/common/kubernetes" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" mimirClient "github.com/grafana/alloy/internal/mimir/client" "github.com/grafana/dskit/backoff" "github.com/grafana/dskit/instrument" diff --git a/internal/component/otelcol/auth/auth_test.go b/internal/component/otelcol/auth/auth_test.go index 70bd555564..23a4ec1b01 100644 --- a/internal/component/otelcol/auth/auth_test.go +++ b/internal/component/otelcol/auth/auth_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/auth" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" diff --git a/internal/component/otelcol/auth/basic/basic_test.go b/internal/component/otelcol/auth/basic/basic_test.go index ee2804aa83..319f8f4385 100644 --- a/internal/component/otelcol/auth/basic/basic_test.go +++ b/internal/component/otelcol/auth/basic/basic_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/auth" "github.com/grafana/alloy/internal/component/otelcol/auth/basic" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/stretchr/testify/assert" diff --git a/internal/component/otelcol/auth/bearer/bearer_test.go b/internal/component/otelcol/auth/bearer/bearer_test.go index bdbec3674d..0854109aa0 100644 --- a/internal/component/otelcol/auth/bearer/bearer_test.go +++ b/internal/component/otelcol/auth/bearer/bearer_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/auth" "github.com/grafana/alloy/internal/component/otelcol/auth/bearer" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/stretchr/testify/assert" diff --git a/internal/component/otelcol/auth/headers/headers_test.go b/internal/component/otelcol/auth/headers/headers_test.go index 68a5a29db6..86ec8a6a19 100644 --- a/internal/component/otelcol/auth/headers/headers_test.go +++ b/internal/component/otelcol/auth/headers/headers_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/auth" "github.com/grafana/alloy/internal/component/otelcol/auth/headers" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension" diff --git a/internal/component/otelcol/auth/oauth2/oauth2_test.go b/internal/component/otelcol/auth/oauth2/oauth2_test.go index 8a0367ddef..95abab69b9 100644 --- a/internal/component/otelcol/auth/oauth2/oauth2_test.go +++ b/internal/component/otelcol/auth/oauth2/oauth2_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/auth" "github.com/grafana/alloy/internal/component/otelcol/auth/oauth2" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/stretchr/testify/require" diff --git a/internal/component/otelcol/auth/sigv4/sigv4_test.go b/internal/component/otelcol/auth/sigv4/sigv4_test.go index 05bf871867..32110de00d 100644 --- a/internal/component/otelcol/auth/sigv4/sigv4_test.go +++ b/internal/component/otelcol/auth/sigv4/sigv4_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/auth" "github.com/grafana/alloy/internal/component/otelcol/auth/sigv4" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/stretchr/testify/assert" diff --git a/internal/component/otelcol/connector/spanlogs/spanlogs.go b/internal/component/otelcol/connector/spanlogs/spanlogs.go index 10249d1bea..f7f3e790ce 100644 --- a/internal/component/otelcol/connector/spanlogs/spanlogs.go +++ b/internal/component/otelcol/connector/spanlogs/spanlogs.go @@ -5,12 +5,12 @@ import ( "context" "fmt" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fanoutconsumer" "github.com/grafana/alloy/internal/component/otelcol/internal/lazyconsumer" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/syntax" ) diff --git a/internal/component/otelcol/connector/spanlogs/spanlogs_test.go b/internal/component/otelcol/connector/spanlogs/spanlogs_test.go index 91fa3d5ee4..f2fc444e33 100644 --- a/internal/component/otelcol/connector/spanlogs/spanlogs_test.go +++ b/internal/component/otelcol/connector/spanlogs/spanlogs_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/connector/spanlogs" "github.com/grafana/alloy/internal/component/otelcol/processor/processortest" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/stretchr/testify/require" diff --git a/internal/component/otelcol/connector/spanmetrics/spanmetrics_test.go b/internal/component/otelcol/connector/spanmetrics/spanmetrics_test.go index 453bd91652..fb7025e9ff 100644 --- a/internal/component/otelcol/connector/spanmetrics/spanmetrics_test.go +++ b/internal/component/otelcol/connector/spanmetrics/spanmetrics_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/connector/spanmetrics" "github.com/grafana/alloy/internal/component/otelcol/processor/processortest" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector" diff --git a/internal/component/otelcol/exporter/exporter_test.go b/internal/component/otelcol/exporter/exporter_test.go index 5498858044..01c0657b33 100644 --- a/internal/component/otelcol/exporter/exporter_test.go +++ b/internal/component/otelcol/exporter/exporter_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/exporter" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" diff --git a/internal/component/otelcol/exporter/loki/internal/convert/convert.go b/internal/component/otelcol/exporter/loki/internal/convert/convert.go index 69ffff6edb..88b9428923 100644 --- a/internal/component/otelcol/exporter/loki/internal/convert/convert.go +++ b/internal/component/otelcol/exporter/loki/internal/convert/convert.go @@ -13,8 +13,8 @@ import ( "sync" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" - "github.com/grafana/alloy/internal/flow/logging/level" loki_translator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki" "github.com/prometheus/client_golang/prometheus" "go.opentelemetry.io/collector/consumer" diff --git a/internal/component/otelcol/exporter/otlp/otlp_test.go b/internal/component/otelcol/exporter/otlp/otlp_test.go index 23ed07ad29..7ef7ae88b8 100644 --- a/internal/component/otelcol/exporter/otlp/otlp_test.go +++ b/internal/component/otelcol/exporter/otlp/otlp_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/exporter/otlp" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/dskit/backoff" diff --git a/internal/component/otelcol/exporter/otlphttp/otlphttp_test.go b/internal/component/otelcol/exporter/otlphttp/otlphttp_test.go index 2277e0631f..1396842ed0 100644 --- a/internal/component/otelcol/exporter/otlphttp/otlphttp_test.go +++ b/internal/component/otelcol/exporter/otlphttp/otlphttp_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/exporter/otlphttp" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/dskit/backoff" diff --git a/internal/component/otelcol/exporter/prometheus/internal/convert/convert.go b/internal/component/otelcol/exporter/prometheus/internal/convert/convert.go index dc3a218f38..5655c23992 100644 --- a/internal/component/otelcol/exporter/prometheus/internal/convert/convert.go +++ b/internal/component/otelcol/exporter/prometheus/internal/convert/convert.go @@ -18,7 +18,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/exemplar" diff --git a/internal/component/otelcol/extension/extension_test.go b/internal/component/otelcol/extension/extension_test.go index ed5d6875c1..34e8855220 100644 --- a/internal/component/otelcol/extension/extension_test.go +++ b/internal/component/otelcol/extension/extension_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/extension" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" diff --git a/internal/component/otelcol/extension/jaeger_remote_sampling/jaeger_remote_sampling_test.go b/internal/component/otelcol/extension/jaeger_remote_sampling/jaeger_remote_sampling_test.go index 2446466af4..a0c633183a 100644 --- a/internal/component/otelcol/extension/jaeger_remote_sampling/jaeger_remote_sampling_test.go +++ b/internal/component/otelcol/extension/jaeger_remote_sampling/jaeger_remote_sampling_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/extension/jaeger_remote_sampling" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/phayes/freeport" diff --git a/internal/component/otelcol/internal/scheduler/host.go b/internal/component/otelcol/internal/scheduler/host.go index aec74c35e9..bac33cccce 100644 --- a/internal/component/otelcol/internal/scheduler/host.go +++ b/internal/component/otelcol/internal/scheduler/host.go @@ -2,7 +2,7 @@ package scheduler import ( "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" otelcomponent "go.opentelemetry.io/collector/component" otelextension "go.opentelemetry.io/collector/extension" diff --git a/internal/component/otelcol/internal/scheduler/scheduler.go b/internal/component/otelcol/internal/scheduler/scheduler.go index 5e345ff58b..f2c891a17a 100644 --- a/internal/component/otelcol/internal/scheduler/scheduler.go +++ b/internal/component/otelcol/internal/scheduler/scheduler.go @@ -9,8 +9,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/logging/level" otelcomponent "go.opentelemetry.io/collector/component" "go.uber.org/multierr" ) diff --git a/internal/component/otelcol/internal/scheduler/scheduler_test.go b/internal/component/otelcol/internal/scheduler/scheduler_test.go index 28f20edccd..0c07e71f24 100644 --- a/internal/component/otelcol/internal/scheduler/scheduler_test.go +++ b/internal/component/otelcol/internal/scheduler/scheduler_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/internal/scheduler" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" diff --git a/internal/component/otelcol/processor/attributes/attributes_test.go b/internal/component/otelcol/processor/attributes/attributes_test.go index 4c29fd5ec4..31f1625cce 100644 --- a/internal/component/otelcol/processor/attributes/attributes_test.go +++ b/internal/component/otelcol/processor/attributes/attributes_test.go @@ -6,10 +6,10 @@ import ( "net" "testing" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/processor/attributes" "github.com/grafana/alloy/internal/component/otelcol/processor/processortest" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/mitchellh/mapstructure" diff --git a/internal/component/otelcol/processor/batch/batch_test.go b/internal/component/otelcol/processor/batch/batch_test.go index 2fd6b3ffd6..78b9e13f0a 100644 --- a/internal/component/otelcol/processor/batch/batch_test.go +++ b/internal/component/otelcol/processor/batch/batch_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" "github.com/grafana/alloy/internal/component/otelcol/processor/batch" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/dskit/backoff" diff --git a/internal/component/otelcol/processor/discovery/discovery.go b/internal/component/otelcol/processor/discovery/discovery.go index 6001f488e6..0dcbc3ed49 100644 --- a/internal/component/otelcol/processor/discovery/discovery.go +++ b/internal/component/otelcol/processor/discovery/discovery.go @@ -6,13 +6,13 @@ import ( "fmt" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fanoutconsumer" "github.com/grafana/alloy/internal/component/otelcol/internal/lazyconsumer" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" promsdconsumer "github.com/grafana/alloy/internal/static/traces/promsdprocessor/consumer" "github.com/grafana/alloy/syntax" ) diff --git a/internal/component/otelcol/processor/discovery/discovery_test.go b/internal/component/otelcol/processor/discovery/discovery_test.go index 1b5d935372..001050650a 100644 --- a/internal/component/otelcol/processor/discovery/discovery_test.go +++ b/internal/component/otelcol/processor/discovery/discovery_test.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/processor/discovery" "github.com/grafana/alloy/internal/component/otelcol/processor/processortest" - "github.com/grafana/alloy/internal/flow/componenttest" promsdconsumer "github.com/grafana/alloy/internal/static/traces/promsdprocessor/consumer" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" diff --git a/internal/component/otelcol/processor/memorylimiter/memorylimiter_test.go b/internal/component/otelcol/processor/memorylimiter/memorylimiter_test.go index 96e676d7b2..bb0122e5ca 100644 --- a/internal/component/otelcol/processor/memorylimiter/memorylimiter_test.go +++ b/internal/component/otelcol/processor/memorylimiter/memorylimiter_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" "github.com/grafana/alloy/internal/component/otelcol/processor/memorylimiter" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/dskit/backoff" diff --git a/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler_test.go b/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler_test.go index 46f907de02..b6a7497ebc 100644 --- a/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler_test.go +++ b/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" + "github.com/grafana/alloy/internal/alloy/componenttest" probabilisticsampler "github.com/grafana/alloy/internal/component/otelcol/processor/probabilistic_sampler" "github.com/grafana/alloy/internal/component/otelcol/processor/processortest" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor" diff --git a/internal/component/otelcol/processor/processor_test.go b/internal/component/otelcol/processor/processor_test.go index 9c3d8bf649..e6aee3974f 100644 --- a/internal/component/otelcol/processor/processor_test.go +++ b/internal/component/otelcol/processor/processor_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" "github.com/grafana/alloy/internal/component/otelcol/processor" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" diff --git a/internal/component/otelcol/processor/processortest/processortest.go b/internal/component/otelcol/processor/processortest/processortest.go index 2eda5e2909..573c915b50 100644 --- a/internal/component/otelcol/processor/processortest/processortest.go +++ b/internal/component/otelcol/processor/processortest/processortest.go @@ -6,11 +6,11 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/dskit/backoff" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/plog" diff --git a/internal/component/otelcol/processor/span/span_test.go b/internal/component/otelcol/processor/span/span_test.go index 11c1d25edf..aec4b2d240 100644 --- a/internal/component/otelcol/processor/span/span_test.go +++ b/internal/component/otelcol/processor/span/span_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol/processor/processortest" "github.com/grafana/alloy/internal/component/otelcol/processor/span" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/mitchellh/mapstructure" diff --git a/internal/component/otelcol/processor/tail_sampling/tail_sampling_test.go b/internal/component/otelcol/processor/tail_sampling/tail_sampling_test.go index 668f7adb7c..5c8b66ad48 100644 --- a/internal/component/otelcol/processor/tail_sampling/tail_sampling_test.go +++ b/internal/component/otelcol/processor/tail_sampling/tail_sampling_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/dskit/backoff" diff --git a/internal/component/otelcol/receiver/jaeger/jaeger_test.go b/internal/component/otelcol/receiver/jaeger/jaeger_test.go index 85d8164f28..8e6f2ccf43 100644 --- a/internal/component/otelcol/receiver/jaeger/jaeger_test.go +++ b/internal/component/otelcol/receiver/jaeger/jaeger_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/receiver/jaeger" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/phayes/freeport" diff --git a/internal/component/otelcol/receiver/loki/loki.go b/internal/component/otelcol/receiver/loki/loki.go index 5f2042d1cb..42549b8fa3 100644 --- a/internal/component/otelcol/receiver/loki/loki.go +++ b/internal/component/otelcol/receiver/loki/loki.go @@ -8,12 +8,12 @@ import ( "sync" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fanoutconsumer" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" loki_translator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/plog" diff --git a/internal/component/otelcol/receiver/loki/loki_test.go b/internal/component/otelcol/receiver/loki/loki_test.go index 54969000c1..b46c116a42 100644 --- a/internal/component/otelcol/receiver/loki/loki_test.go +++ b/internal/component/otelcol/receiver/loki/loki_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" lokiapi "github.com/grafana/alloy/internal/component/common/loki" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/loki/pkg/logproto" diff --git a/internal/component/otelcol/receiver/opencensus/opencensus_test.go b/internal/component/otelcol/receiver/opencensus/opencensus_test.go index b49e472bc1..57a13bd37c 100644 --- a/internal/component/otelcol/receiver/opencensus/opencensus_test.go +++ b/internal/component/otelcol/receiver/opencensus/opencensus_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/receiver/opencensus" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver" diff --git a/internal/component/otelcol/receiver/otlp/otlp_test.go b/internal/component/otelcol/receiver/otlp/otlp_test.go index 64e2ea601f..550482ac35 100644 --- a/internal/component/otelcol/receiver/otlp/otlp_test.go +++ b/internal/component/otelcol/receiver/otlp/otlp_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" "github.com/grafana/alloy/internal/component/otelcol/receiver/otlp" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/dskit/backoff" diff --git a/internal/component/otelcol/receiver/prometheus/prometheus_test.go b/internal/component/otelcol/receiver/prometheus/prometheus_test.go index fd2c32e3dc..a7a5acc98e 100644 --- a/internal/component/otelcol/receiver/prometheus/prometheus_test.go +++ b/internal/component/otelcol/receiver/prometheus/prometheus_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" "github.com/grafana/alloy/internal/component/otelcol/receiver/prometheus" flowprometheus "github.com/grafana/alloy/internal/component/prometheus" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/prometheus/common/model" diff --git a/internal/component/otelcol/receiver/receiver_test.go b/internal/component/otelcol/receiver/receiver_test.go index 5c8ff582ad..beb21dcf59 100644 --- a/internal/component/otelcol/receiver/receiver_test.go +++ b/internal/component/otelcol/receiver/receiver_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/internal/fakeconsumer" "github.com/grafana/alloy/internal/component/otelcol/receiver" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" diff --git a/internal/component/otelcol/receiver/zipkin/zipkin_test.go b/internal/component/otelcol/receiver/zipkin/zipkin_test.go index a83237dff3..a5a7e39b57 100644 --- a/internal/component/otelcol/receiver/zipkin/zipkin_test.go +++ b/internal/component/otelcol/receiver/zipkin/zipkin_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/otelcol" "github.com/grafana/alloy/internal/component/otelcol/receiver/zipkin" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver" diff --git a/internal/component/prometheus/exporter/exporter.go b/internal/component/prometheus/exporter/exporter.go index 67f21fd89f..c198c5973f 100644 --- a/internal/component/prometheus/exporter/exporter.go +++ b/internal/component/prometheus/exporter/exporter.go @@ -9,9 +9,9 @@ import ( "strings" "sync" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/discovery" - "github.com/grafana/alloy/internal/flow/logging/level" http_service "github.com/grafana/alloy/internal/service/http" "github.com/grafana/alloy/internal/static/integrations" "github.com/prometheus/common/model" diff --git a/internal/component/prometheus/operator/common/component.go b/internal/component/prometheus/operator/common/component.go index 006f014259..addfd19a2b 100644 --- a/internal/component/prometheus/operator/common/component.go +++ b/internal/component/prometheus/operator/common/component.go @@ -8,9 +8,9 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/prometheus/operator" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/cluster" "github.com/grafana/alloy/internal/service/labelstore" "gopkg.in/yaml.v3" diff --git a/internal/component/prometheus/operator/common/crdmanager.go b/internal/component/prometheus/operator/common/crdmanager.go index 51414fc75b..9a08192f39 100644 --- a/internal/component/prometheus/operator/common/crdmanager.go +++ b/internal/component/prometheus/operator/common/crdmanager.go @@ -10,9 +10,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/prometheus" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/cluster" "github.com/grafana/alloy/internal/service/http" "github.com/grafana/alloy/internal/service/labelstore" diff --git a/internal/component/prometheus/receive_http/receive_http.go b/internal/component/prometheus/receive_http/receive_http.go index c6c511fff8..c718147c39 100644 --- a/internal/component/prometheus/receive_http/receive_http.go +++ b/internal/component/prometheus/receive_http/receive_http.go @@ -8,11 +8,11 @@ import ( "sync" "github.com/gorilla/mux" + "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" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/labelstore" "github.com/grafana/alloy/internal/util" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/component/prometheus/relabel/relabel_test.go b/internal/component/prometheus/relabel/relabel_test.go index 69692050ad..ff7fded923 100644 --- a/internal/component/prometheus/relabel/relabel_test.go +++ b/internal/component/prometheus/relabel/relabel_test.go @@ -8,10 +8,10 @@ import ( "context" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" flow_relabel "github.com/grafana/alloy/internal/component/common/relabel" "github.com/grafana/alloy/internal/component/prometheus" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/service/labelstore" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" diff --git a/internal/component/prometheus/remotewrite/remote_write.go b/internal/component/prometheus/remotewrite/remote_write.go index 747311a64f..0bc327d4ad 100644 --- a/internal/component/prometheus/remotewrite/remote_write.go +++ b/internal/component/prometheus/remotewrite/remote_write.go @@ -10,11 +10,11 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/alloyseed" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/prometheus" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/labelstore" "github.com/grafana/alloy/internal/static/metrics/wal" "github.com/grafana/alloy/internal/useragent" diff --git a/internal/component/prometheus/remotewrite/remote_write_test.go b/internal/component/prometheus/remotewrite/remote_write_test.go index 654cb06a83..b7fc1b331f 100644 --- a/internal/component/prometheus/remotewrite/remote_write_test.go +++ b/internal/component/prometheus/remotewrite/remote_write_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component/prometheus/remotewrite" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/prometheus/scrape/scrape.go b/internal/component/prometheus/scrape/scrape.go index fe3a8b46c9..d496a881c0 100644 --- a/internal/component/prometheus/scrape/scrape.go +++ b/internal/component/prometheus/scrape/scrape.go @@ -8,12 +8,12 @@ import ( "time" "github.com/alecthomas/units" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" component_config "github.com/grafana/alloy/internal/component/common/config" "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/component/prometheus" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/cluster" "github.com/grafana/alloy/internal/service/http" "github.com/grafana/alloy/internal/service/labelstore" diff --git a/internal/component/pyroscope/ebpf/ebpf_linux.go b/internal/component/pyroscope/ebpf/ebpf_linux.go index bc5c16f56d..bb7b6d890a 100644 --- a/internal/component/pyroscope/ebpf/ebpf_linux.go +++ b/internal/component/pyroscope/ebpf/ebpf_linux.go @@ -10,10 +10,10 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/pyroscope" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ebpfspy "github.com/grafana/pyroscope/ebpf" demangle2 "github.com/grafana/pyroscope/ebpf/cpp/demangle" "github.com/grafana/pyroscope/ebpf/pprof" diff --git a/internal/component/pyroscope/ebpf/ebpf_placeholder.go b/internal/component/pyroscope/ebpf/ebpf_placeholder.go index b7da8f531a..20b937d8bd 100644 --- a/internal/component/pyroscope/ebpf/ebpf_placeholder.go +++ b/internal/component/pyroscope/ebpf/ebpf_placeholder.go @@ -5,9 +5,9 @@ package ebpf import ( "context" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/component/pyroscope/java/java.go b/internal/component/pyroscope/java/java.go index 27e489780f..0cededb495 100644 --- a/internal/component/pyroscope/java/java.go +++ b/internal/component/pyroscope/java/java.go @@ -9,11 +9,11 @@ import ( "strconv" "sync" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/component/pyroscope" "github.com/grafana/alloy/internal/component/pyroscope/java/asprof" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) const ( diff --git a/internal/component/pyroscope/java/java_stub.go b/internal/component/pyroscope/java/java_stub.go index 6548e77715..22efb6319e 100644 --- a/internal/component/pyroscope/java/java_stub.go +++ b/internal/component/pyroscope/java/java_stub.go @@ -5,9 +5,9 @@ package java import ( "context" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" ) func init() { diff --git a/internal/component/pyroscope/java/loop.go b/internal/component/pyroscope/java/loop.go index 3fd7f1c271..fe741fed2f 100644 --- a/internal/component/pyroscope/java/loop.go +++ b/internal/component/pyroscope/java/loop.go @@ -13,10 +13,10 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/discovery" "github.com/grafana/alloy/internal/component/pyroscope" "github.com/grafana/alloy/internal/component/pyroscope/java/asprof" - "github.com/grafana/alloy/internal/flow/logging/level" jfrpprof "github.com/grafana/jfr-parser/pprof" jfrpprofPyroscope "github.com/grafana/jfr-parser/pprof/pyroscope" "github.com/prometheus/prometheus/model/labels" diff --git a/internal/component/pyroscope/scrape/manager.go b/internal/component/pyroscope/scrape/manager.go index d9f67b8c06..7701f1f3f7 100644 --- a/internal/component/pyroscope/scrape/manager.go +++ b/internal/component/pyroscope/scrape/manager.go @@ -6,8 +6,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/pyroscope" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/prometheus/prometheus/discovery/targetgroup" ) diff --git a/internal/component/pyroscope/scrape/scrape.go b/internal/component/pyroscope/scrape/scrape.go index 7c5f00662a..a86bfa5689 100644 --- a/internal/component/pyroscope/scrape/scrape.go +++ b/internal/component/pyroscope/scrape/scrape.go @@ -7,9 +7,9 @@ import ( "sync" "time" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/pyroscope" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service/cluster" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/discovery/targetgroup" diff --git a/internal/component/pyroscope/scrape/scrape_loop.go b/internal/component/pyroscope/scrape/scrape_loop.go index 34d94a7b30..d7ed036a5c 100644 --- a/internal/component/pyroscope/scrape/scrape_loop.go +++ b/internal/component/pyroscope/scrape/scrape_loop.go @@ -11,8 +11,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/pyroscope" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/useragent" commonconfig "github.com/prometheus/common/config" "github.com/prometheus/prometheus/discovery/targetgroup" diff --git a/internal/component/pyroscope/write/write.go b/internal/component/pyroscope/write/write.go index 067687aae9..544fa6b1e4 100644 --- a/internal/component/pyroscope/write/write.go +++ b/internal/component/pyroscope/write/write.go @@ -7,10 +7,10 @@ import ( "time" "connectrpc.com/connect" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/alloyseed" "github.com/grafana/alloy/internal/component/pyroscope" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/useragent" "github.com/oklog/run" commonconfig "github.com/prometheus/common/config" diff --git a/internal/component/remote/http/http.go b/internal/component/remote/http/http.go index 8e22254dad..d611f8e494 100644 --- a/internal/component/remote/http/http.go +++ b/internal/component/remote/http/http.go @@ -11,10 +11,10 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" common_config "github.com/grafana/alloy/internal/component/common/config" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/useragent" "github.com/grafana/alloy/syntax/alloytypes" prom_config "github.com/prometheus/common/config" diff --git a/internal/component/remote/http/http_test.go b/internal/component/remote/http/http_test.go index dcb0529582..672afabbe3 100644 --- a/internal/component/remote/http/http_test.go +++ b/internal/component/remote/http/http_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging/level" http_component "github.com/grafana/alloy/internal/component/remote/http" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/alloy/syntax/alloytypes" diff --git a/internal/component/remote/vault/refresher.go b/internal/component/remote/vault/refresher.go index 70338304a9..49191b3da9 100644 --- a/internal/component/remote/vault/refresher.go +++ b/internal/component/remote/vault/refresher.go @@ -7,8 +7,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow/logging/level" vault "github.com/hashicorp/vault/api" "github.com/prometheus/client_golang/prometheus" ) diff --git a/internal/component/remote/vault/vault.go b/internal/component/remote/vault/vault.go index 0438d3d491..166335c7d0 100644 --- a/internal/component/remote/vault/vault.go +++ b/internal/component/remote/vault/vault.go @@ -7,9 +7,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/syntax/alloytypes" "github.com/oklog/run" diff --git a/internal/component/remote/vault/vault_test.go b/internal/component/remote/vault/vault_test.go index 4920c13dd4..64ad917aab 100644 --- a/internal/component/remote/vault/vault_test.go +++ b/internal/component/remote/vault/vault_test.go @@ -12,7 +12,7 @@ import ( "github.com/docker/go-connections/nat" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/componenttest" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" "github.com/grafana/alloy/syntax/alloytypes" diff --git a/internal/converter/internal/staticconvert/internal/build/builder_logging.go b/internal/converter/internal/staticconvert/internal/build/builder_logging.go index 6862146cc0..7dec8a2bee 100644 --- a/internal/converter/internal/staticconvert/internal/build/builder_logging.go +++ b/internal/converter/internal/staticconvert/internal/build/builder_logging.go @@ -3,8 +3,8 @@ package build import ( "reflect" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/converter/internal/common" - "github.com/grafana/alloy/internal/flow/logging" "github.com/grafana/alloy/internal/static/server" ) diff --git a/internal/converter/internal/test_common/testing.go b/internal/converter/internal/test_common/testing.go index f81130d729..c77e9edae1 100644 --- a/internal/converter/internal/test_common/testing.go +++ b/internal/converter/internal/test_common/testing.go @@ -12,10 +12,10 @@ import ( "strings" "testing" + "github.com/grafana/alloy/internal/alloy" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/converter/diag" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow" - "github.com/grafana/alloy/internal/flow/logging" "github.com/grafana/alloy/internal/service" cluster_service "github.com/grafana/alloy/internal/service/cluster" http_service "github.com/grafana/alloy/internal/service/http" @@ -173,7 +173,7 @@ func validateRiver(t *testing.T, expectedRiver []byte, actualRiver []byte, loadF // attemptLoadingFlowConfig will attempt to load the Flow config and report any errors. func attemptLoadingFlowConfig(t *testing.T, river []byte) { - cfg, err := flow.ParseSource(t.Name(), river) + cfg, err := alloy.ParseSource(t.Name(), river) require.NoError(t, err, "the output River config failed to parse: %s", string(normalizeLineEndings(river))) // The below check suffers from test race conditions on Windows. Our goal here is to verify config conversions, @@ -193,7 +193,7 @@ func attemptLoadingFlowConfig(t *testing.T, river []byte) { }) require.NoError(t, err) - f := flow.New(flow.Options{ + f := alloy.New(alloy.Options{ Logger: logger, DataPath: t.TempDir(), MinStability: featuregate.StabilityExperimental, diff --git a/internal/filedetector/detector.go b/internal/filedetector/detector.go index 58cbfb6635..1740155785 100644 --- a/internal/filedetector/detector.go +++ b/internal/filedetector/detector.go @@ -9,7 +9,7 @@ import ( "github.com/fsnotify/fsnotify" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging/level" + "github.com/grafana/alloy/internal/alloy/logging/level" ) // Detector is used to specify how changes to the file should be detected. diff --git a/internal/service/cluster/cluster.go b/internal/service/cluster/cluster.go index dfc4efe35b..763a5db853 100644 --- a/internal/service/cluster/cluster.go +++ b/internal/service/cluster/cluster.go @@ -14,9 +14,9 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service" http_service "github.com/grafana/alloy/internal/service/http" "github.com/grafana/ckit" diff --git a/internal/service/http/http.go b/internal/service/http/http.go index 3cdb2549bd..a84c1e2506 100644 --- a/internal/service/http/http.go +++ b/internal/service/http/http.go @@ -15,10 +15,10 @@ import ( "github.com/go-kit/log" "github.com/gorilla/mux" + "github.com/grafana/alloy/internal/alloy" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service" "github.com/grafana/alloy/internal/static/server" "github.com/grafana/ckit/memconn" @@ -43,7 +43,7 @@ type Options struct { Gatherer prometheus.Gatherer // Where to collect metrics from. ReadyFunc func() bool - ReloadFunc func() (*flow.Source, error) + ReloadFunc func() (*alloy.Source, error) HTTPListenAddr string // Address to listen for HTTP traffic on. MemoryListenAddr string // Address to accept in-memory traffic on. diff --git a/internal/service/http/http_test.go b/internal/service/http/http_test.go index a46292f0fc..7c7905bbed 100644 --- a/internal/service/http/http_test.go +++ b/internal/service/http/http_test.go @@ -6,9 +6,9 @@ import ( "net/http" "testing" + "github.com/grafana/alloy/internal/alloy" + "github.com/grafana/alloy/internal/alloy/componenttest" "github.com/grafana/alloy/internal/component" - "github.com/grafana/alloy/internal/flow" - "github.com/grafana/alloy/internal/flow/componenttest" "github.com/grafana/alloy/internal/service" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" @@ -172,7 +172,7 @@ func newTestEnvironment(t *testing.T) (*testEnvironment, error) { Gatherer: prometheus.NewRegistry(), ReadyFunc: func() bool { return true }, - ReloadFunc: func() (*flow.Source, error) { return nil, nil }, + ReloadFunc: func() (*alloy.Source, error) { return nil, nil }, HTTPListenAddr: fmt.Sprintf("127.0.0.1:%d", port), MemoryListenAddr: "agent.internal:12345", diff --git a/internal/service/labelstore/service.go b/internal/service/labelstore/service.go index 3749e5b7bf..c80268b935 100644 --- a/internal/service/labelstore/service.go +++ b/internal/service/labelstore/service.go @@ -6,8 +6,8 @@ import ( "time" "github.com/go-kit/log" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" agent_service "github.com/grafana/alloy/internal/service" flow_service "github.com/grafana/alloy/internal/service" "github.com/prometheus/client_golang/prometheus" diff --git a/internal/service/remotecfg/remotecfg.go b/internal/service/remotecfg/remotecfg.go index f45f80ae19..8c2c4ea522 100644 --- a/internal/service/remotecfg/remotecfg.go +++ b/internal/service/remotecfg/remotecfg.go @@ -15,10 +15,10 @@ import ( "github.com/go-kit/log" agentv1 "github.com/grafana/agent-remote-config/api/gen/proto/go/agent/v1" "github.com/grafana/agent-remote-config/api/gen/proto/go/agent/v1/agentv1connect" + "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/alloyseed" "github.com/grafana/alloy/internal/component/common/config" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow/logging/level" "github.com/grafana/alloy/internal/service" "github.com/grafana/alloy/syntax" commonconfig "github.com/prometheus/common/config" diff --git a/internal/service/remotecfg/remotecfg_test.go b/internal/service/remotecfg/remotecfg_test.go index 143eb0905d..f753ab01e1 100644 --- a/internal/service/remotecfg/remotecfg_test.go +++ b/internal/service/remotecfg/remotecfg_test.go @@ -11,12 +11,12 @@ import ( "connectrpc.com/connect" agentv1 "github.com/grafana/agent-remote-config/api/gen/proto/go/agent/v1" + "github.com/grafana/alloy/internal/alloy" + "github.com/grafana/alloy/internal/alloy/componenttest" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/alloy/internal/component" _ "github.com/grafana/alloy/internal/component/loki/process" "github.com/grafana/alloy/internal/featuregate" - "github.com/grafana/alloy/internal/flow" - "github.com/grafana/alloy/internal/flow/componenttest" - "github.com/grafana/alloy/internal/flow/logging" "github.com/grafana/alloy/internal/service" "github.com/grafana/alloy/internal/util" "github.com/grafana/alloy/syntax" @@ -165,7 +165,7 @@ func (fakeHost) GetService(_ string) (service.Service, bool) { return nil, f func (f fakeHost) NewController(id string) service.Controller { logger, _ := logging.New(io.Discard, logging.DefaultOptions) - ctrl := flow.New(flow.Options{ + ctrl := alloy.New(alloy.Options{ ControllerID: ServiceName, Logger: logger, Tracer: nil, @@ -211,12 +211,12 @@ func (ag *agentClient) ListAgents(context.Context, *connect.Request[agentv1.List } type serviceController struct { - f *flow.Flow + f *alloy.Flow } func (sc serviceController) Run(ctx context.Context) { sc.f.Run(ctx) } func (sc serviceController) LoadSource(b []byte, args map[string]any) error { - source, err := flow.ParseSource("", b) + source, err := alloy.ParseSource("", b) if err != nil { return err } diff --git a/internal/static/server/config.go b/internal/static/server/config.go index 5a85a79997..a44c2ad197 100644 --- a/internal/static/server/config.go +++ b/internal/static/server/config.go @@ -3,7 +3,7 @@ package server import ( "flag" - "github.com/grafana/alloy/internal/flow/logging" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/grafana/dskit/log" ) diff --git a/internal/util/test_logger.go b/internal/util/test_logger.go index 9a9795ee64..76a999f360 100644 --- a/internal/util/test_logger.go +++ b/internal/util/test_logger.go @@ -6,7 +6,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/grafana/alloy/internal/flow/logging" + "github.com/grafana/alloy/internal/alloy/logging" "github.com/stretchr/testify/require" ) From dc4bd200162f3efefe728219401e53b2cd9f32a2 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Mon, 25 Mar 2024 17:07:33 -0400 Subject: [PATCH 4/5] internal/alloy: remove all references to Flow in code This removes all references to "flow" in the code of internal/alloy, which was previously internal/flow. --- internal/alloy/componenttest/componenttest.go | 2 +- .../alloy/componenttest/testfailmodule.go | 6 +-- internal/alloy/flow.go | 28 +++++++------- internal/alloy/flow_components.go | 6 +-- internal/alloy/flow_services.go | 10 ++--- internal/alloy/flow_services_test.go | 2 +- internal/alloy/flow_test.go | 2 +- internal/alloy/flow_updates_test.go | 2 +- internal/alloy/import_test.go | 2 +- .../internal/controller/component_node.go | 2 +- internal/alloy/internal/controller/loader.go | 10 ++--- .../alloy/internal/controller/node_service.go | 2 +- .../testcomponents/module/file/file.go | 6 +-- .../internal/testcomponents/module/git/git.go | 4 +- .../testcomponents/module/http/http.go | 6 +-- .../internal/testcomponents/module/module.go | 8 ++-- .../testcomponents/module/string/string.go | 4 +- internal/alloy/logging/logger.go | 2 +- internal/alloy/logging/logger_test.go | 38 +++++++++---------- internal/alloy/module.go | 2 +- internal/alloy/module_eval_test.go | 12 +++--- internal/alloy/source.go | 6 +-- internal/alloy/tracing/tracing.go | 6 +-- internal/alloycli/cmd_run.go | 2 +- internal/service/remotecfg/remotecfg_test.go | 2 +- 25 files changed, 86 insertions(+), 86 deletions(-) diff --git a/internal/alloy/componenttest/componenttest.go b/internal/alloy/componenttest/componenttest.go index 45c0b9b3b0..09bad2873c 100644 --- a/internal/alloy/componenttest/componenttest.go +++ b/internal/alloy/componenttest/componenttest.go @@ -1,4 +1,4 @@ -// Package componenttest provides utilities for testing Flow components. +// Package componenttest provides utilities for testing components. package componenttest import ( diff --git a/internal/alloy/componenttest/testfailmodule.go b/internal/alloy/componenttest/testfailmodule.go index f5f8f5552e..21975c4c3a 100644 --- a/internal/alloy/componenttest/testfailmodule.go +++ b/internal/alloy/componenttest/testfailmodule.go @@ -24,7 +24,7 @@ func init() { if args.(TestFailArguments).Fail { return nil, fmt.Errorf("module told to fail") } - err = m.LoadFlowSource(nil, args.(TestFailArguments).Content) + err = m.LoadAlloySource(nil, args.(TestFailArguments).Content) if err != nil { return nil, err } @@ -53,14 +53,14 @@ type TestFailModule struct { } func (t *TestFailModule) Run(ctx context.Context) error { - go t.mc.RunFlowController(ctx) + go t.mc.RunAlloyController(ctx) <-ctx.Done() return nil } func (t *TestFailModule) UpdateContent(content string) error { t.content = content - err := t.mc.LoadFlowSource(nil, t.content) + err := t.mc.LoadAlloySource(nil, t.content) return err } diff --git a/internal/alloy/flow.go b/internal/alloy/flow.go index 26d3187ece..13a4bfb4d4 100644 --- a/internal/alloy/flow.go +++ b/internal/alloy/flow.go @@ -109,7 +109,7 @@ type Options struct { } // Alloy is the Alloy system. -type Flow struct { +type Alloy struct { log *logging.Logger tracer *tracing.Tracer opts controllerOptions @@ -125,8 +125,8 @@ type Flow struct { loadedOnce atomic.Bool } -// New creates a new, unstarted Flow controller. Call Run to run the controller. -func New(o Options) *Flow { +// New creates a new, unstarted Alloy controller. Call Run to run the controller. +func New(o Options) *Alloy { return newController(controllerOptions{ Options: o, ModuleRegistry: newModuleRegistry(), @@ -135,7 +135,7 @@ func New(o Options) *Flow { }) } -// controllerOptions are internal options used to create both root Flow +// controllerOptions are internal options used to create both root Alloy // controller and controllers for modules. type controllerOptions struct { Options @@ -147,10 +147,10 @@ type controllerOptions struct { WorkerPool worker.Pool } -// newController creates a new, unstarted Flow controller with a specific +// newController creates a new, unstarted Alloy controller with a specific // moduleRegistry. Modules created by the controller will be passed to the // given modReg. -func newController(o controllerOptions) *Flow { +func newController(o controllerOptions) *Alloy { var ( log = o.Logger tracer = o.Tracer @@ -171,7 +171,7 @@ func newController(o controllerOptions) *Flow { workerPool = worker.NewDefaultWorkerPool() } - f := &Flow{ + f := &Alloy{ log: log, tracer: tracer, opts: o, @@ -231,12 +231,12 @@ func newController(o controllerOptions) *Flow { return f } -// Run starts the Flow controller, blocking until the provided context is +// Run starts the Alloy controller, blocking until the provided context is // canceled. Run must only be called once. -func (f *Flow) Run(ctx context.Context) { +func (f *Alloy) Run(ctx context.Context) { defer func() { _ = f.sched.Close() }() defer f.loader.Cleanup(!f.opts.IsModule) - defer level.Debug(f.log).Log("msg", "flow controller exiting") + defer level.Debug(f.log).Log("msg", "Alloy controller exiting") for { select { @@ -290,12 +290,12 @@ func (f *Flow) Run(ctx context.Context) { // The controller will only start running components after Load is called once // without any configuration errors. // LoadSource uses default loader configuration. -func (f *Flow) LoadSource(source *Source, args map[string]any) error { +func (f *Alloy) LoadSource(source *Source, args map[string]any) error { return f.loadSource(source, args, nil) } // Same as above but with a customComponentRegistry that provides custom component definitions. -func (f *Flow) loadSource(source *Source, args map[string]any, customComponentRegistry *controller.CustomComponentRegistry) error { +func (f *Alloy) loadSource(source *Source, args map[string]any, customComponentRegistry *controller.CustomComponentRegistry) error { f.loadMut.Lock() defer f.loadMut.Unlock() @@ -323,7 +323,7 @@ func (f *Flow) loadSource(source *Source, args map[string]any, customComponentRe return diags.ErrorOrNil() } -// Ready returns whether the Flow controller has finished its initial load. -func (f *Flow) Ready() bool { +// Ready returns whether the Alloy controller has finished its initial load. +func (f *Alloy) Ready() bool { return f.loadedOnce.Load() } diff --git a/internal/alloy/flow_components.go b/internal/alloy/flow_components.go index 2eb5f2fc65..02d18f2a7a 100644 --- a/internal/alloy/flow_components.go +++ b/internal/alloy/flow_components.go @@ -9,7 +9,7 @@ import ( ) // GetComponent implements [component.Provider]. -func (f *Flow) GetComponent(id component.ID, opts component.InfoOptions) (*component.Info, error) { +func (f *Alloy) GetComponent(id component.ID, opts component.InfoOptions) (*component.Info, error) { f.loadMut.RLock() defer f.loadMut.RUnlock() @@ -38,7 +38,7 @@ func (f *Flow) GetComponent(id component.ID, opts component.InfoOptions) (*compo } // ListComponents implements [component.Provider]. -func (f *Flow) ListComponents(moduleID string, opts component.InfoOptions) ([]*component.Info, error) { +func (f *Alloy) ListComponents(moduleID string, opts component.InfoOptions) ([]*component.Info, error) { f.loadMut.RLock() defer f.loadMut.RUnlock() @@ -63,7 +63,7 @@ func (f *Flow) ListComponents(moduleID string, opts component.InfoOptions) ([]*c return detail, nil } -func (f *Flow) getComponentDetail(cn controller.ComponentNode, graph *dag.Graph, opts component.InfoOptions) *component.Info { +func (f *Alloy) getComponentDetail(cn controller.ComponentNode, graph *dag.Graph, opts component.InfoOptions) *component.Info { var references, referencedBy []string // Skip over any edge which isn't between two component nodes. This is a diff --git a/internal/alloy/flow_services.go b/internal/alloy/flow_services.go index 062e579b75..cd3d4939f2 100644 --- a/internal/alloy/flow_services.go +++ b/internal/alloy/flow_services.go @@ -12,7 +12,7 @@ import ( // GetServiceConsumers implements [service.Host]. It returns a slice of // [component.Component] and [service.Service]s which declared a dependency on // the named service. -func (f *Flow) GetServiceConsumers(serviceName string) []service.Consumer { +func (f *Alloy) GetServiceConsumers(serviceName string) []service.Consumer { consumers := serviceConsumersForGraph(f.loader.OriginalGraph(), serviceName, true) // Iterate through all modules to find other components that depend on the @@ -28,7 +28,7 @@ func (f *Flow) GetServiceConsumers(serviceName string) []service.Consumer { // GetService implements [service.Host]. It looks up a [service.Service] by // name. -func (f *Flow) GetService(name string) (service.Service, bool) { +func (f *Alloy) GetService(name string) (service.Service, bool) { for _, svc := range f.opts.Services { if svc.Definition().Name == name { return svc, true @@ -67,9 +67,9 @@ func serviceConsumersForGraph(graph *dag.Graph, serviceName string, includePeerS return consumers } -// NewController returns a new, unstarted, isolated Flow controller so that +// NewController returns a new, unstarted, isolated Alloy controller so that // services can instantiate their own components. -func (f *Flow) NewController(id string) service.Controller { +func (f *Alloy) NewController(id string) service.Controller { return serviceController{ f: newController(controllerOptions{ Options: Options{ @@ -90,7 +90,7 @@ func (f *Flow) NewController(id string) service.Controller { } type serviceController struct { - f *Flow + f *Alloy } func (sc serviceController) Run(ctx context.Context) { sc.f.Run(ctx) } diff --git a/internal/alloy/flow_services_test.go b/internal/alloy/flow_services_test.go index c5a6f3e885..f830ffad44 100644 --- a/internal/alloy/flow_services_test.go +++ b/internal/alloy/flow_services_test.go @@ -145,7 +145,7 @@ func TestServices_Configurable_Optional(t *testing.T) { require.NoError(t, updateCalled.Wait(5*time.Second), "Service was not configured") } -func TestFlow_GetServiceConsumers(t *testing.T) { +func TestAlloy_GetServiceConsumers(t *testing.T) { defer verifyNoGoroutineLeaks(t) var ( svcA = &testservices.Fake{ diff --git a/internal/alloy/flow_test.go b/internal/alloy/flow_test.go index 36e1a93728..9349de9518 100644 --- a/internal/alloy/flow_test.go +++ b/internal/alloy/flow_test.go @@ -78,7 +78,7 @@ func testOptions(t *testing.T) Options { } } -func cleanUpController(ctrl *Flow) { +func cleanUpController(ctrl *Alloy) { // To avoid leaking goroutines and clean-up, we need to run and shut down the controller. ctx, cancel := context.WithCancel(context.Background()) done := make(chan struct{}) diff --git a/internal/alloy/flow_updates_test.go b/internal/alloy/flow_updates_test.go index d5d7e61bca..a59d527b20 100644 --- a/internal/alloy/flow_updates_test.go +++ b/internal/alloy/flow_updates_test.go @@ -370,7 +370,7 @@ func TestController_Updates_WithLaggingComponent(t *testing.T) { require.Equal(t, 10, in.(testcomponents.SummationConfig).Input) } -func newTestController(t *testing.T) *Flow { +func newTestController(t *testing.T) *Alloy { return newController(controllerOptions{ Options: testOptions(t), ModuleRegistry: newModuleRegistry(), diff --git a/internal/alloy/import_test.go b/internal/alloy/import_test.go index 6ae51b75cf..44d594c566 100644 --- a/internal/alloy/import_test.go +++ b/internal/alloy/import_test.go @@ -322,7 +322,7 @@ func testConfigError(t *testing.T, config string, expectedError string) { }() } -func setup(t *testing.T, config string) (*alloy.Flow, *alloy.Source) { +func setup(t *testing.T, config string) (*alloy.Alloy, *alloy.Source) { s, err := logging.New(os.Stderr, logging.DefaultOptions) require.NoError(t, err) ctrl := alloy.New(alloy.Options{ diff --git a/internal/alloy/internal/controller/component_node.go b/internal/alloy/internal/controller/component_node.go index 8c797b6100..d5b5974a40 100644 --- a/internal/alloy/internal/controller/component_node.go +++ b/internal/alloy/internal/controller/component_node.go @@ -4,7 +4,7 @@ import ( "github.com/grafana/alloy/internal/component" ) -// ComponentNode is a generic representation of a Flow component. +// ComponentNode is a generic representation of a component. type ComponentNode interface { RunnableNode diff --git a/internal/alloy/internal/controller/loader.go b/internal/alloy/internal/controller/loader.go index 88bb31dbca..ea6718b7c8 100644 --- a/internal/alloy/internal/controller/loader.go +++ b/internal/alloy/internal/controller/loader.go @@ -640,8 +640,8 @@ func (l *Loader) wireCustomComponentNode(g *dag.Graph, cc *CustomComponentNode) } } -// Variables returns the Variables the Loader exposes for other Flow components -// to reference. +// Variables returns the Variables the Loader exposes for other components to +// reference. func (l *Loader) Variables() map[string]interface{} { return l.cache.BuildContext().Variables } @@ -722,8 +722,8 @@ func (l *Loader) EvaluateDependants(ctx context.Context, updatedNodes []*QueuedN } // Submit all dependencies for asynchronous evaluation. - // During evaluation, if a node's exports change, Flow will add it to updated nodes queue (controller.Queue) and - // the Flow controller will call EvaluateDependants on it again. This results in a concurrent breadth-first + // During evaluation, if a node's exports change, Alloy will add it to updated nodes queue (controller.Queue) and + // the Alloy controller will call EvaluateDependants on it again. This results in a concurrent breadth-first // traversal of the nodes that need to be evaluated. for n, parent := range dependenciesToParentsMap { dependantCtx, span := tracer.Start(spanCtx, "SubmitForEvaluation", trace.WithSpanKind(trace.SpanKindInternal)) @@ -871,7 +871,7 @@ func multierrToDiags(errors error) diag.Diagnostics { return diags } -// isRootController returns true if the loader is for the root flow controller. +// isRootController returns true if the loader is for the root Alloy controller. func (l *Loader) isRootController() bool { return l.globals.ControllerID == "" } diff --git a/internal/alloy/internal/controller/node_service.go b/internal/alloy/internal/controller/node_service.go index 504b647e63..a6a1a25bd3 100644 --- a/internal/alloy/internal/controller/node_service.go +++ b/internal/alloy/internal/controller/node_service.go @@ -12,7 +12,7 @@ import ( "github.com/grafana/alloy/syntax/vm" ) -// ServiceNode is a Flow DAG node which represents a running service. +// ServiceNode is a DAG node which represents a running service. type ServiceNode struct { host service.Host svc service.Service diff --git a/internal/alloy/internal/testcomponents/module/file/file.go b/internal/alloy/internal/testcomponents/module/file/file.go index 46f5ac5b8c..d36396a59e 100644 --- a/internal/alloy/internal/testcomponents/module/file/file.go +++ b/internal/alloy/internal/testcomponents/module/file/file.go @@ -90,7 +90,7 @@ func (c *Component) newManagedLocalComponent(o component.Options) (*file.Compone if !c.inUpdate.Load() && c.isCreated.Load() { // Any errors found here are reported via component health - _ = c.mod.LoadFlowSource(c.getArgs().Arguments, c.getContent().Value) + _ = c.mod.LoadAlloySource(c.getArgs().Arguments, c.getContent().Value) } } @@ -110,7 +110,7 @@ func (c *Component) Run(ctx context.Context) error { } }() - go c.mod.RunFlowController(ctx) + go c.mod.RunAlloyController(ctx) for { select { @@ -137,7 +137,7 @@ func (c *Component) Update(args component.Arguments) error { // Force a content load here and bubble up any error. This will catch problems // on initial load. - return c.mod.LoadFlowSource(newArgs.Arguments, c.getContent().Value) + return c.mod.LoadAlloySource(newArgs.Arguments, c.getContent().Value) } // CurrentHealth implements component.HealthComponent. diff --git a/internal/alloy/internal/testcomponents/module/git/git.go b/internal/alloy/internal/testcomponents/module/git/git.go index 7d79cb405e..e740f1302d 100644 --- a/internal/alloy/internal/testcomponents/module/git/git.go +++ b/internal/alloy/internal/testcomponents/module/git/git.go @@ -107,7 +107,7 @@ func (c *Component) Run(ctx context.Context) error { ctx, cancel := context.WithCancel(ctx) defer cancel() - go c.mod.RunFlowController(ctx) + go c.mod.RunAlloyController(ctx) var ( ticker *time.Ticker @@ -241,7 +241,7 @@ func (c *Component) pollFile(ctx context.Context, args Arguments) error { return err } - return c.mod.LoadFlowSource(args.Arguments, string(bb)) + return c.mod.LoadAlloySource(args.Arguments, string(bb)) } // CurrentHealth implements component.HealthComponent. diff --git a/internal/alloy/internal/testcomponents/module/http/http.go b/internal/alloy/internal/testcomponents/module/http/http.go index d615b59258..772bd8946a 100644 --- a/internal/alloy/internal/testcomponents/module/http/http.go +++ b/internal/alloy/internal/testcomponents/module/http/http.go @@ -89,7 +89,7 @@ func (c *Component) newManagedLocalComponent(o component.Options) (*remote_http. if !c.inUpdate.Load() && c.isCreated.Load() { // Any errors found here are reported via component health - _ = c.mod.LoadFlowSource(c.getArgs().Arguments, c.getContent().Value) + _ = c.mod.LoadAlloySource(c.getArgs().Arguments, c.getContent().Value) } } @@ -109,7 +109,7 @@ func (c *Component) Run(ctx context.Context) error { } }() - go c.mod.RunFlowController(ctx) + go c.mod.RunAlloyController(ctx) for { select { @@ -136,7 +136,7 @@ func (c *Component) Update(args component.Arguments) error { // Force a content load here and bubble up any error. This will catch problems // on initial load. - return c.mod.LoadFlowSource(newArgs.Arguments, c.getContent().Value) + return c.mod.LoadAlloySource(newArgs.Arguments, c.getContent().Value) } // CurrentHealth implements component.HealthComponent. diff --git a/internal/alloy/internal/testcomponents/module/module.go b/internal/alloy/internal/testcomponents/module/module.go index 3407929fa5..3079d3c74e 100644 --- a/internal/alloy/internal/testcomponents/module/module.go +++ b/internal/alloy/internal/testcomponents/module/module.go @@ -40,10 +40,10 @@ func NewModuleComponent(o component.Options) (*ModuleComponent, error) { return c, err } -// LoadFlowSource loads the flow controller with the current component source. +// LoadAlloySource loads the flow controller with the current component source. // It will set the component health in addition to return the error so that the consumer can rely on either or both. // If the content is the same as the last time it was successfully loaded, it will not be reloaded. -func (c *ModuleComponent) LoadFlowSource(args map[string]any, contentValue string) error { +func (c *ModuleComponent) LoadAlloySource(args map[string]any, contentValue string) error { if reflect.DeepEqual(args, c.getLatestArgs()) && contentValue == c.getLatestContent() { return nil } @@ -70,8 +70,8 @@ func (c *ModuleComponent) LoadFlowSource(args map[string]any, contentValue strin return nil } -// RunFlowController runs the flow controller that all module components start. -func (c *ModuleComponent) RunFlowController(ctx context.Context) { +// RunAlloyController runs the flow controller that all module components start. +func (c *ModuleComponent) RunAlloyController(ctx context.Context) { err := c.mod.Run(ctx) if err != nil { level.Error(c.opts.Logger).Log("msg", "error running module", "id", c.opts.ID, "err", err) diff --git a/internal/alloy/internal/testcomponents/module/string/string.go b/internal/alloy/internal/testcomponents/module/string/string.go index 6cc0bf8396..dc786d0a73 100644 --- a/internal/alloy/internal/testcomponents/module/string/string.go +++ b/internal/alloy/internal/testcomponents/module/string/string.go @@ -60,7 +60,7 @@ func New(o component.Options, args Arguments) (*Component, error) { // Run implements component.Component. func (c *Component) Run(ctx context.Context) error { - c.mod.RunFlowController(ctx) + c.mod.RunAlloyController(ctx) return nil } @@ -68,7 +68,7 @@ func (c *Component) Run(ctx context.Context) error { func (c *Component) Update(args component.Arguments) error { newArgs := args.(Arguments) - return c.mod.LoadFlowSource(newArgs.Arguments, newArgs.Content.Value) + return c.mod.LoadAlloySource(newArgs.Arguments, newArgs.Content.Value) } // CurrentHealth implements component.HealthComponent. diff --git a/internal/alloy/logging/logger.go b/internal/alloy/logging/logger.go index 2a81d57b41..c4d798424a 100644 --- a/internal/alloy/logging/logger.go +++ b/internal/alloy/logging/logger.go @@ -18,7 +18,7 @@ type EnabledAware interface { Enabled(context.Context, slog.Level) bool } -// Logger is the logging subsystem of Flow. It supports being dynamically +// Logger is the logging subsystem of Alloy. It supports being dynamically // updated at runtime. type Logger struct { inner io.Writer // Writer passed to New. diff --git a/internal/alloy/logging/logger_test.go b/internal/alloy/logging/logger_test.go index f70fd0e927..7d8df9ebb5 100644 --- a/internal/alloy/logging/logger_test.go +++ b/internal/alloy/logging/logger_test.go @@ -12,16 +12,16 @@ import ( "github.com/go-kit/log" gokitlevel "github.com/go-kit/log/level" "github.com/grafana/alloy/internal/alloy/logging" - flowlevel "github.com/grafana/alloy/internal/alloy/logging/level" + alloylevel "github.com/grafana/alloy/internal/alloy/logging/level" "github.com/grafana/alloy/internal/component/common/loki" "github.com/stretchr/testify/require" ) /* Most recent performance results on M2 Macbook Air: -$ go test -count=1 -benchmem ./internal/flow/logging -run ^$ -bench BenchmarkLogging_ +$ go test -count=1 -benchmem ./internal/alloy/logging -run ^$ -bench BenchmarkLogging_ goos: darwin goarch: arm64 -pkg: github.com/grafana/agent/internal/flow/logging +pkg: github.com/grafana/agent/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 @@ -29,8 +29,8 @@ BenchmarkLogging_GoKitLevel_Drops-8 6705489 176.6 ns/op BenchmarkLogging_GoKitLevel_Prints-8 678214 1669 ns/op 849 B/op 16 allocs/op BenchmarkLogging_Slog_Drops-8 79687671 15.09 ns/op 8 B/op 0 allocs/op BenchmarkLogging_Slog_Prints-8 1000000 1119 ns/op 32 B/op 2 allocs/op -BenchmarkLogging_FlowLevel_Drops-8 21693330 58.45 ns/op 168 B/op 2 allocs/op -BenchmarkLogging_FlowLevel_Prints-8 720554 1672 ns/op 833 B/op 15 allocs/op +BenchmarkLogging_AlloyLevel_Drops-8 21693330 58.45 ns/op 168 B/op 2 allocs/op +BenchmarkLogging_AlloyLevel_Prints-8 720554 1672 ns/op 833 B/op 15 allocs/op */ const testStr = "this is a test string" @@ -57,46 +57,46 @@ func TestLevels(t *testing.T) { expected: "", }, { - name: "flow info level - drops", + name: "alloy info level - drops", logger: func(w io.Writer) (log.Logger, error) { logger, err := logging.New(w, warnLevel()) - return flowlevel.Info(logger), err + return alloylevel.Info(logger), err }, message: "hello", expected: "", }, { - name: "flow debug level - prints", + name: "alloy debug level - prints", logger: func(w io.Writer) (log.Logger, error) { logger, err := logging.New(w, debugLevel()) - return flowlevel.Debug(logger), err + return alloylevel.Debug(logger), err }, message: "hello", expected: "level=debug msg=hello\n", }, { - name: "flow info level - prints", + name: "alloy info level - prints", logger: func(w io.Writer) (log.Logger, error) { logger, err := logging.New(w, infoLevel()) - return flowlevel.Info(logger), err + return alloylevel.Info(logger), err }, message: "hello", expected: "level=info msg=hello\n", }, { - name: "flow warn level - prints", + name: "alloy warn level - prints", logger: func(w io.Writer) (log.Logger, error) { logger, err := logging.New(w, debugLevel()) - return flowlevel.Warn(logger), err + return alloylevel.Warn(logger), err }, message: "hello", expected: "level=warn msg=hello\n", }, { - name: "flow error level - prints", + name: "alloy error level - prints", logger: func(w io.Writer) (log.Logger, error) { logger, err := logging.New(w, debugLevel()) - return flowlevel.Error(logger), err + return alloylevel.Error(logger), err }, message: "hello", expected: "level=error msg=hello\n", @@ -258,23 +258,23 @@ func BenchmarkLogging_Slog_Prints(b *testing.B) { } } -func BenchmarkLogging_FlowLevel_Drops(b *testing.B) { +func BenchmarkLogging_AlloyLevel_Drops(b *testing.B) { logger, err := logging.New(io.Discard, infoLevel()) require.NoError(b, err) testErr := fmt.Errorf("test error") for i := 0; i < b.N; i++ { - flowlevel.Debug(logger).Log("msg", "test message", "i", i, "err", testErr, "str", testStr, "duration", time.Second) + alloylevel.Debug(logger).Log("msg", "test message", "i", i, "err", testErr, "str", testStr, "duration", time.Second) } } -func BenchmarkLogging_FlowLevel_Prints(b *testing.B) { +func BenchmarkLogging_AlloyLevel_Prints(b *testing.B) { logger, err := logging.New(io.Discard, infoLevel()) require.NoError(b, err) testErr := fmt.Errorf("test error") for i := 0; i < b.N; i++ { - flowlevel.Info(logger).Log("msg", "test message", "i", i, "err", testErr, "str", testStr, "duration", time.Second) + alloylevel.Info(logger).Log("msg", "test message", "i", i, "err", testErr, "str", testStr, "duration", time.Second) } } diff --git a/internal/alloy/module.go b/internal/alloy/module.go index 8d0c79cd70..7f6b883106 100644 --- a/internal/alloy/module.go +++ b/internal/alloy/module.go @@ -111,7 +111,7 @@ func (m *moduleController) ModuleIDs() []string { } type module struct { - f *Flow + f *Alloy o *moduleOptions } diff --git a/internal/alloy/module_eval_test.go b/internal/alloy/module_eval_test.go index b97f543203..16b6a8883a 100644 --- a/internal/alloy/module_eval_test.go +++ b/internal/alloy/module_eval_test.go @@ -1,7 +1,7 @@ package alloy_test -// This file contains tests which verify that the Flow controller correctly evaluates and updates modules, including -// the module's arguments and exports. +// This file contains tests which verify that the Alloy controller correctly +// evaluates and updates modules, including the module's arguments and exports. import ( "context" @@ -82,7 +82,7 @@ func TestUpdates_EmptyModule(t *testing.T) { } func TestUpdates_ThroughModule(t *testing.T) { - // We use this module in a Flow config below. + // We use this module in an Alloy config below. module := ` argument "input" { optional = false @@ -143,7 +143,7 @@ func TestUpdates_ThroughModule(t *testing.T) { } func TestUpdates_TwoModules_SameCompNames(t *testing.T) { - // We use this module in a Flow config below. + // We use this module in an Alloy config below. module := ` testcomponents.count "inc" { frequency = "1ms" @@ -211,7 +211,7 @@ func TestUpdates_TwoModules_SameCompNames(t *testing.T) { } func TestUpdates_ReloadConfig(t *testing.T) { - // We use this module in a Flow config below. + // We use this module in an Alloy config below. module := ` argument "input" { optional = false @@ -345,7 +345,7 @@ func testOptions(t *testing.T) alloy.Options { } } -func getExport[T any](t *testing.T, ctrl *alloy.Flow, moduleId string, nodeId string) T { +func getExport[T any](t *testing.T, ctrl *alloy.Alloy, moduleId string, nodeId string) T { t.Helper() info, err := ctrl.GetComponent(component.ID{ ModuleID: moduleId, diff --git a/internal/alloy/source.go b/internal/alloy/source.go index 05cb7eef15..183676654c 100644 --- a/internal/alloy/source.go +++ b/internal/alloy/source.go @@ -12,13 +12,13 @@ import ( "github.com/grafana/alloy/syntax/parser" ) -// A Source holds the contents of a parsed Flow source +// A Source holds the contents of a parsed Alloy configuration source module. type Source struct { - sourceMap map[string][]byte // Map that links parsed Flow source's name with its content. + sourceMap map[string][]byte // Map that links parsed Alloy source's name with its content. hash [sha256.Size]byte // Hash of all files in sourceMap sorted by name. // Components holds the list of raw River AST blocks describing components. - // The Flow controller can interpret them. + // The Alloy controller can interpret them. components []*ast.BlockStmt configBlocks []*ast.BlockStmt declareBlocks []*ast.BlockStmt diff --git a/internal/alloy/tracing/tracing.go b/internal/alloy/tracing/tracing.go index 65831de9db..d8a0fa3763 100644 --- a/internal/alloy/tracing/tracing.go +++ b/internal/alloy/tracing/tracing.go @@ -1,4 +1,4 @@ -// Package tracing implements the tracing subsystem of Grafana Agent Flow. The +// Package tracing implements the tracing subsystem of Grafana Alloy. The // tracing subsystem exposes a [trace.TraceProvider] which accepts traces and // forwards them to a running component for further processing. package tracing @@ -72,9 +72,9 @@ func (opts *JaegerRemoteSamplerOptions) SetToDefault() { *opts = DefaultJaegerRemoteSamplerOptions } -// Tracer is the tracing subsystem of Grafana Agent Flow. It implements +// Tracer is the tracing subsystem of Grafana Alloy. It implements // [trace.TracerProvider] and can be used to forward internally generated -// traces to a OpenTelemetry Collector-compatible Flow component. +// traces to a OpenTelemetry Collector-compatible Alloy component. type Tracer struct { trace.TracerProvider sampler *lazySampler diff --git a/internal/alloycli/cmd_run.go b/internal/alloycli/cmd_run.go index 6635f28eaf..61df9964a0 100644 --- a/internal/alloycli/cmd_run.go +++ b/internal/alloycli/cmd_run.go @@ -382,7 +382,7 @@ func (fr *alloyRun) Run(configPath string) error { } // getEnabledComponentsFunc returns a function that gets the current enabled components -func getEnabledComponentsFunc(f *alloy.Flow) func() map[string]interface{} { +func getEnabledComponentsFunc(f *alloy.Alloy) func() map[string]interface{} { return func() map[string]interface{} { components := component.GetAllComponents(f, component.InfoOptions{}) componentNames := map[string]struct{}{} diff --git a/internal/service/remotecfg/remotecfg_test.go b/internal/service/remotecfg/remotecfg_test.go index f753ab01e1..6a53c3d8fa 100644 --- a/internal/service/remotecfg/remotecfg_test.go +++ b/internal/service/remotecfg/remotecfg_test.go @@ -211,7 +211,7 @@ func (ag *agentClient) ListAgents(context.Context, *connect.Request[agentv1.List } type serviceController struct { - f *alloy.Flow + f *alloy.Alloy } func (sc serviceController) Run(ctx context.Context) { sc.f.Run(ctx) } From 0e044c008996576563b78fd16aca5ab47ce5e608 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Mon, 25 Mar 2024 17:08:33 -0400 Subject: [PATCH 5/5] internal/alloy: rename flow files to alloy --- internal/alloy/{flow.go => alloy.go} | 0 internal/alloy/{flow_components.go => alloy_components.go} | 0 internal/alloy/{flow_services.go => alloy_services.go} | 0 internal/alloy/{flow_services_test.go => alloy_services_test.go} | 0 internal/alloy/{flow_test.go => alloy_test.go} | 0 internal/alloy/{flow_updates_test.go => alloy_updates_test.go} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename internal/alloy/{flow.go => alloy.go} (100%) rename internal/alloy/{flow_components.go => alloy_components.go} (100%) rename internal/alloy/{flow_services.go => alloy_services.go} (100%) rename internal/alloy/{flow_services_test.go => alloy_services_test.go} (100%) rename internal/alloy/{flow_test.go => alloy_test.go} (100%) rename internal/alloy/{flow_updates_test.go => alloy_updates_test.go} (100%) diff --git a/internal/alloy/flow.go b/internal/alloy/alloy.go similarity index 100% rename from internal/alloy/flow.go rename to internal/alloy/alloy.go diff --git a/internal/alloy/flow_components.go b/internal/alloy/alloy_components.go similarity index 100% rename from internal/alloy/flow_components.go rename to internal/alloy/alloy_components.go diff --git a/internal/alloy/flow_services.go b/internal/alloy/alloy_services.go similarity index 100% rename from internal/alloy/flow_services.go rename to internal/alloy/alloy_services.go diff --git a/internal/alloy/flow_services_test.go b/internal/alloy/alloy_services_test.go similarity index 100% rename from internal/alloy/flow_services_test.go rename to internal/alloy/alloy_services_test.go diff --git a/internal/alloy/flow_test.go b/internal/alloy/alloy_test.go similarity index 100% rename from internal/alloy/flow_test.go rename to internal/alloy/alloy_test.go diff --git a/internal/alloy/flow_updates_test.go b/internal/alloy/alloy_updates_test.go similarity index 100% rename from internal/alloy/flow_updates_test.go rename to internal/alloy/alloy_updates_test.go