Explore metrics: Always check that custom var is present for otel dep env migration (#100233)

This commit is contained in:
Brendan O'Handley 2025-02-06 18:26:25 -06:00 committed by GitHub
parent 74b2b5fb19
commit d16f2315a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,8 +32,15 @@ export function migrateOtelDeploymentEnvironment(trail: DataTrail, urlParams: Ur
) {
return;
}
// if there is no dep env, does not need to be migrated
if (!deploymentEnv) {
// check that there is a deployment environment variable value to migrate
// in some cases the deployment environment may not present
// but due to this change it is now always present and the value is undefined
// https://github.com/grafana/scenes/pull/1033
if (
!deploymentEnv ||
(Array.isArray(deploymentEnv) && deploymentEnv.length > 0 && deploymentEnv[0] === 'undefined')
) {
return;
}