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

Set SampleRate for OTLP Logs #274

Closed
JamieDanielson opened this issue Sep 19, 2024 · 0 comments · Fixed by #275
Closed

Set SampleRate for OTLP Logs #274

JamieDanielson opened this issue Sep 19, 2024 · 0 comments · Fixed by #275
Assignees
Labels
type: enhancement New feature or request

Comments

@JamieDanielson
Copy link
Contributor

Is your feature request related to a problem? Please describe.

A husky event is an object that contains both Attributes and Sample Rate (and Timestamp but that's irrelevant here).

// Event represents a single Honeycomb event
type Event struct {
	Attributes map[string]interface{}
	Timestamp  time.Time
	SampleRate int32
}

Traces add SampleRate but logs do not.

Describe the solution you'd like

Set SampleRate for logs like we do for traces.

@JamieDanielson JamieDanielson added the type: enhancement New feature or request label Sep 19, 2024
@JamieDanielson JamieDanielson self-assigned this Sep 19, 2024
JamieDanielson added a commit that referenced this issue Sep 23, 2024
## Which problem is this PR solving?

- closes #274 

## Short description of the changes

- move sample rate logic that was in `traces` to `common`, including test cases
- add `sampleRate` to log events
- make `sampleRate` key name case-insensitive
- fall back to default rate of 1 when given negative values 
- round and coerce floats into ints

---------

Co-authored-by: Kent Quirk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant