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

Ruler: remove trailing period from SRV records returned by discovery dnsnosrva lookups #7494

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

verejoel
Copy link
Contributor

@verejoel verejoel commented Jun 28, 2024

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

This is a small change, that strips the trailing dot (.) on records returned by dnssrvno lookups. While the trailing dot is technically a valid URL, it causes "issues" for some tools (in my case Istio), This PR uses the same approach as Prometheus to strip the trailing dot to look more "usual" so that third-party applications might not complain...

Verification

I have had this running in our DEV environment since I opened the PR with no issues.

@verejoel verejoel changed the title Debug output Remove trailing period from FQDNs used in discovery dnsnosrva lookups Jun 28, 2024
@verejoel verejoel changed the title Remove trailing period from FQDNs used in discovery dnsnosrva lookups Remove trailing period from SRV records returned by discovery dnsnosrva lookups Jun 28, 2024
@verejoel verejoel changed the title Remove trailing period from SRV records returned by discovery dnsnosrva lookups Ruler: remove trailing period from SRV records returned by discovery dnsnosrva lookups Jul 9, 2024
@verejoel verejoel force-pushed the feature/alertmanager-dnssrv branch from 0fcd6ed to 8a56ad4 Compare July 9, 2024 02:11
@verejoel verejoel marked this pull request as ready for review July 9, 2024 02:11
Recently ran into an issue with Istio in particular, where leaving the
trailing dot on the SRV record returned by `dnssrvnoa` lookups led to an
inability to connect to the endpoint. Removing the trailing dot fixes
this behaviour.

Now, technically, this is a valid URL, and it shouldn't be a problem.
One could definitely argue that Istio should be responsible here for
ensuring that the traffic is delivered. The problem seems rooted in how
Istio attempts to do wildcard matching or URLs it receives - including
the dot leads it to lookup an empty DNS field, which is invalid.

The approach I take here is actually copied from how Prometheus does it.
Therefore I hope we can sneak this through with the argument that 'this
is how Prometheus does it', regardless of whether or not this is
philosophically correct...

Signed-off-by: verejoel <[email protected]>
@verejoel verejoel force-pushed the feature/alertmanager-dnssrv branch from 8a56ad4 to f796fe3 Compare July 9, 2024 02:12
@verejoel
Copy link
Contributor Author

verejoel commented Jul 9, 2024

In case anyone is interested here is a nice article about the trailing dot from the author of curl

Copy link
Member

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for delving into this

@saswatamcode saswatamcode enabled auto-merge (squash) July 9, 2024 05:58
@saswatamcode saswatamcode merged commit fb76b22 into thanos-io:main Jul 9, 2024
20 checks passed
jnyi pushed a commit to jnyi/thanos that referenced this pull request Oct 17, 2024
Recently ran into an issue with Istio in particular, where leaving the
trailing dot on the SRV record returned by `dnssrvnoa` lookups led to an
inability to connect to the endpoint. Removing the trailing dot fixes
this behaviour.

Now, technically, this is a valid URL, and it shouldn't be a problem.
One could definitely argue that Istio should be responsible here for
ensuring that the traffic is delivered. The problem seems rooted in how
Istio attempts to do wildcard matching or URLs it receives - including
the dot leads it to lookup an empty DNS field, which is invalid.

The approach I take here is actually copied from how Prometheus does it.
Therefore I hope we can sneak this through with the argument that 'this
is how Prometheus does it', regardless of whether or not this is
philosophically correct...

Signed-off-by: verejoel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants