From dcd3f5134284557d8d4ee5a3363b609a20b4b010 Mon Sep 17 00:00:00 2001 From: William Dumont Date: Thu, 29 Aug 2024 19:43:11 +0200 Subject: [PATCH] Add warning in modules doc (#1581) Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> --- docs/sources/get-started/modules.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/sources/get-started/modules.md b/docs/sources/get-started/modules.md index 9843a2f1f0..be23b97fe3 100644 --- a/docs/sources/get-started/modules.md +++ b/docs/sources/get-started/modules.md @@ -34,6 +34,11 @@ For example, if a configuration contains a block called `import.file "my_module" If an import namespace matches the name of a built-in component namespace, such as `prometheus`, the built-in namespace is hidden from the importing module, and only components defined in the imported module may be used. +{{< admonition type="warning" >}} +If you choose a label that corresponds to an existing component for an `import` or a `declare` block, the component will be shadowed and you won't be able to use it in your configuration. +For example, if you use the label `import.file "mimir"`, you won't be able to use the existing components that start with `mimir` such as `mimir.rules.kubernetes` because it refers to the module imported via the `import` block. +{{< /admonition >}} + ## Example This example module defines a component to filter out debug-level and info-level log lines: