vectordotdev / vectordotdev/vector
Improve error when a table is passed for a single key
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
I attempted to use a Vector config that included the new encoding table but it was on an older version of Vector. It produced the following configuration error:
[sinks.company_api_http]
type = "http"
inputs = ["company_api_rename"]
uri = "http://{{ consumer_instance.ec2_private_ip_address }}:{{ consumer_port }}"
[sinks.company_api_http.encoding]
except_fields = ["metadata.shard[0]", "metadata.shard[1]"]
The valid config is:
[sinks.company_api_http]
type = "http"
inputs = ["company_api_rename"]
uri = "http://{{ consumer_instance.ec2_private_ip_address }}:{{ consumer_port }}"
encoding.format = "json"
Mar 14 17:39:21 ip-10-0-131-11 vector[11926]: Mar 14 17:39:21.233 ERROR vector: Configuration error: "/etc/vector/vector.toml": invalid value: map, expected map with a single key for key `sinks.company_api_http`
This is not very descriptive of the error. It should probably be something like:
Mar 14 17:39:21 ip-10-0-131-11 vector[11926]: Mar 14 17:39:21.233 ERROR vector: Configuration error: "/etc/vector/vector.toml": invalid value: map, expected map with a single key for encoding `sinks.company_api_http`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the configuration error with the shown sinks.company_api_http.encoding table on an older Vector version, then trace the configuration parsing path that emits the single-key map message. Update the error so it identifies encoding, and verify the revised wording against the provided configuration example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100