| 1 | [# Jinja template: integrations/templates/setup-service_discovery.md |
| 2 | Closely mirrors setup-secretstore.md but for SD discoverers. |
| 3 | The 'via File' section explicitly notes the dual-block (`discoverer:` + `services:`) |
| 4 | structure and points readers forward to the Service Rules section. #] |
| 5 | ## Setup |
| 6 | |
| 7 | You can configure the `[[ entry.meta.kind ]]` discoverer in two ways: |
| 8 | |
| 9 | | Method | Best for | How to | |
| 10 | |:--|:--|:--| |
| 11 | | [**UI**](#via-ui) | Fast setup without editing files | Go to `Collectors -> go.d -> ServiceDiscovery -> [[ entry.meta.kind ]]`, then add a discovery pipeline. | |
| 12 | | [**File**](#via-file) | File-based configuration or automation | Edit `/etc/netdata/[[ entry.setup.configuration.file.name ]]` and define the `discoverer:` and `services:` blocks. | |
| 13 | |
| 14 | ### Prerequisites |
| 15 | [% if entry.setup.prerequisites.list %] |
| 16 | |
| 17 | [% for prereq in entry.setup.prerequisites.list %] |
| 18 | #### [[ prereq.title ]] |
| 19 | |
| 20 | [[ prereq.description ]] |
| 21 | |
| 22 | [% endfor %] |
| 23 | [% else %] |
| 24 | |
| 25 | No action required. |
| 26 | |
| 27 | [% endif %] |
| 28 | ### Configuration |
| 29 | |
| 30 | #### Options |
| 31 | |
| 32 | [[ entry.setup.configuration.options.description ]] |
| 33 | |
| 34 | [% if entry.setup.configuration.options.list %] |
| 35 | [% if entry.setup.configuration.options.folding.enabled and not clean %] |
| 36 | {% details open=true summary="[[ entry.setup.configuration.options.folding.title or 'Discoverer options' ]]" %} |
| 37 | [% endif %] |
| 38 | |
| 39 | | Option | Description | Default | Required | |
| 40 | |:-----|:------------|:--------|:---------:| |
| 41 | [% for item in entry.setup.configuration.options.list %] |
| 42 | [% set item_anchor = "option-" ~ anchorfy(item.name) %] |
| 43 | | [[ ("[" ~ strfy(item.name) ~ "](#" ~ item_anchor ~ ")") if ('detailed_description' in item) else strfy(item.name) ]] | [[ strfy(item.description) ]] | [[ strfy(item.default_value) ]] | [[ strfy(item.required) ]] | |
| 44 | [% endfor %] |
| 45 | |
| 46 | [% for item in entry.setup.configuration.options.list %] |
| 47 | [% if 'detailed_description' in item %] |
| 48 | <a id="[[ "option-" ~ anchorfy(item.name) ]]"></a> |
| 49 | ##### [[ item.name ]] |
| 50 | |
| 51 | [[ item.detailed_description ]] |
| 52 | |
| 53 | [% endif %] |
| 54 | [% endfor %] |
| 55 | |
| 56 | [% if entry.setup.configuration.options.folding.enabled and not clean %] |
| 57 | {% /details %} |
| 58 | [% endif %] |
| 59 | [% else %] |
| 60 | There are no configuration options. |
| 61 | |
| 62 | [% endif %] |
| 63 | |
| 64 | #### via UI |
| 65 | |
| 66 | 1. Open the Netdata Dynamic Configuration UI. |
| 67 | 2. Go to `Collectors -> go.d -> ServiceDiscovery -> [[ entry.meta.kind ]]`. |
| 68 | 3. Add a new discovery pipeline and give it a name. |
| 69 | 4. Fill in the discoverer-specific settings and the service rules. |
| 70 | 5. Save the discovery pipeline. |
| 71 | |
| 72 | #### via File |
| 73 | |
| 74 | Define the discovery pipeline in `/etc/netdata/[[ entry.setup.configuration.file.name ]]`. |
| 75 | |
| 76 | The file has two top-level blocks: `discoverer:` (the options above) and `services:` (rules that turn discovered targets into collector jobs — see [Service Rules](#service-rules)). |
| 77 | |
| 78 | After editing the file, restart the Netdata Agent to load the updated discovery pipeline. |
| 79 | |
| 80 | ##### Examples |
| 81 | [% if entry.setup.configuration.examples.list %] |
| 82 | |
| 83 | [% for example in entry.setup.configuration.examples.list %] |
| 84 | ###### [[ example.name ]] |
| 85 | |
| 86 | [[ example.description ]] |
| 87 | |
| 88 | [% if example.folding is defined and example.folding.enabled and not clean %] |
| 89 | {% details open=true summary="[[ entry.setup.configuration.examples.folding.title or 'Example configuration' ]]" %} |
| 90 | [% endif %] |
| 91 | ```yaml |
| 92 | [[ example.config ]] |
| 93 | ``` |
| 94 | [% if example.folding is defined and example.folding.enabled and not clean %] |
| 95 | {% /details %} |
| 96 | [% endif %] |
| 97 | [% endfor %] |
| 98 | [% else %] |
| 99 | There are no configuration examples. |
| 100 | |
| 101 | [% endif %] |