-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
New component: DNS Cache Extension for OpenTelemetry #32410
Comments
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
The purpose and use-cases of the new component
The DNS Cache Extension is designed to maintain the operability of OpenTelemetry exporters in the event of DNS resolution failures. By caching DNS resolutions, this extension ensures that telemetry data (traces, metrics, logs) can continue to be exported to configured endpoints even when DNS services are temporarily unavailable.
Example configuration for the component
Telemetry data types supported
Is this a vendor-specific component?
Code Owner(s)
philchia
Sponsor (optional)
philchia
Additional context
The proposed DNS Cache Extension enhances resilience against DNS failures by implementing a caching mechanism directly into the OpenTelemetry's networking layer. Here’s a summary of how it works:
Initialization:
Upon initialization, creates a dnscache Resolver with a specified timeout for resolving DNS queries.
It also configures a custom http.Transport to intercept standard http. DefaultTransport. This transport uses the DNS resolver to look up and cache IP addresses for given hostnames.
Operation:
The custom transport attempts to resolve hostnames using cached entries first. If the cache does not have the entry or it fails, it falls back to a real-time DNS lookup and updates the cache with the new result.
This ensures that even during DNS outages, the IP addresses stored in the cache can still be used to establish network connections, thereby allowing telemetry data to continue being exported without interruption.
Refreshing the Cache:
The extension runs a background routine that periodically refreshes the DNS cache based on a configurable interval (RefreshInterval).
It utilizes the ResolverRefreshOptions to clear unused cache entries and to persist useful entries even in the case of intermittent DNS resolution failures.
Shutdown:
On shutdown, the extension restores the default network transport to ensure that any changes made do not persist beyond the lifetime of the application, maintaining clean state management.
The text was updated successfully, but these errors were encountered: