Skip to content
This repository was archived by the owner on Apr 27, 2023. It is now read-only.

Commit a0e462c

Browse files
authored
Merge pull request #1 from pyroscope-io/shared-flamegraph-component
adds integration with main pyroscope repo
2 parents 254ccb5 + 14dcf08 commit a0e462c

File tree

6 files changed

+32
-10
lines changed

6 files changed

+32
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ e2e-results/
3030
# Editors
3131
.idea
3232

33+
src/flamegraphComponent.js

docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
version: "3.9"
3+
services:
4+
grafana:
5+
image: grafana/grafana:8.1.1
6+
volumes:
7+
- ./dist:/var/lib/grafana/plugins/pyroscope-panel
8+
environment:
9+
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=pyroscope-panel
10+
- GF_INSTALL_PLUGINS=pyroscope-datasource
11+
ports:
12+
- 3000:3000
13+
14+
pyroscope:
15+
image: "pyroscope/pyroscope:latest"
16+
ports:
17+
- 4040:4040
18+
command:
19+
- server
20+
environment:
21+
- PYROSCOPE_LOG_LEVEL=info

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
"version": "1.0.1",
44
"description": "Pyroscope plugin for grafana",
55
"scripts": {
6-
"build": "grafana-toolkit plugin:build",
7-
"test": "grafana-toolkit plugin:test",
8-
"dev": "grafana-toolkit plugin:dev",
9-
"watch": "grafana-toolkit plugin:dev --watch",
10-
"sign": "grafana-toolkit plugin:sign",
6+
"build-flamegraph": "rm ../../src/flamegraphComponent.js ; cd node_modules/pyroscope && pwd && yarn && make build-panel && cp webapp/public/assets/flamegraphComponent.js ../../src/flamegraphComponent.js",
7+
"build": "yarn build-flamegraph && grafana-toolkit plugin:build",
8+
"test": "yarn build-flamegraph && grafana-toolkit plugin:test",
9+
"dev": "yarn build-flamegraph && grafana-toolkit plugin:dev",
10+
"watch": "yarn build-flamegraph && grafana-toolkit plugin:dev --watch",
11+
"sign": "yarn build-flamegraph && grafana-toolkit plugin:sign",
1112
"start": "yarn watch"
1213
},
1314
"author": "Mike Egorov",
@@ -22,6 +23,6 @@
2223
"node": ">=14"
2324
},
2425
"dependencies": {
25-
"pyroscope": "git+https://github.com/pyroscope-io/pyroscope.git#plugin-webpack"
26+
"pyroscope": "git+https://github.com/pyroscope-io/pyroscope.git#133b35b"
2627
}
2728
}

src/SimplePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { PanelProps } from '@grafana/data';
44
import { SimpleOptions } from 'types';
55
import { css } from 'emotion';
66
import { stylesFactory, useTheme } from '@grafana/ui';
7-
import FlameGraph, { parseFlamebearerFormat } from 'pyroscope';
7+
import FlameGraph, { parseFlamebearerFormat } from 'flamegraphComponent.js';
88

99
interface Props extends PanelProps<SimpleOptions> {}
1010

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"baseUrl": "./src",
77
"noImplicitAny": false,
88
"noUnusedLocals": false,
9-
"allowJs": true,
109
"typeRoots": ["./node_modules/@types"]
1110
}
1211
}

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11303,9 +11303,9 @@ [email protected]:
1130311303
rimraf "^2.6.1"
1130411304
ws "^6.1.0"
1130511305

11306-
"pyroscope@git+https://github.com/pyroscope-io/pyroscope.git#plugin-webpack":
11306+
"pyroscope@git+https://github.com/pyroscope-io/pyroscope.git#133b35b":
1130711307
version "0.0.39"
11308-
resolved "git+https://github.com/pyroscope-io/pyroscope.git#3a526d0242934b1c303918a7988bf0eb9b2e5768"
11308+
resolved "git+https://github.com/pyroscope-io/pyroscope.git#133b35bd4256b9708e40b41e49965492f42e0e79"
1130911309
dependencies:
1131011310
"@babel/preset-env" "^7.10.4"
1131111311
"@fortawesome/fontawesome-free" "^5.14.0"

0 commit comments

Comments
 (0)