-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rename host
config option to follow nomenclature from RFC 3986
#1775
Comments
host
config option for sinks to follow nomenclature from RFC 3986host
config option to follow nomenclature from RFC 3986
👍 agree.
100% agree. This would be a severe breaking change that I would like to avoid. I also wonder if this is better solved by implementing https://github.com/timberio/vector/issues/1291? Then we can build layers that handle backward compatibility. I fear this type of logic will get messy and complicated over time unless we support versioning.
I would prefer to remove it for the docs. |
This seems like a good idea! I think another thing we could do as well with this change is push |
We definitely should use it, it would greatly reduce amount of boilerplate. And it can also be used in |
In AWS sinks we have options |
Yes, the path can be used for some services. It’s also helpful when pointing Vector to services that behave like AWS services (ex: many services implement the S3 protocol). |
@binarylogic I wanted to add
on which I was working on, but it turned out a lot more taxing than the original issue, so I am for closing this. There is value in pushing endpoint parsing, but there is no clear border on how much should be moved since there are trade-offs going on. If we do want to add this, it would need a separate issue, with listed trade-offs, and explanation where to draw the border. This is mostly complicated by having to think defensively about how the users are using the endpoints to avoid breakage. In all, I don't think the amount of work that needs to be put into it is worth the result at the moment, but it will be even more difficult to do in the future. |
Thanks. Would you mind closing this and opening an issue for the idea? We can always come back to it in the future. I would elaborate on why it's beneficial and difficult. |
Some of our components support
host
(orhosts
) configuration option. The following table shows examples of this option provided by our docs for components which use it:prometheus
sourcehttp://localhost:9090
aws_ec2_metadata
transformhttp://169.254.169.254
clickhouse
sinkhttp://localhost:8123
datadog_metrics
sinkhttps://api.datadoghq.com
elasticsearch
sinkhttp://10.24.32.122:9000
humio_logs
sinkhttp://myhumiohost.com
logdna
sinkhttp://127.0.0.1
sematext
sinkhttp://example.com
splunk_hec
sinkhttp://my-splunk-host.com
From these examples it can be seen that the values are expected to contain schema and (optionally) port number. However, according to RFC 3986 URIs are divided into components like this:
and the "host" part is defined in section 3.2.2 as
This means that using
host
as the configuration option name is technically not precise because it contains the schema and can also contain the port number.Proposal
We need a single name for an expression of form
http(s)://<host>(:<port>)
. I propose to use nameendpoint
. This name is used in AWS Documentation and we already use nameendpoint
for the same purpose inaws_*
sinks: https://github.com/timberio/vector/blob/1b24dd1833d41a3fdac741a1190033b6d49cb6f0/src/region.rs#L9-L12An alternative name is
base_uri
, which is mentioned in section 5.1 of the same RFC 3986.Transitioning strategy
Because the change is merely cosmetic, I think it would not be fair to break existing configs for mentioned above components. So we can add
host
as an alias forendpoint
/base_uri
and update the documentation, so that thehost
option would still work, butendpoint
/base_uri
would be recommended for new configs.It is an interesting question should we keep mentioning
host
in the documentation as a deprecated option or just make it undocumented.The text was updated successfully, but these errors were encountered: