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

New component: DNS Cache Extension for OpenTelemetry #32410

Closed
2 tasks
philchia opened this issue Apr 16, 2024 · 2 comments
Closed
2 tasks

New component: DNS Cache Extension for OpenTelemetry #32410

philchia opened this issue Apr 16, 2024 · 2 comments
Labels
closed as inactive needs triage New item requiring triage Sponsor Needed New component seeking sponsor Stale

Comments

@philchia
Copy link
Contributor

philchia commented Apr 16, 2024

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

refresh_interval:   "1m"
resolve_timeout:    "5s"
clear_unused:       false
persist_on_failure: true

Telemetry data types supported

  • Traces
  • Metrics
  • Logs

Is this a vendor-specific component?

  • This is a vendor-specific component
  • If this is a vendor-specific component, I am proposing to contribute and support it as a representative of the vendor.

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.

Copy link
Contributor

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed as inactive needs triage New item requiring triage Sponsor Needed New component seeking sponsor Stale
Projects
None yet
Development

No branches or pull requests

1 participant