diff --git a/docs/sources/concepts/modules.md b/docs/sources/concepts/modules.md index 37853be78f..fb0bf2abe6 100644 --- a/docs/sources/concepts/modules.md +++ b/docs/sources/concepts/modules.md @@ -98,142 +98,6 @@ loki.write "default" { } ``` -{{< collapse title="Classic modules" >}} -# Classic modules (deprecated) - -{{< admonition type="caution" >}} -Modules were redesigned in v0.40 to simplify concepts. -This section outlines the design of the original modules prior to v0.40. -Classic modules are scheduled to be removed in the release after v0.40. -{{< /admonition >}} - -You use _Modules_ to create {{< param "PRODUCT_NAME" >}} configurations that you can load as a component. -Modules are a great way to parameterize a configuration to create reusable pipelines. - -Modules are {{< param "PRODUCT_NAME" >}} configurations which have: - -* _Arguments_: Settings that configure a module. -* _Exports_: Named values that a module exposes to the consumer of the module. -* _Components_: {{< param "PRODUCT_NAME" >}} components to run when the module is running. - -You use a [Module loader][] to load Modules into {{< param "PRODUCT_NAME" >}}. - -Refer to [argument block][] and [export block][] to learn how to define arguments and exports for a module. - -## Module loaders - -A _Module loader_ is a {{< param "PRODUCT_NAME" >}} component that retrieves a module and runs the defined components. - -Module loader components are responsible for the following functions: - -* Retrieving the module source. -* Creating a [Component controller][] for the module. -* Passing arguments to the loaded module. -* Exposing exports from the loaded module. - -Module loaders are typically called `module.LOADER_NAME`. - -{{< admonition type="note" >}} -Some module loaders may not support running modules with arguments or exports. -{{< /admonition >}} - -Refer to [Components][] for more information about the module loader components. - -## Module sources - -Modules are flexible, and you can retrieve their configuration anywhere, such as: - -* The local filesystem. -* An S3 bucket. -* An HTTP endpoint. - -Each module loader component supports different ways of retrieving `module.sources`. -The most generic module loader component, `module.string`, can load modules from the export of another {{< param "PRODUCT_NAME" >}} component. - -```river -local.file "my_module" { - filename = "PATH_TO_MODULE" -} - -module.string "my_module" { - content = local.file.my_module.content - - arguments { - MODULE_ARGUMENT_NAME_1 = MODULE_ARGUMENT_VALUE_1 - MODULE_ARGUMENT_NAME_2 = MODULE_ARGUMENT_VALUE_2 - // ... - } -} -``` - -## Example module - -This example module manages a pipeline that filters out debug-level and info-level log lines. - -```river -// argument.write_to is a required argument that specifies where filtered -// log lines are sent. -// -// The value of the argument is retrieved in this file with -// argument.write_to.value. -argument "write_to" { - optional = false -} - -// loki.process.filter is our component which executes the filtering, passing -// filtered logs to argument.write_to.value. -loki.process "filter" { - // Drop all debug- and info-level logs. - stage.match { - selector = "{job!=\"\"} |~ \"level=(debug|info)\"" - action = "drop" - } - - // Send processed logs to our argument. - forward_to = argument.write_to.value -} - -// export.filter_input exports a value to the module consumer. -export "filter_input" { - // Expose the receiver of loki.process so the module consumer can send - // logs to our loki.process component. - value = loki.process.filter.receiver -} -``` - -You can save the module to a file and then use it as a processing step before writing logs to Loki. - -```river -loki.source.file "self" { - targets = LOG_TARGETS - - // Forward collected logs to the input of our filter. - forward_to = [module.file.log_filter.exports.filter_input] -} - -module.file "log_filter" { - filename = "/path/to/modules/log_filter.river" - - arguments { - // Configure the filter to forward filtered logs to loki.write below. - write_to = [loki.write.default.receiver], - } -} - -loki.write "default" { - endpoint { - url = "LOKI_URL" - } -} -``` - -[Module loader]: #module-loaders -[argument block]: ../../reference/config-blocks/argument/ -[export block]: ../../reference/config-blocks/export/ -[Component controller]: ../component_controller/ -[Components]: ../../reference/components/ -{{< /collapse >}} - [custom components]: ../custom_components/ [run]: ../../reference/cli/run/ [import.file]: ../../reference/config-blocks/import.file/ diff --git a/docs/sources/reference/components/module.file.md b/docs/sources/reference/components/module.file.md deleted file mode 100644 index 78dc24e8ad..0000000000 --- a/docs/sources/reference/components/module.file.md +++ /dev/null @@ -1,159 +0,0 @@ ---- -canonical: https://grafana.com/docs/alloy/latest/reference/components/module.file/ -description: Learn about module.file -labels: - stage: beta -title: module.file ---- - -# module.file - -{{< docs/shared lookup="stability/beta.md" source="alloy" version="" >}} - -`module.file` is a *module loader* component. A module loader is a {{< param "PRODUCT_NAME" >}} -component which retrieves a [module][] and runs the components defined inside of it. - -`module.file` simplifies the configurations for modules loaded from a file by embedding -a [local.file][] component. This allows a single module loader to do the equivalence of -using the more generic [module.string][] paired with a [local.file][] component. - -[module]: ../../../concepts/modules/ -[local.file]: ../local.file/ -[module.string]: ../module.string/ - -## Usage - -```river -module.file "LABEL" { - filename = FILENAME - - arguments { - MODULE_ARGUMENT_1 = VALUE_1 - MODULE_ARGUMENT_2 = VALUE_2 - ... - } -} -``` - -## Arguments - -The following arguments are supported: - -Name | Type | Description | Default | Required ------------------|------------|----------------------------------------------------|--------------|--------- -`filename` | `string` | Path of the file on disk to watch | | yes -`detector` | `string` | Which file change detector to use (fsnotify, poll) | `"fsnotify"` | no -`poll_frequency` | `duration` | How often to poll for file changes | `"1m"` | no -`is_secret` | `bool` | Marks the file as containing a [secret][] | `false` | no - -[secret]: ../../../concepts/config-language/expressions/types_and_values/#secrets - -{{< docs/shared lookup="reference/components/local-file-arguments-text.md" source="alloy" version="" >}} - -## Blocks - -The following blocks are supported inside the definition of `module.file`: - -Hierarchy | Block | Description | Required -----------|---------------|----------------------------------|--------- -arguments | [arguments][] | Arguments to pass to the module. | no - -[arguments]: #arguments-block - -### arguments block - -The `arguments` block specifies the list of values to pass to the loaded -module. - -The attributes provided in the `arguments` block are validated based on the -[argument blocks][] defined in the module source: - -* If a module source marks one of its arguments as required, it must be - provided as an attribute in the `arguments` block of the module loader. - -* Attributes in the `argument` block of the module loader will be rejected if - they are not defined in the module source. - -[argument blocks]: ../../config-blocks/argument/ - -## Exported fields - -The following fields are exported and can be referenced by other components: - -Name | Type | Description -----------|------------|---------------------------------- -`exports` | `map(any)` | The exports of the Module loader. - -`exports` exposes the `export` config block inside a module. It can be accessed -from the parent config via `module.file.LABEL.exports.EXPORT_LABEL`. - -Values in `exports` correspond to [export blocks][] defined in the module source. - -[export blocks]: ../../config-blocks/export/ - -## Component health - -`module.file` is reported as healthy if the most recent load of the module was -successful. - -If the module is not loaded successfully, the current health displays as -unhealthy and the health includes the error from loading the module. - -## Debug information - -`module.file` does not expose any component-specific debug information. - -## Debug metrics - -`module.file` does not expose any component-specific debug metrics. - -## Example - -In this example, we pass credentials from a parent config to a module which loads -a `prometheus.remote_write` component. The exports of the -`prometheus.remote_write` component are exposed to parent config, allowing -the parent config to pass metrics to it. - -Parent: - -```river -module.file "metrics" { - filename = "/path/to/prometheus_remote_write_module.river" - - arguments { - username = env("PROMETHEUS_USERNAME") - password = env("PROMETHEUS_PASSWORD") - } -} - -prometheus.exporter.unix "default" { } - -prometheus.scrape "local_agent" { - targets = prometheus.exporter.unix.default.targets - forward_to = [module.file.metrics.exports.prometheus_remote_write.receiver] - scrape_interval = "10s" -} -``` - -Module: - -```river -argument "username" { } - -argument "password" { } - -export "prometheus_remote_write" { - value = prometheus.remote_write.grafana_cloud -} - -prometheus.remote_write "grafana_cloud" { - endpoint { - url = "https://prometheus-us-central1.grafana.net/api/prom/push" - - basic_auth { - username = argument.username.value - password = argument.password.value - } - } -} -``` diff --git a/docs/sources/reference/components/module.git.md b/docs/sources/reference/components/module.git.md deleted file mode 100644 index a0a821a008..0000000000 --- a/docs/sources/reference/components/module.git.md +++ /dev/null @@ -1,212 +0,0 @@ ---- -canonical: https://grafana.com/docs/alloy/latest/reference/components/module.git/ -description: Learn about module.git -labels: - stage: beta -title: module.git ---- - -# module.git - -{{< docs/shared lookup="stability/beta.md" source="alloy" version="" >}} - -`module.git` is a *module loader* component. A module loader is a {{< param "PRODUCT_NAME" >}} -component which retrieves a [module][] and runs the components defined inside of it. - -`module.git` retrieves a module source from a file in a Git repository. - -[module]: ../../../concepts/modules/ - -## Usage - -```river -module.git "LABEL" { - repository = "GIT_REPOSTORY" - path = "PATH_TO_MODULE" - - arguments { - MODULE_ARGUMENT_1 = VALUE_1 - MODULE_ARGUMENT_2 = VALUE_2 - ... - } -} -``` - -## Arguments - -The following arguments are supported: - -Name | Type | Description | Default | Required ------------------|------------|---------------------------------------------------------|----------|--------- -`repository` | `string` | The Git repository address to retrieve the module from. | | yes -`revision` | `string` | The Git revision to retrieve the module from. | `"HEAD"` | no -`path` | `string` | The path in the repository where the module is stored. | | yes -`pull_frequency` | `duration` | The frequency to pull the repository for updates. | `"60s"` | no - -The `repository` attribute must be set to a repository address that would be -recognized by Git with a `git clone REPOSITORY_ADDRESS` command, such as -`htts://github.com/grafana/agent.git`. - -The `revision` attribute, when provided, must be set to a valid branch, tag, or -commit SHA within the repository. - -The `path` attribute must be set to a path which is accessible from the root of -the repository, such as `FILE_NAME.river` or `FOLDER_NAME/FILE_NAME.river`. - -If `pull_frequency` is not `"0s"`, the Git repository will be pulled for -updates at the frequency specified, causing the loaded module to update with -the retrieved changes. - -## Blocks - -The following blocks are supported inside the definition of `module.git`: - -Hierarchy | Block | Description | Required ------------|----------------|------------------------------------------------------|--------- -basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the repo. | no -ssh_key | [ssh_key][] | Configure a SSH Key for authenticating to the repo. | no -arguments | [arguments][] | Arguments to pass to the module. | no - -[basic_auth]: #basic_auth-block -[ssh_key]: #ssh_key-block -[arguments]: #arguments-block - -### basic_auth block - -{{< docs/shared lookup="reference/components/basic-auth-block.md" source="alloy" version="" >}} - -### ssh_key block - -Name | Type | Description | Default | Required --------------|----------|-----------------------------------|---------|--------- -`username` | `string` | SSH username. | | yes -`key` | `secret` | SSH private key | | no -`key_file` | `string` | SSH private key path. | | no -`passphrase` | `secret` | Passphrase for SSH key if needed. | | no - -### arguments block - -The `arguments` block specifies the list of values to pass to the loaded -module. - -The attributes provided in the `arguments` block are validated based on the -[argument blocks][] defined in the module source: - -* If a module source marks one of its arguments as required, it must be - provided as an attribute in the `arguments` block of the module loader. - -* Attributes in the `argument` block of the module loader will be rejected if - they are not defined in the module source. - -[argument blocks]: ../../config-blocks/argument/ - -## Exported fields - -The following fields are exported and can be referenced by other components: - -Name | Type | Description -----------|------------|---------------------------------- -`exports` | `map(any)` | The exports of the Module loader. - -`exports` exposes the `export` config block inside a module. It can be accessed -from the parent config via `module.git.COMPONENT_LABEL.exports.EXPORT_LABEL`. - -Values in `exports` correspond to [export blocks][] defined in the module -source. - -[export blocks]: ../../config-blocks/export/ - -## Component health - -`module.git` is reported as healthy if the repository was cloned successfully -and most recent load of the module was successful. - -## Debug information - -`module.git` includes debug information for: - -* The full SHA of the currently checked out revision. -* The most recent error when trying to fetch the repository, if any. - -## Debug metrics - -`module.git` does not expose any component-specific debug metrics. - -## Examples - -This example uses a module loaded from a Git repository which adds two numbers: - -```river -module.git "add" { - repository = "https://github.com/rfratto/agent-modules.git" - revision = "main" - path = "add/module.river" - - arguments { - a = 15 - b = 45 - } -} -``` - -The same example as above using basic auth: -```river -module.git "add" { - repository = "https://github.com/rfratto/agent-modules.git" - revision = "main" - path = "add/module.river" - - basic_auth { - username = "USERNAME" - password = "PASSWORD" - } - - arguments { - a = 15 - b = 45 - } -} -``` - -Using SSH Key from another component: -```river -local.file "ssh_key" { - filename = "PATH/TO/SSH.KEY" - is_secret = true -} - -module.git "add" { - repository = "github.com:rfratto/agent-modules.git" - revision = "main" - path = "add/module.river" - - ssh_key { - username = "git" - key = local.file.ssh_key.content - } - - arguments { - a = 15 - b = 45 - } -} -``` - -The same example as above using SSH Key auth: -```river -module.git "add" { - repository = "github.com:rfratto/agent-modules.git" - revision = "main" - path = "add/module.river" - - ssh_key { - username = "git" - key_file = "PATH/TO/SSH.KEY" - } - - arguments { - a = 15 - b = 45 - } -} -``` diff --git a/docs/sources/reference/components/module.http.md b/docs/sources/reference/components/module.http.md deleted file mode 100644 index b0ccdf67b6..0000000000 --- a/docs/sources/reference/components/module.http.md +++ /dev/null @@ -1,167 +0,0 @@ ---- -canonical: https://grafana.com/docs/alloy/latest/reference/components/module.http/ -description: Learn about module.http -labels: - stage: beta -title: module.http ---- - -# module.http - -{{< docs/shared lookup="stability/beta.md" source="alloy" version="" >}} - -`module.http` is a [module loader][] component. - -`module.http` embeds a [remote.http][] component to retrieve the module from a remote -HTTP server. This allows you to use a single module loader, rather than a `remote.http` -component paired with a [module.string][] component. - -[module]: ../../../concepts/modules/ -[remote.http]: ../remote.http/ -[module.string]: ../module.string/ -[module loader]: ../../../concepts/modules/#module-loaders - -## Usage - -```river -module.http "LABEL" { - url = URL - - arguments { - MODULE_ARGUMENT_1 = VALUE_1 - ... - } -} -``` - -## Arguments - -The following arguments are supported: - -Name | Type | Description | Default | Required ------------------|---------------|--------------------------------------------------------------|---------|--------- -`url` | `string` | URL to poll. | | yes -`method` | `string` | Define HTTP method for the request | `"GET"` | no -`headers` | `map(string)` | Custom headers for the request. | `{}` | no -`poll_frequency` | `duration` | Frequency to poll the URL. | `"1m"` | no -`poll_timeout` | `duration` | Timeout when polling the URL. | `"10s"` | no -`is_secret` | `bool` | Whether the response body should be treated as a [secret][]. | false | no - -[secret]: ../../../concepts/config-language/expressions/types_and_values/#secrets - -## Blocks - -The following blocks are supported inside the definition of `module.http`: - -Hierarchy | Block | Description | Required -----------|---------------|----------------------------------|--------- -arguments | [arguments][] | Arguments to pass to the module. | no - -[arguments]: #arguments-block - -### arguments block - -The `arguments` block specifies the list of values to pass to the loaded -module. - -The attributes provided in the `arguments` block are validated based on the -[argument blocks][] defined in the module source: - -* If a module source marks one of its arguments as required, it must be - provided as an attribute in the `arguments` block of the module loader. - -* Attributes in the `argument` block of the module loader are rejected if - they are not defined in the module source. - -[argument blocks]: ../../config-blocks/argument/ - -## Exported fields - -The following fields are exported and can be referenced by other components: - -Name | Type | Description -----------|------------|---------------------------------- -`exports` | `map(any)` | The exports of the Module loader. - -`exports` exposes the `export` config block inside a module. It can be accessed -from the parent config via `module.http.LABEL.exports.EXPORT_LABEL`. - -Values in `exports` correspond to [export blocks][] defined in the module -source. - -[export blocks]: ../../config-blocks/export/ - -## Component health - -`module.http` is reported as healthy if the most recent load of the module was -successful. - -Before the first load of the module, the health is reported as `Unknown`. - -If the module is not loaded successfully, the current health displays as -unhealthy, and the health includes the error from loading the module. - -## Debug information - -`module.http` does not expose any component-specific debug information. - -## Debug metrics - -`module.http` does not expose any component-specific debug metrics. - -## Example - -In this example, the `module.http` component loads a module from a locally running -HTTP server, polling for changes once every minute. - -The module sets up a Redis exporter and exports the list of targets to the parent config to scrape -and remote write. - - -Parent: - -```river -module.http "remote_module" { - url = "http://localhost:8080/redis_module.yaml" - poll_frequency = "1m" -} - -prometheus.exporter.unix "default" { } - -prometheus.scrape "local_agent" { - targets = concat(prometheus.exporter.unix.default.targets, module.http.remote_module.exports.targets) - forward_to = [module.http.metrics.exports.prometheus_remote_write.receiver] - scrape_interval = "10s" -} - -prometheus.remote_write "default" { - endpoint { - url = PROMETHEUS_REMOTE_WRITE_URL - - basic_auth { - username = USERNAME - password = PASSWORD - } - } -} -``` -Replace the following: - - `PROMETHEUS_REMOTE_WRITE_URL`: The URL of the Prometheus remote_write-compatible server to send metrics to. - - `USERNAME`: The username to use for authentication to the remote_write API. - - `PASSWORD`: The password to use for authentication to the remote_write API. - -Module: - -```river -prometheus.exporter.redis "local_redis" { - redis_addr = REDIS_ADDR - redis_password_file = REDIS_PASSWORD_FILE -} - -export "redis_targets" { - value = prometheus.exporter.redis.local_redis.targets -} -``` -Replace the following: - - `REDIS_ADDR`: The address of your Redis instance. - - `REDIS_PASSWORD_FILE`: The path to a file containing the password for your Redis instance. diff --git a/docs/sources/reference/components/module.string.md b/docs/sources/reference/components/module.string.md deleted file mode 100644 index ee4fbd2a8d..0000000000 --- a/docs/sources/reference/components/module.string.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -canonical: https://grafana.com/docs/alloy/latest/reference/components/module.string/ -description: Learn about module.string -labels: - stage: beta -title: module.string ---- - -# module.string - -{{< docs/shared lookup="stability/beta.md" source="alloy" version="" >}} - -`module.string` is a *module loader* component. A module loader is a {{< param "PRODUCT_NAME" >}} -component which retrieves a [module][] and runs the components defined inside of it. - -[module]: ../../../concepts/modules/ - -## Usage - -```river -module.string "LABEL" { - content = CONTENT - - arguments { - MODULE_ARGUMENT_1 = VALUE_1 - MODULE_ARGUMENT_2 = VALUE_2 - ... - } -} -``` - -## Arguments - -The following arguments are supported: - -Name | Type | Description | Default | Required -----------|----------------------|-----------------------------------------------------------|---------|--------- -`content` | `secret` or `string` | The contents of the module to load as a secret or string. | | yes - -`content` is a string that contains the configuration of the module to load. -`content` is typically loaded by using the exports of another component. For example, - -- `local.file.LABEL.content` -- `remote.http.LABEL.content` -- `remote.s3.LABEL.content` - -## Blocks - -The following blocks are supported inside the definition of `module.string`: - -Hierarchy | Block | Description | Required -----------|---------------|----------------------------------|--------- -arguments | [arguments][] | Arguments to pass to the module. | no - -[arguments]: #arguments-block - -### arguments block - -The `arguments` block specifies the list of values to pass to the loaded -module. - -The attributes provided in the `arguments` block are validated based on the -[argument blocks][] defined in the module source: - -* If a module source marks one of its arguments as required, it must be - provided as an attribute in the `arguments` block of the module loader. - -* Attributes in the `argument` block of the module loader will be rejected if - they are not defined in the module source. - -[argument blocks]: ../../config-blocks/argument/ - -## Exported fields - -The following fields are exported and can be referenced by other components: - -Name | Type | Description -----------|------------|---------------------------------- -`exports` | `map(any)` | The exports of the Module loader. - -`exports` exposes the `export` config block inside a module. It can be accessed -from the parent config via `module.string.LABEL.exports.EXPORT_LABEL`. - -Values in `exports` correspond to [export blocks][] defined in the module -source. - -[export blocks]: ../../config-blocks/export/ - -## Component health - -`module.string` is reported as healthy if the most recent load of the module was -successful. - -If the module is not loaded successfully, the current health displays as -unhealthy and the health includes the error from loading the module. - -## Debug information - -`module.string` does not expose any component-specific debug information. - -## Debug metrics - -`module.string` does not expose any component-specific debug metrics. - -## Example - -In this example, we pass credentials from a parent config to a module which loads -a `prometheus.remote_write` component. The exports of the -`prometheus.remote_write` component are exposed to parent config, allowing -the parent config to pass metrics to it. - -Parent: - -```river -local.file "metrics" { - filename = "/path/to/prometheus_remote_write_module.river" -} - -module.string "metrics" { - content = local.file.metrics.content - - arguments { - username = env("PROMETHEUS_USERNAME") - password = env("PROMETHEUS_PASSWORD") - } -} - -prometheus.exporter.unix "default" { } - -prometheus.scrape "local_agent" { - targets = prometheus.exporter.unix.default.targets - forward_to = [module.string.metrics.exports.prometheus_remote_write.receiver] - scrape_interval = "10s" -} -``` - -Module: - -```river -argument "username" { } - -argument "password" { } - -export "prometheus_remote_write" { - value = prometheus.remote_write.grafana_cloud -} - -prometheus.remote_write "grafana_cloud" { - endpoint { - url = "https://prometheus-us-central1.grafana.net/api/prom/push" - - basic_auth { - username = argument.username.value - password = argument.password.value - } - } -} -``` diff --git a/docs/sources/reference/config-blocks/argument.md b/docs/sources/reference/config-blocks/argument.md index ff265c9e31..56676ee6f7 100644 --- a/docs/sources/reference/config-blocks/argument.md +++ b/docs/sources/reference/config-blocks/argument.md @@ -14,13 +14,6 @@ title: argument block The `argument` block may only be specified inside the definition of [a `declare` block][declare]. -{{< admonition type="note" >}} -In [classic modules][], the `argument` block is valid as a top-level block in a classic module. -Classic modules are deprecated and scheduled to be removed in the release after v0.40. - -[classic modules]: ../../../concepts/modules/#classic-modules-deprecated -{{< /admonition >}} - ## Example ```river diff --git a/docs/sources/reference/config-blocks/export.md b/docs/sources/reference/config-blocks/export.md index 4b28a6497d..72d365be27 100644 --- a/docs/sources/reference/config-blocks/export.md +++ b/docs/sources/reference/config-blocks/export.md @@ -14,13 +14,6 @@ title: export block The `export` block may only be specified inside the definition of [a `declare` block][declare]. -{{< admonition type="note" >}} -In [classic modules][], the `export` block is valid as a top-level block in a classic module. -Classic modules are deprecated and scheduled to be removed in the release after v0.40. - -[classic modules]: ../../../concepts/modules/#classic-modules-deprecated -{{< /admonition >}} - ## Example ```river diff --git a/internal/component/all/all.go b/internal/component/all/all.go index f6911eb95b..7cc147ea80 100644 --- a/internal/component/all/all.go +++ b/internal/component/all/all.go @@ -57,10 +57,6 @@ import ( _ "github.com/grafana/agent/internal/component/loki/source/windowsevent" // Import loki.source.windowsevent _ "github.com/grafana/agent/internal/component/loki/write" // Import loki.write _ "github.com/grafana/agent/internal/component/mimir/rules/kubernetes" // Import mimir.rules.kubernetes - _ "github.com/grafana/agent/internal/component/module/file" // Import module.file - _ "github.com/grafana/agent/internal/component/module/git" // Import module.git - _ "github.com/grafana/agent/internal/component/module/http" // Import module.http - _ "github.com/grafana/agent/internal/component/module/string" // Import module.string _ "github.com/grafana/agent/internal/component/otelcol/auth/basic" // Import otelcol.auth.basic _ "github.com/grafana/agent/internal/component/otelcol/auth/bearer" // Import otelcol.auth.bearer _ "github.com/grafana/agent/internal/component/otelcol/auth/headers" // Import otelcol.auth.headers diff --git a/internal/flow/componenttest/testfailmodule.go b/internal/flow/componenttest/testfailmodule.go index 297579880b..b5f4de1757 100644 --- a/internal/flow/componenttest/testfailmodule.go +++ b/internal/flow/componenttest/testfailmodule.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/grafana/agent/internal/component" - mod "github.com/grafana/agent/internal/component/module" "github.com/grafana/agent/internal/featuregate" + mod "github.com/grafana/agent/internal/flow/internal/testcomponents/module" ) func init() { diff --git a/internal/flow/import_test.go b/internal/flow/import_test.go index 65642605f4..e70e498af2 100644 --- a/internal/flow/import_test.go +++ b/internal/flow/import_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/tools/txtar" - _ "github.com/grafana/agent/internal/component/module/string" + _ "github.com/grafana/agent/internal/flow/internal/testcomponents/module/string" ) // The tests are using the .txtar files stored in the testdata folder. diff --git a/internal/component/module/file/file.go b/internal/flow/internal/testcomponents/module/file/file.go similarity index 98% rename from internal/component/module/file/file.go rename to internal/flow/internal/testcomponents/module/file/file.go index 7c0ec3dd11..89e6f23f7d 100644 --- a/internal/component/module/file/file.go +++ b/internal/flow/internal/testcomponents/module/file/file.go @@ -8,8 +8,8 @@ import ( "github.com/grafana/agent/internal/component" "github.com/grafana/agent/internal/component/local/file" - "github.com/grafana/agent/internal/component/module" "github.com/grafana/agent/internal/featuregate" + "github.com/grafana/agent/internal/flow/internal/testcomponents/module" "github.com/grafana/river/rivertypes" ) diff --git a/internal/component/module/git/git.go b/internal/flow/internal/testcomponents/module/git/git.go similarity index 98% rename from internal/component/module/git/git.go rename to internal/flow/internal/testcomponents/module/git/git.go index b1a363b4da..2a57a21278 100644 --- a/internal/component/module/git/git.go +++ b/internal/flow/internal/testcomponents/module/git/git.go @@ -11,8 +11,8 @@ import ( "github.com/go-kit/log" "github.com/grafana/agent/internal/component" - "github.com/grafana/agent/internal/component/module" "github.com/grafana/agent/internal/featuregate" + "github.com/grafana/agent/internal/flow/internal/testcomponents/module" "github.com/grafana/agent/internal/flow/logging/level" "github.com/grafana/agent/internal/vcs" ) diff --git a/internal/component/module/http/http.go b/internal/flow/internal/testcomponents/module/http/http.go similarity index 98% rename from internal/component/module/http/http.go rename to internal/flow/internal/testcomponents/module/http/http.go index af33860f60..04ca9043f8 100644 --- a/internal/component/module/http/http.go +++ b/internal/flow/internal/testcomponents/module/http/http.go @@ -7,9 +7,9 @@ import ( "go.uber.org/atomic" "github.com/grafana/agent/internal/component" - "github.com/grafana/agent/internal/component/module" remote_http "github.com/grafana/agent/internal/component/remote/http" "github.com/grafana/agent/internal/featuregate" + "github.com/grafana/agent/internal/flow/internal/testcomponents/module" "github.com/grafana/river/rivertypes" ) diff --git a/internal/component/module/module.go b/internal/flow/internal/testcomponents/module/module.go similarity index 100% rename from internal/component/module/module.go rename to internal/flow/internal/testcomponents/module/module.go diff --git a/internal/component/module/string/string.go b/internal/flow/internal/testcomponents/module/string/string.go similarity index 96% rename from internal/component/module/string/string.go rename to internal/flow/internal/testcomponents/module/string/string.go index e631c2646b..6a51c5cedb 100644 --- a/internal/component/module/string/string.go +++ b/internal/flow/internal/testcomponents/module/string/string.go @@ -4,8 +4,8 @@ import ( "context" "github.com/grafana/agent/internal/component" - "github.com/grafana/agent/internal/component/module" "github.com/grafana/agent/internal/featuregate" + "github.com/grafana/agent/internal/flow/internal/testcomponents/module" "github.com/grafana/river/rivertypes" ) diff --git a/internal/flow/module_eval_test.go b/internal/flow/module_eval_test.go index 94b811b423..4447fa530f 100644 --- a/internal/flow/module_eval_test.go +++ b/internal/flow/module_eval_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - _ "github.com/grafana/agent/internal/component/module/string" + _ "github.com/grafana/agent/internal/flow/internal/testcomponents/module/string" ) func TestUpdates_EmptyModule(t *testing.T) {