mirror of
https://github.com/google/adk-go.git
synced 2026-10-28 08:34:37 +08:00
InitAndSetGlobalOtelProviders appended WithOtelToCloud(flag) after the embedder's TelemetryOptions. The -otel_to_cloud flag defaults to false and the last option wins, so a WithOtelToCloud(true) passed in code was silently turned off unless the binary was also started with the flag. The append could also write into the embedder's backing array. Copy the options and append WithOtelToCloud(true) only when the flag is set, so the flag still turns export on and an option decides otherwise. Closes: #1967 Co-authored-by: Saurav Gupta <91198524+Saurav-Gupta-13@users.noreply.github.com> Co-authored-by: João Westerberg <westerberg@google.com>