vectordotdev / vector

A high-performance observability data pipeline.
https://vector.dev
Mozilla Public License 2.0
18.21k stars 1.6k forks source link

YAML Merges are not support in Config #21729

Closed lattwood closed 2 weeks ago

lattwood commented 2 weeks ago

A note for the community

Problem

YAML configuration parsing doesn't support merging, part of the YAML 1.1 > spec.

This is due to not calling serde_yaml::apply_merge after serde_yaml::from_str.

I'm opening this issue due to CONTRIBUTING.md saying there should be an issue for pull requests.

Configuration

transforms:
  enhance_node_exporter_data: &enrichRemap
    type: remap
    inputs:
    - node_exporter
    source: |-
      .tags.country = "meta.country"
    enhance_statsd_metrics_data:
      <<: *enrichRemap
      inputs:
      - statsd_metrics


### Version

0.43.0-custom-e2b83f219

### Debug Output

_No response_

### Example Data

_No response_

### Additional Context

_No response_

### References

_No response_
pront commented 2 weeks ago

Thank you @lattwood! We will review the PR shortly.

lattwood commented 2 weeks ago

@pront awesome! Can't wait for a release with it so I can dry up my vector config!

jszwedko commented 2 weeks ago

I think this is a duplicate of https://github.com/vectordotdev/vector/issues/20853 so I'll close this one, but thank you for the PR to address it!

lattwood commented 2 weeks ago

Even better, solving a problem others are currently experiencing!