Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for NS records to discovery.dns #5905

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion component/discovery/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/flow/reference/components/discovery.dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
Loading