Skip to content

Commit

Permalink
Conditionally set dataset per-event based on :service.name (#6)
Browse files Browse the repository at this point in the history
Follow the OTEL spec and set the dataset per-event based on the :service.name property, if it's present.
  • Loading branch information
drewinglis authored Aug 14, 2023
1 parent e339ee7 commit 4ae667e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 4ae667e

Please sign in to comment.