Skip to content

Commit

Permalink
Influx/metrics: fix typo (cow_faul[t]s), avoid empty tag name for roo…
Browse files Browse the repository at this point in the history
…t domain

Also avoid reporting empty measurements
  • Loading branch information
hannesm committed Jul 1, 2024
1 parent 70f9d18 commit de65c50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion daemon/albatross_influx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ module P = struct
"tsize", i64 mem.tsize ;
"dsize", i64 mem.dsize ;
"ssize", i64 mem.ssize ;
"cow_fauls", string_of_int mem.cow ;
"cow_faults", string_of_int mem.cow ;
"runtime", i64 mem.runtime ;
"uptime", Printf.sprintf "%f" uptime ;
]
Expand Down
7 changes: 5 additions & 2 deletions daemon/albatrossd_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ let init_influx name data =
| Some socket ->
let tag = process name in
let datas = Metrics.SM.fold (fun src (tags, data) acc ->
let name = Metrics.Src.name src in
Metrics_influx.encode_line_protocol (tag :: tags) data name :: acc)
match Metrics.Data.fields data with
| [] -> acc
| _ ->
let name = Metrics.Src.name src in
Metrics_influx.encode_line_protocol (tag :: tags) data name :: acc)
(get_cache ()) []
in
let datas = String.concat "" datas in
Expand Down
4 changes: 3 additions & 1 deletion src/vmm_resources.ml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ let unikernel_metrics =

let report_vms t name =
let rec doit path =
let str = Name.path_to_string path in
let str =
if Name.is_root_path path then ":" else Name.path_to_string path
in
Metrics.add unikernel_metrics (fun x -> x str) (fun d -> d (t, path));
if Name.is_root_path path then () else doit (Name.parent_path path)
in
Expand Down

0 comments on commit de65c50

Please sign in to comment.