-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[processor/dnslookup] Initial implementation #39642
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
Conversation
Move retry from chain resolver to nameserver resolver. No resolution is considered as success and stored in hit cache. Handle hostname/IP not found Handle non retryable error
- Add test dependency - Add Lookup interface for mock - Add validation to nameserver address
Use debug log instead of error for failure lookup
0 means no expiry
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
The golang-lru library has a known issue where its expirable LRU cache spawns a background goroutine for TTL eviction that cannot be properly stopped. This commit replaces it with go-freelru, which provides similar functionality without leaking goroutines.
Hi @kaisecheng! I'm wondering if we should handle the configurations per signal, like other processor are doing, so we wouldn't need one processor per singal if the the source or target attribute config changes. For example, with the current config format, I wouldn't be able to set different resolve:
enabled: true
context: "record"
attributes: ["source.address"]
resolved_attribute: "source.ip" I can think about a few alternatives (added to each signal as an example), being the first 2 already possible, and the last one would depend on an OTTL change: resolve:
logs: # signal
source_context: log # context from where values should be taken
source_values: [body["ip"], attributes["ip"], resource.attributes["ip"]] # OTTL value expressions
target_context: "resource" # context where the result attribute should be set
target_attribute: "bar" # new attribute name
metrics: # singal
sources: [datapoint.attributes["ip"], resource.attributes["ip"]] # Value expressions (possible) + context inference (PR open)
target_context: "datapoint" # context where the result attribute should be set
target_attribute: "bar" # new attribute name
traces: # signal
sources: [span.attributes["ip"], resource.attributes["ip"]] # Value expressions (possible) + context inference (PR open)
target: "span.attributes[\"bar\"]" # use OTTL for parsing and setting the path's value (not currently supported) Thoughts? @andrzej-stencel WDYT? |
After a discussion, we've agreed to retain the current design, aligning it with the configuration of the GeoIPProcessor and accepting the same limitations. We believe that supporting OTTL value expressions with context inference for getting and setting attributes offers the greatest flexibility to users, and hopefully we will get there in the future. If further discussion is needed on how to resolve attributes and context, I will start with an initial version that supports only |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This draft will be split to smaller PRs |
Description
This PR adds a new DNS Lookup processor for resolving hostnames to IP and reversing DNS lookups IP to hostname.
Resolution Order and Retry Mechanism
The processor implements a chain of resolvers with the following resolution order
Caching
Config
Link to tracking issue
#34398
TODO
Testing
Added unit test for all resolvers
Documentation
cc @edmocosta