Socket
Book a DemoInstallSign in
Socket

@grafana/flamegraph

Package Overview
Dependencies
Maintainers
23
Versions
3431
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grafana/flamegraph

Grafana flamegraph visualization component

12.1.0
next
latest
Source
npmnpm
Version published
Weekly downloads
2.8K
-48.23%
Maintainers
23
Weekly downloads
 
Created
Source

Grafana Flamegraph component

@grafana/flamegraph is currently in BETA.

This is a Flamegraph component that is used in Grafana and Pyroscope web app to display profiles.

Usage

Currently this library exposes single component Flamegraph that renders whole visualization used for profiling which contains a header, a table representation of the data and a flamegraph.

import { Flamegraph } from '@grafana/flamegraph';

<FlameGraph
  getTheme={() => createTheme({ colors: { mode: 'dark' } })}
  data={dataFrame}
  extraHeaderElements={
    <Button onClick={() => {}} variant="secondary">
      Download
    />
  }
  stickyHeader
  vertical
/>

Props

NameTypeDescription
dataDataFrameDataFrame with the profile data. Optional, if missing or empty the flamegraph is not rendered
stickyHeaderbooleanWhether the header should be sticky and be always visible on the top when scrolling.
getTheme() => GrafanaTheme2Provides a theme for the visualization on which colors and some sizes are based.
onTableSymbolClick(symbol: string) => voidInteraction hook that can be used to report on the interaction. Fires when user click on a name in the table.
onViewSelected(view: string) => voidInteraction hook that can be used to report on the interaction. Fires when user changes the view to show (table/graph/both)
onTextAlignSelected(align: string) => voidInteraction hook that can be used to report on the interaction. Fires when user changes the text align.
onTableSort(sort: string) => voidInteraction hook that can be used to report on the interaction. Fires when user changes the teble sorting.
extraHeaderElementsReact.ReactNodeElements that will be shown in the header on the right side of the header buttons. Useful for additional functionality.
verticalbooleanIf true the flamegraph will be rendered on top of the table.
keepFocusOnDataChangebooleanIf true any focused block will stay focused when the profile data changes. Same for the sandwich view.
DataFrame schema

The dataFrame needs to have the following fields:

NameTypeDescription
namestringThe name of the node.
labelsstring[]The labels of the node.
levelnumberThe nesting level of the node.
valuenumberThe total value of the node.
selfnumberThe self value of the node.
valueRightnumberThe total value of the node in the right profile. Optional, if present will show a diff version of the flamegraph.
selfRightnumberThe self value of the node in the right profile. Optional, if present will show a diff version of the flamegraph.

Keywords

grafana

FAQs

Package last updated on 23 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.