mirror of https://github.com/grafana/grafana.git
Add context config to the frontend
CodeQL checks / Detect whether code changed (push) Waiting to run
Details
CodeQL checks / Analyze (actions) (push) Blocked by required conditions
Details
CodeQL checks / Analyze (go) (push) Blocked by required conditions
Details
CodeQL checks / Analyze (javascript) (push) Blocked by required conditions
Details
CodeQL checks / Detect whether code changed (push) Waiting to run
Details
CodeQL checks / Analyze (actions) (push) Blocked by required conditions
Details
CodeQL checks / Analyze (go) (push) Blocked by required conditions
Details
CodeQL checks / Analyze (javascript) (push) Blocked by required conditions
Details
This commit is contained in:
parent
f4f4b92192
commit
22ed7f4e13
|
@ -302,6 +302,7 @@
|
|||
"@locker/near-membrane-shared-dom": "0.14.0",
|
||||
"@msagl/core": "^1.1.19",
|
||||
"@msagl/parser": "^1.1.19",
|
||||
"@openfeature/ofrep-web-provider": "^0.3.3",
|
||||
"@openfeature/web-sdk": "^1.6.1",
|
||||
"@opentelemetry/api": "1.9.0",
|
||||
"@opentelemetry/exporter-collector": "0.25.0",
|
||||
|
|
|
@ -316,6 +316,7 @@ export interface GrafanaConfig {
|
|||
quickRanges?: TimeOption[];
|
||||
pluginRestrictedAPIsAllowList?: Record<string, string[]>;
|
||||
pluginRestrictedAPIsBlockList?: Record<string, string[]>;
|
||||
openFeatureContext: Record<string, unknown>;
|
||||
|
||||
// The namespace to use for kubernetes apiserver requests
|
||||
namespace: string;
|
||||
|
|
|
@ -259,6 +259,8 @@ export class GrafanaBootConfig {
|
|||
listDashboardScopesEndpoint = '';
|
||||
listScopesEndpoint = '';
|
||||
|
||||
openFeatureContext: Record<string, unknown> = {};
|
||||
|
||||
constructor(
|
||||
options: BootData['settings'] & {
|
||||
bootData: BootData;
|
||||
|
|
|
@ -24,7 +24,7 @@ export async function initOpenFeature() {
|
|||
|
||||
await OpenFeature.setProviderAndWait(ofProvider, {
|
||||
targetingKey: config.namespace,
|
||||
namespace: config.namespace,
|
||||
...config.openFeatureContext,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ func InitOpenFeatureWithCfg(cfg *setting.Cfg) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("failed to initialize OpenFeature: %w", err)
|
||||
}
|
||||
// Convert map[string]string to map[string]any for OpenFeature SDK
|
||||
contextAttrs := make(map[string]any)
|
||||
for k, v := range cfg.OpenFeature.ContextAttrs {
|
||||
contextAttrs[k] = v
|
||||
|
|
|
@ -18257,6 +18257,7 @@ __metadata:
|
|||
"@msagl/core": "npm:^1.1.19"
|
||||
"@msagl/parser": "npm:^1.1.19"
|
||||
"@npmcli/package-json": "npm:^6.0.0"
|
||||
"@openfeature/ofrep-web-provider": "npm:^0.3.3"
|
||||
"@openfeature/web-sdk": "npm:^1.6.1"
|
||||
"@opentelemetry/api": "npm:1.9.0"
|
||||
"@opentelemetry/exporter-collector": "npm:0.25.0"
|
||||
|
|
Loading…
Reference in New Issue