diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f969b21822e..3eaf907b2390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -193,6 +193,8 @@ v0.39.0 (2024-01-09) - `loki.source.docker` now deduplicates targets which report the same container ID. (@tpaschalis) +- Added support for NS records to `discovery.dns`. (@djcode) + ### Bugfixes - Update `pyroscope.ebpf` to fix a logical bug causing to profile to many kthreads instead of regular processes https://github.com/grafana/pyroscope/pull/2778 (@korniltsev) diff --git a/component/discovery/dns/dns.go b/component/discovery/dns/dns.go index 1563f116075c..a86e44d8df6e 100644 --- a/component/discovery/dns/dns.go +++ b/component/discovery/dns/dns.go @@ -46,7 +46,7 @@ func (args *Arguments) SetToDefault() { func (args *Arguments) Validate() error { switch strings.ToUpper(args.Type) { case "SRV": - case "A", "AAAA", "MX": + case "A", "AAAA", "MX", "NS": if args.Port == 0 { return errors.New("a port is required in DNS-SD configs for all record types except SRV") } diff --git a/docs/sources/flow/reference/components/discovery.dns.md b/docs/sources/flow/reference/components/discovery.dns.md index 70fb3a64b9e1..8051bb2b6130 100644 --- a/docs/sources/flow/reference/components/discovery.dns.md +++ b/docs/sources/flow/reference/components/discovery.dns.md @@ -31,7 +31,7 @@ Name | Type | Description | Default | Required `names` | `list(string)` | DNS names to look up. | | yes `port` | `number` | Port to use for collecting metrics. Not used for SRV records. | `0` | no `refresh_interval` | `duration` | How often to query DNS for updates. | `"30s"` | no -`type` | `string` | Type of DNS record to query. Must be one of SRV, A, AAAA, or MX. | `"SRV"` | no +`type` | `string` | Type of DNS record to query. Must be one of SRV, A, AAAA, MX, or NS. | `"SRV"` | no ## Exported fields @@ -47,7 +47,7 @@ Each target includes the following labels: * `__meta_dns_srv_record_target`: Target field of the SRV record. * `__meta_dns_srv_record_port`: Port field of the SRV record. * `__meta_dns_mx_record_target`: Target field of the MX record. - +* `__meta_dns_ns_record_target`: Target field of the NS record. ## Component health