getUserUUID returns the persistent UUID identifying this cagent installation, generating and persisting one on first use. It delegates to [userid.Get], which is also used by the HTTP transport so the same identifier appears as the `user_uuid` telemetry property and as the `X-Cagent-Id` header on ga
()
| 45 | // telemetry property and as the `X-Cagent-Id` header on gateway-bound |
| 46 | // requests. |
| 47 | func getUserUUID() string { |
| 48 | return userid.Get() |
| 49 | } |
| 50 | |
| 51 | // structToMap converts a struct to map[string]any using JSON marshaling |
| 52 | // This automatically handles all fields and respects JSON tags (including omitempty) |