## ===================================================================
## WARNING: HTTP DISCOVERY IS DISABLED BY DEFAULT
## To enable, change "disabled: yes" to "disabled: no" below
## AND configure the endpoint and service rules for your environment.
## ===================================================================

disabled: yes

discoverer:
  http:
    ## HTTP endpoint that returns either:
    ##   - a bare array: [ ... ]
    ##   - an envelope: { "items": [ ... ] }
    #url: "https://example.com/netdata/go.d/jobs.yaml"

    ## How often to fetch the endpoint (default: 1m).
    ## Set to 0 for a one-shot fetch. One-shot mode fetches once when this
    ## SD pipeline starts; it does not refetch on SD reload unless the pipeline
    ## itself is recreated.
    #interval: "1m"

    ## Response format: auto, json, or yaml (default: auto).
    ## Auto uses Content-Type when clear, then tries JSON before YAML.
    #format: auto

    ## Standard HTTP options from go.d collectors are supported.
    #headers:
    #  Accept: application/yaml
    #username: ""
    #password: ""

    ## If bearer_token_file points under /var/run/secrets/ and Netdata is not
    ## running in Kubernetes, missing token files are ignored.
    #bearer_token_file: ""

    #timeout: "2s"
    #proxy_url: ""
    #tls_skip_verify: no

services:
  ## Full job pass-through. The fetched item must already be a go.d job config.
  ## Pass-through items must include both name and module. The module is the
  ## collector name, for example httpcheck, ping, or nginx.
  ## `toYaml` serializes the decoded item to YAML for config_template parsing.
  ## `.Item` is remote response data; `.TUID` and `.Hash` are target methods and
  ## do not interact with same-named keys inside `.Item`.
  - id: "passthrough"
    match: '{{ true }}'
    config_template: |
      {{ .Item | toYaml }}

  ## Example for an array of endpoint strings:
  ##   items:
  ##     - "https://example.com/health"
  ##
  ## - id: "httpcheck"
  ##   # Because id is httpcheck, module may be omitted from this curated rule.
  ##   match: '{{ kindIs "string" .Item }}'
  ##   config_template: |
  ##     name: {{ .TUID }}
  ##     url: {{ .Item }}

  ## Example for an array of endpoint objects:
  ##   items:
  ##     - name: "api"
  ##       url: "https://api.example.com/health"
  ##
  ## - id: "httpcheck"
  ##   # Because id is httpcheck, module may be omitted from this curated rule.
  ##   match: '{{ and (kindIs "map" .Item) (hasKey .Item "url") }}'
  ##   config_template: |
  ##     name: {{ .Item.name }}
  ##     url: {{ .Item.url }}
