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

feat(sample transform): add sample_rate_key config option #21283

Merged
merged 6 commits into from
Oct 31, 2024

Conversation

dekelpilli
Copy link
Contributor

This PR adds an option, sample_rate_key, to the sample transform, where leaving it empty should cause this value to be omitted. The new default is the same as the old hard-coded value (sample_rate), so this should not be a breaking change.

@dekelpilli dekelpilli requested a review from a team as a code owner September 12, 2024 12:33
@bits-bot
Copy link

bits-bot commented Sep 12, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the domain: transforms Anything related to Vector's transform components label Sep 12, 2024
@dekelpilli dekelpilli requested review from a team as code owners September 16, 2024 04:10
@github-actions github-actions bot added the domain: external docs Anything related to Vector's external, public documentation label Sep 16, 2024
@github-actions github-actions bot removed the domain: external docs Anything related to Vector's external, public documentation label Oct 24, 2024
@dekelpilli
Copy link
Contributor Author

I tried merging the latest changes to fix the conflicts, but I found there were a bunch of issues and I don't have the capacity to take that on at the moment, so I've reverted for now. Are there plans to merge this at some point soon-ish? If so, I might try to carve out some time to address this conflict/resulting issues.

Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

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

Thanks for this @dekelpilli ! Apologies for the delayed review. It seems to have fallen through the cracks. One thing this is missing is a changelog entry. Do you mind adding one? See https://github.com/vectordotdev/vector/blob/master/changelog.d/README.md

@jszwedko
Copy link
Member

The merge conflicts are pretty trivial, but there are actually a number of compilation errors here to resolve. Do you mind taking a look? Apologies again that this wasn't reviewed sooner. I'm happy to keep an eye on this and merge it when it is ready.

@dekelpilli
Copy link
Contributor Author

Yeah, I realised later that the issue was that I wasn't able to compile the version I had forked locally (regardless of my changes), and now that I can, I can see the other compilation issues. I'll try to get this ready soon and hopefully it can be merged before 0.43.

Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

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

Thanks @dekelpilli ! Could you do a couple of more things:

  • Run cargo fmt
  • Run make generate-component-docs

And push the changes? I started to, but I lack permissions to push to this branch.

@dekelpilli
Copy link
Contributor Author

I've run cargo fmt, but make generate-component-docs does not seem to change website/cue/reference/components/transforms/base/sample.cue for some reason. Do you have any insight as to why that would be?

Also, I had ticked "Allow edits and access to secrets by maintainers" so I'm not sure why you didn't have access, but I've added you explicitly now anyway.

@jszwedko
Copy link
Member

Weird, it still won't let me edit this branch. I wonder if there is something special about the default branch (master) of your fork. Can you apply this diff?

772554213b - (HEAD -> dekelpilli/master) regen docs (2 minutes ago) <Jesse Szwedko>
diff --git a/website/cue/reference/components/transforms/base/sample.cue b/website/cue/reference/components/transforms/base/sample.cue
index d6b573e409..fd698ecf7b 100644
--- a/website/cue/reference/components/transforms/base/sample.cue
+++ b/website/cue/reference/components/transforms/base/sample.cue
@@ -48,4 +48,12 @@ base: components: transforms: sample: configuration: {
 			1500,
 		]
 	}
+	sample_rate_key: {
+		description: "The event key in which the sample rate is stored. If set to an empty string, the sample rate will not be added to the event."
+		required:    false
+		type: string: {
+			default: "sample_rate"
+			examples: ["sample_rate"]
+		}
+	}
 }

@github-actions github-actions bot added the domain: external docs Anything related to Vector's external, public documentation label Oct 28, 2024
@jszwedko
Copy link
Member

Thanks! I was able to make a bit more progress on pushing after accepting your invite to collaborate but I couldn't quite get the local branch tracking right.

@jszwedko jszwedko enabled auto-merge October 28, 2024 23:06
auto-merge was automatically disabled October 31, 2024 02:59

Head branch was pushed to by a user without write access

@jszwedko jszwedko enabled auto-merge October 31, 2024 14:53
@jszwedko jszwedko added this pull request to the merge queue Oct 31, 2024
Merged via the queue into vectordotdev:master with commit 08bf15a Oct 31, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: external docs Anything related to Vector's external, public documentation domain: transforms Anything related to Vector's transform components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants