@@ -245,16 +245,19 @@ module Xapi_cluster = struct
245245 end
246246end
247247
248- let default_attributes ~__context ~host ~name_label ~component =
248+ let default_attributes ~__context ~host ~observer ~component =
249249 let pool = Helpers. get_pool ~__context in
250250 let host_label = Db.Host. get_name_label ~__context ~self: host in
251251 let host_uuid = Db.Host. get_uuid ~__context ~self: host in
252252 let pool_uuid = Db.Pool. get_uuid ~__context ~self: pool in
253+ let name_label = Db.Observer. get_name_label ~__context ~self: observer in
254+ let observer_uuid = Db.Observer. get_uuid ~__context ~self: observer in
253255 [
254256 (" xs.pool.uuid" , pool_uuid)
255257 ; (" xs.host.name" , host_label)
256258 ; (" xs.host.uuid" , host_uuid)
257259 ; (" xs.observer.name" , name_label)
260+ ; (" xs.observer.uuid" , observer_uuid)
258261 ; (" service.name" , to_string component)
259262 ]
260263
@@ -289,13 +292,12 @@ module ObserverConfig = struct
289292 from and updated instead of being regenerated. *)
290293 let endpoints = Db.Observer. get_endpoints ~__context ~self: observer in
291294 let host = Helpers. get_localhost ~__context in
292- let name_label = Db.Observer. get_name_label ~__context ~self: observer in
293295 {
294296 otel_service_name= to_string component
295297 ; otel_resource_attributes=
296298 attributes_to_W3CBaggage
297299 (Db.Observer. get_attributes ~__context ~self: observer
298- @ default_attributes ~__context ~host ~name_label ~component
300+ @ default_attributes ~__context ~host ~observer ~component
299301 )
300302 ; xs_exporter_zipkin_endpoints= zipkin_endpoints endpoints
301303 ; xs_exporter_bugtool_endpoint= bugtool_endpoint endpoints
@@ -513,11 +515,11 @@ let assert_valid_attributes attributes =
513515 attributes
514516
515517let register_component ~__context ~self ~host ~component =
516- let name_label = Db.Observer. get_name_label ~__context ~self in
517518 let attributes =
518- default_attributes ~__context ~host ~name_label ~component
519+ default_attributes ~__context ~host ~observer: self ~component
519520 @ Db.Observer. get_attributes ~__context ~self
520521 in
522+ let name_label = Db.Observer. get_name_label ~__context ~self in
521523 let uuid = Db.Observer. get_uuid ~__context ~self in
522524 let endpoints = Db.Observer. get_endpoints ~__context ~self in
523525 let enabled = Db.Observer. get_enabled ~__context ~self in
@@ -691,14 +693,13 @@ let set_attributes ~__context ~self ~value =
691693 assert_valid_attributes value ;
692694 let uuid = Db.Observer. get_uuid ~__context ~self in
693695 let host = Helpers. get_localhost ~__context in
694- let name_label = Db.Observer. get_name_label ~__context ~self in
695696 let observation_fn () =
696697 List. iter
697698 (fun c ->
698699 let module Forwarder = (val get_forwarder c : ObserverInterface ) in
699700 Forwarder. set_attributes ~__context ~uuid
700701 ~attributes:
701- (default_attributes ~__context ~host ~name_label ~component: c
702+ (default_attributes ~__context ~host ~observer: self ~component: c
702703 @ value
703704 )
704705 )
0 commit comments