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

Conditionally set dataset per-event based on :service.name #6

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

...
### Changed
- Conditionally set dataset per-event based on the `:service.name` property,
following the OTEL spec.
[PR#6](https://github.com/amperity/ken-honeycomb/pull/6)


## [1.1.0] - 2023-05-08
Expand Down
4 changes: 3 additions & 1 deletion src/ken/honeycomb.clj
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@
(.setTimestamp event (inst-ms timestamp)))
(when-let [sample-rate (::event/sample-rate data)]
(.setSampleRate event (long sample-rate)))
;; Follow OTEL spec and set dataset based on service.name.
(when-let [service-name (:service.name data)]
(.setDataset event service-name))
;; TODO: it's possible for events to override some of the client
;; properties; how should this be exposed?
;; - ApiHost
;; - Dataset
;; - Metadata
;; - WriteKey
event)))
Expand Down