Skip to content
/ docs Public

Document resolve_hostnames parameter for load_tcp#234

Merged
tobim merged 1 commit intomainfrom
topic/fix-load-tcp-peer-resolution
Mar 6, 2026
Merged

Document resolve_hostnames parameter for load_tcp#234
tobim merged 1 commit intomainfrom
topic/fix-load-tcp-peer-resolution

Conversation

@tobim
Copy link
Member

@tobim tobim commented Mar 4, 2026

Summary

Documents the new resolve_hostnames parameter for the load_tcp operator, which enables reverse DNS lookup of peer IP addresses in TCP connections.

Related PR

This documents the changes from the main repository PR:

Changes

  • Updated load_tcp.mdx to document the resolve_hostnames parameter
  • Clarified the relationship between resolve_hostnames and the peer_field parameter
  • Explained behavior when the parameter is enabled and disabled

Add documentation for the new resolve_hostnames parameter that enables
reverse DNS lookup of peer IP addresses in TCP connections.

See: tenzir/tenzir#5865

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the reference Reference documentation label Mar 4, 2026
@tobim tobim marked this pull request as ready for review March 4, 2026 16:21
tobim added a commit to tenzir/tenzir that referenced this pull request Mar 6, 2026
## Summary

- Make reverse DNS hostname resolution optional for the `load_tcp`
operator via a new `resolve_hostnames` parameter
- Default to `false` to prevent silent failures or exceptions in
environments without reverse DNS
- Add graceful error handling with debug logging when resolution fails

## Details

### Problem

The `load_tcp` operator always attempted reverse DNS lookup for peer
endpoints, which could:
- Fail silently or throw exceptions in environments without reverse DNS
support
- Block or delay connection handling when DNS resolution hangs
- Unnecessarily slow down data ingestion in scenarios where hostnames
are not needed

### Solution

- Added `resolve_hostnames: bool` parameter to `load_tcp_args` (defaults
to `false`)
- DNS resolution is only attempted when explicitly enabled
- Errors during resolution are captured and logged at debug level
instead of propagating
- Peer IP addresses are always available; hostnames are optional

### Changed Files

- `libtenzir/builtins/operators/load_tcp.cpp`:
  - Added `resolve_hostnames` field to `load_tcp_args` structure
  - Updated parameter inspection to include the new field
- Modified `load_tcp_sink_operator` constructor to accept optional
`peer_hostname`
- Changed DNS resolution logic to check `resolve_hostnames` flag before
resolving
  - Added error handling with debug logging for resolution failures
- Updated parameter parsing to register the `resolve_hostnames`
parameter

## Test Plan

- [ ] Verify existing tests pass without changes (backward
compatibility)
- [ ] Test with `resolve_hostnames` disabled (default) - should work
normally
- [ ] Test with `resolve_hostnames` enabled - should resolve hostnames
when available
- [ ] Test with invalid/unreachable DNS - should log debug message and
continue

## Documentation PR

tenzir/docs#234
@tobim tobim merged commit fb9b2a9 into main Mar 6, 2026
7 checks passed
@tobim tobim deleted the topic/fix-load-tcp-peer-resolution branch March 6, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reference Reference documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants