feat(sink: xray) #22749: Add a Sink for AWS X-Ray.
Summary
See title, adds a first version of the Sink for AWS X-Ray for #22749.
Change Type
- [ ] Bug fix
- [X] New feature
- [ ] Non-functional (chore, refactoring, docs)
- [ ] Performance
Is this a breaking change?
- [ ] Yes
- [X] No
How did you test this PR?
Manually (AWS X-Ray is unfortunately a LocalStack Pro feature):
- Get yourself an AWS account.
- Run Vector with the attached
vector.toml. - Run the attached script to send an example trace Vector.
- Open the AWS console (https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#xray:traces/query for
us-east-1), paste the Trace ID from the script output into the search field, "View Trace": You should see the example trace.
vector.toml
[sources.http_server]
type = "http_server"
address = "0.0.0.0:80"
encoding = "json"
[sinks.xray]
type = "xray"
inputs = ["http_server"]
trace.sh
#!/bin/zsh
START_TIME=$(date +%s)
HEX_TIME=$(printf '%x\n' $START_TIME)
GUID=$(dd if=/dev/random bs=12 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n')
TRACE_ID="1-$HEX_TIME-$GUID"
ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n')
echo $TRACE_ID
curl -d '{"trace_id": "'$TRACE_ID'", "id": "'$ID'", "start_time": '$START_TIME', "end_time": '$START_TIME', "name": "test.elasticbeanstalk.com"}' localhost:80
Does this PR include user facing changes?
- [X] Yes. Please add a changelog fragment based on our guidelines.
- [ ] No. A maintainer will apply the "no-changelog" label to this PR.
Checklist
- [X] Please read our Vector contributor resources.
make check-allis a good command to run locally. This check is defined here. Some of these checks might not be relevant to your PR. For Rust changes, at the very least you should run:cargo fmt --allcargo clippy --workspace --all-targets -- -D warningscargo nextest run --workspace(alternatively, you can runcargo test --all)
- [X] If this PR introduces changes Vector dependencies (modifies
Cargo.lock), please rundd-rust-license-tool writeto regenerate the license inventory and commit the changes (if any). More details here.
References
- Closes: #22749
Hi @johannesfloriangeiger, thanks for this contribution. It looks good. We will need some documentation files. See a recent example here (all files under
website): https://github.com/vectordotdev/vector/pull/22609/files#diff-2d2f5bfaa29c6451fe72bf7b0408b9044f9652bf6cb43159fac277781814411aNote that
base/is generated bymake generate-component-docs
Thanks, I've added some files but I am not sure if that's sufficient or if there's something missing, are you able to cross check that for me?
Hi @johannesfloriangeiger, there's a few conflicts and some open review comments. Don't hesitate to ping us (@vectordotdev/vector) when this is ready for another review.