8000 Prohibit empty metric field names by istathar · Pull Request #118 · aesiniath/unbeliever · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Prohibit empty metric field names #118

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

Merged
merged 1 commit into from
Apr 29, 2022
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
2 changes: 1 addition & 1 deletion core-telemetry/core-telemetry.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.18
-- see: https://github.com/sol/hpack

name: core-telemetry
version: 0.2.0.2
version: 0.2.0.3
synopsis: Advanced telemetry
description: This is part of a library to help build command-line programs, both tools and
longer-running daemons.
Expand Down
10 changes: 8 additions & 2 deletions core-telemetry/lib/Core/Telemetry/Observability.hs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,10 @@ telemetry values = do
)
where
f :: Map JsonKey JsonValue -> MetricValue -> Map JsonKey JsonValue
f acc (MetricValue k v) = insertKeyValue k v acc
f acc (MetricValue k@(JsonKey text) v) =
if nullRope text
then error "Empty metric field name not allowed"
else insertKeyValue k v acc

{- |
Record telemetry about an event. Specify a label for the event and then
Expand Down Expand Up @@ -629,7 +632,10 @@ sendEvent label values = do
writeTQueue tel (Just datum')
where
f :: Map JsonKey JsonValue -> MetricValue -> Map JsonKey JsonValue
f acc (MetricValue k v) = insertKeyValue k v acc
f acc (MetricValue k@(JsonKey text) v) =
if nullRope text
then error "Empty metric field name not allowed"
else insertKeyValue k v acc

-- get current time after digging out datum and override spanTimeFrom before
-- sending Datum
Expand Down
2 changes: 1 addition & 1 deletion core-telemetry/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: core-telemetry
version: 0.2.0.2
version: 0.2.0.3
synopsis: Advanced telemetry
description: |
This is part of a library to help build command-line programs, both tools and
Expand Down
0