[Dual writer] Read kind value passed as dualwriter's argument (#91113)

* Include kind on the dualwriter to be used on metrics

* Use kind as argument

* Skip dual writer in mode4
This commit is contained in:
Leonor Oliveira
2024-07-29 13:57:44 +02:00
committed by GitHub
parent 604c99f137
commit 8345af928c
10 changed files with 116 additions and 197 deletions
+6 -2
View File
@@ -174,10 +174,14 @@ func InstallAPIs(
if err != nil {
return nil, err
}
if currentMode == grafanarest.Mode0 {
switch currentMode {
case grafanarest.Mode0:
return legacy, nil
case grafanarest.Mode4:
return storage, nil
default:
}
return grafanarest.NewDualWriter(currentMode, legacy, storage, reg), nil
return grafanarest.NewDualWriter(currentMode, legacy, storage, reg, key), nil
}
}