From 3264067e6321af878ad8db3a76dcb831bbd6a20f Mon Sep 17 00:00:00 2001 From: Dan Snyder Date: Wed, 26 Mar 2025 10:16:31 -0400 Subject: [PATCH] FlameGraphPanel: Add units to standard options (#89815) (#102720) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FlameGraph: Added units standard option (#89815) * FlameGraph: Added decimals, and cleaned up module plugin configuration * Added missing colon Co-authored-by: Piotr Jamróz --------- Co-authored-by: Piotr Jamróz --- public/app/plugins/panel/flamegraph/module.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/flamegraph/module.tsx b/public/app/plugins/panel/flamegraph/module.tsx index 432e71da2d2..19fdd0afcfc 100644 --- a/public/app/plugins/panel/flamegraph/module.tsx +++ b/public/app/plugins/panel/flamegraph/module.tsx @@ -1,6 +1,12 @@ -import { PanelPlugin } from '@grafana/data'; +import { FieldConfigProperty, PanelPlugin } from '@grafana/data'; import { FlameGraphPanel } from './FlameGraphPanel'; import { FlameGraphSuggestionsSupplier } from './suggestions'; -export const plugin = new PanelPlugin(FlameGraphPanel).setSuggestionsSupplier(new FlameGraphSuggestionsSupplier()); +const flamegraphConfigOptions = [FieldConfigProperty.Unit, FieldConfigProperty.Decimals]; + +export const plugin = new PanelPlugin(FlameGraphPanel) + .setSuggestionsSupplier(new FlameGraphSuggestionsSupplier()) + .useFieldConfig({ + disableStandardOptions: Object.values(FieldConfigProperty).filter((v) => !flamegraphConfigOptions.includes(v)), + });