|
|
404e11 |
%if 0%{?rhel}
|
|
|
404e11 |
# emulate macros defined by the go-rpm-macros package
|
|
|
404e11 |
# https://pagure.io/go-rpm-macros/blob/master/f/rpm/macros.d/macros.go-compilers-golang
|
|
|
404e11 |
%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**};
|
|
|
404e11 |
%define gotestextldflags %__global_ldflags %{?__golang_extldflags}
|
|
|
404e11 |
%define gotest() GO111MODULE=off go test -buildmode pie -compiler gc -ldflags "${LDFLAGS:-}%{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};
|
|
|
404e11 |
%endif
|
|
|
404e11 |
|
|
|
404e11 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1752991
|
|
|
404e11 |
# unfortunately the go_arches macro doesn't reflect that change yet
|
|
|
404e11 |
ExcludeArch: i686
|
|
|
404e11 |
|
|
|
404e11 |
%global grafanapcp_arches %{lua: go_arches = {}
|
|
|
404e11 |
for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do
|
|
|
404e11 |
go_arches[arch] = 1
|
|
|
404e11 |
end
|
|
|
404e11 |
for arch in rpm.expand("%{nodejs_arches}"):gmatch("%S+") do
|
|
|
404e11 |
if go_arches[arch] then
|
|
|
404e11 |
print(arch .. " ")
|
|
|
404e11 |
end
|
|
|
404e11 |
end}
|
|
|
404e11 |
|
|
|
404e11 |
# Specify if the frontend and dashboards will be compiled as part of the build or
|
|
|
404e11 |
# are attached as a webpack tarball (in case of an unsuitable nodejs or jsonnet version on the build system)
|
|
|
404e11 |
%define compile_frontend 0
|
|
|
404e11 |
|
|
|
2ae673 |
Name: grafana-pcp
|
|
|
404e11 |
Version: 3.0.0
|
|
|
404e11 |
Release: 1%{?dist}
|
|
|
2ae673 |
Summary: Performance Co-Pilot Grafana Plugin
|
|
|
2ae673 |
License: ASL 2.0
|
|
|
404e11 |
URL: https://github.com/performancecopilot/grafana-pcp
|
|
|
404e11 |
|
|
|
404e11 |
Source0: https://github.com/performancecopilot/grafana-pcp/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
|
404e11 |
Source1: grafana-pcp-vendor-%{version}.tar.xz
|
|
|
404e11 |
%if %{compile_frontend} == 0
|
|
|
404e11 |
# Source2 contains the precompiled frontend and dashboards
|
|
|
404e11 |
Source2: grafana-pcp-webpack-%{version}.tar.gz
|
|
|
404e11 |
%endif
|
|
|
404e11 |
Source3: Makefile
|
|
|
404e11 |
Source4: list_bundled_nodejs_packages.py
|
|
|
404e11 |
|
|
|
404e11 |
Patch1: 001-fix-test-on-32bit.patch
|
|
|
404e11 |
|
|
|
404e11 |
# Intersection of go_arches and nodejs_arches
|
|
|
404e11 |
ExclusiveArch: %{grafanapcp_arches}
|
|
|
404e11 |
|
|
|
404e11 |
BuildRequires: systemd-rpm-macros, golang, go-srpm-macros
|
|
|
404e11 |
%if 0%{?fedora}
|
|
|
404e11 |
BuildRequires: go-rpm-macros
|
|
|
404e11 |
%endif
|
|
|
404e11 |
%if %{compile_frontend}
|
|
|
404e11 |
BuildRequires: nodejs >= 1:12, nodejs < 1:13, yarnpkg, golang-github-google-jsonnet
|
|
|
404e11 |
%endif
|
|
|
404e11 |
|
|
|
404e11 |
# omit golang debugsource, see BZ 995136 and related
|
|
|
404e11 |
%global dwz_low_mem_die_limit 0
|
|
|
404e11 |
%global _debugsource_template %{nil}
|
|
|
404e11 |
|
|
|
404e11 |
%global install_dir %{_sharedstatedir}/grafana/plugins/performancecopilot-pcp-app
|
|
|
404e11 |
|
|
|
404e11 |
Requires: grafana >= 7.3.3
|
|
|
404e11 |
Suggests: pcp >= 5.2.2
|
|
|
2ae673 |
Suggests: redis >= 5.0.0
|
|
|
2ae673 |
Suggests: bpftrace >= 0.9.2
|
|
|
2ae673 |
|
|
|
2ae673 |
# Obsolete old webapps
|
|
|
1fc467 |
Obsoletes: pcp-webjs <= 4.3.4
|
|
|
1fc467 |
Obsoletes: pcp-webapp-blinkenlights <= 4.3.4
|
|
|
1fc467 |
Obsoletes: pcp-webapp-grafana <= 4.3.4
|
|
|
1fc467 |
Obsoletes: pcp-webapp-graphite <= 4.3.4
|
|
|
1fc467 |
Obsoletes: pcp-webapp-vector <= 4.3.4
|
|
|
2ae673 |
|
|
|
404e11 |
# vendored golang and node.js build dependencies
|
|
|
404e11 |
# this is for security purposes, if nodejs-foo ever needs an update,
|
|
|
404e11 |
# affected packages can be easily identified.
|
|
|
404e11 |
# Note: generated by the Makefile (see README.md)
|
|
|
404e11 |
Provides: bundled(golang(github.com/grafana/grafana-plugin-sdk-go)) = 0.79.0
|
|
|
404e11 |
Provides: bundled(golang(github.com/smartystreets/goconvey)) = 1.6.4
|
|
|
404e11 |
Provides: bundled(npm(@babel/plugin-transform-modules-commonjs)) = 7.12.1
|
|
|
404e11 |
Provides: bundled(npm(@grafana/data)) = 7.3.3
|
|
|
404e11 |
Provides: bundled(npm(@grafana/runtime)) = 7.3.3
|
|
|
404e11 |
Provides: bundled(npm(@grafana/toolkit)) = 7.3.3
|
|
|
404e11 |
Provides: bundled(npm(@grafana/ui)) = 7.3.3
|
|
|
404e11 |
Provides: bundled(npm(@types/blueimp-md5)) = 2.7.0
|
|
|
404e11 |
Provides: bundled(npm(@types/d3-selection)) = 1.4.3
|
|
|
404e11 |
Provides: bundled(npm(@types/enzyme)) = 3.10.5
|
|
|
404e11 |
Provides: bundled(npm(@types/enzyme-adapter-react-16)) = 1.0.6
|
|
|
404e11 |
Provides: bundled(npm(@types/expect-puppeteer)) = 3.3.1
|
|
|
404e11 |
Provides: bundled(npm(@types/jest)) = 24.0.13
|
|
|
404e11 |
Provides: bundled(npm(@types/jest-environment-puppeteer)) = 4.4.0
|
|
|
404e11 |
Provides: bundled(npm(@types/lodash)) = 4.14.165
|
|
|
404e11 |
Provides: bundled(npm(@types/memoize-one)) = 5.1.2
|
|
|
404e11 |
Provides: bundled(npm(@types/react-autosuggest)) = 9.3.14
|
|
|
404e11 |
Provides: bundled(npm(@types/react-redux)) = 7.1.11
|
|
|
404e11 |
Provides: bundled(npm(@types/redux)) = 3.6.0
|
|
|
404e11 |
Provides: bundled(npm(@types/redux-persist)) = 4.3.1
|
|
|
404e11 |
Provides: bundled(npm(@types/redux-persist-transform-filter)) = 0.0.4
|
|
|
404e11 |
Provides: bundled(npm(babel-plugin-remove-object-properties)) = 1.0.2
|
|
|
404e11 |
Provides: bundled(npm(blueimp-md5)) = 2.18.0
|
|
|
404e11 |
Provides: bundled(npm(core-js)) = 1.2.7
|
|
|
404e11 |
Provides: bundled(npm(d3-flame-graph)) = 3.1.1
|
|
|
404e11 |
Provides: bundled(npm(d3-selection)) = 1.4.1
|
|
|
404e11 |
Provides: bundled(npm(emotion)) = 10.0.27
|
|
|
404e11 |
Provides: bundled(npm(enzyme)) = 3.11.0
|
|
|
404e11 |
Provides: bundled(npm(enzyme-adapter-react-16)) = 1.15.5
|
|
|
404e11 |
Provides: bundled(npm(eslint-plugin-prettier)) = 3.1.4
|
|
|
404e11 |
Provides: bundled(npm(jest)) = 25.5.4
|
|
|
404e11 |
Provides: bundled(npm(jest-date-mock)) = 1.0.8
|
|
|
404e11 |
Provides: bundled(npm(jest-puppeteer)) = 4.4.0
|
|
|
404e11 |
Provides: bundled(npm(lodash)) = 4.17.19
|
|
|
404e11 |
Provides: bundled(npm(loglevel)) = 1.7.0
|
|
|
404e11 |
Provides: bundled(npm(loglevel-plugin-prefix)) = 0.8.4
|
|
|
404e11 |
Provides: bundled(npm(memoize-one)) = 4.1.0
|
|
|
404e11 |
Provides: bundled(npm(monaco-editor)) = 0.20.0
|
|
|
404e11 |
Provides: bundled(npm(monaco-editor-webpack-plugin)) = 2.0.0
|
|
|
404e11 |
Provides: bundled(npm(prettier)) = 1.19.1
|
|
|
404e11 |
Provides: bundled(npm(prettier-plugin-organize-imports)) = 1.1.1
|
|
|
404e11 |
Provides: bundled(npm(puppeteer)) = 5.5.0
|
|
|
404e11 |
Provides: bundled(npm(react-autosuggest)) = 10.0.3
|
|
|
404e11 |
Provides: bundled(npm(react-monaco-editor)) = 0.36.0
|
|
|
404e11 |
Provides: bundled(npm(react-redux)) = 7.2.2
|
|
|
404e11 |
Provides: bundled(npm(react-use)) = 15.3.4
|
|
|
404e11 |
Provides: bundled(npm(redux)) = 3.7.2
|
|
|
404e11 |
Provides: bundled(npm(redux-persist)) = 4.10.2
|
|
|
404e11 |
Provides: bundled(npm(redux-thunk)) = 2.3.0
|
|
|
404e11 |
Provides: bundled(npm(ts-jest)) = 26.3.0
|
|
|
404e11 |
Provides: bundled(npm(utility-types)) = 3.10.0
|
|
|
2ae673 |
|
|
|
2ae673 |
|
|
|
2ae673 |
%description
|
|
|
2ae673 |
This Grafana plugin for Performance Co-Pilot includes datasources for
|
|
|
2ae673 |
scalable time series from pmseries(1) and Redis, live PCP metrics and
|
|
|
2ae673 |
bpftrace scripts from pmdabpftrace(1), as well as several dashboards.
|
|
|
2ae673 |
|
|
|
2ae673 |
%prep
|
|
|
404e11 |
%setup -q -T -D -b 0
|
|
|
404e11 |
%setup -q -T -D -b 1
|
|
|
404e11 |
%if %{compile_frontend} == 0
|
|
|
404e11 |
%setup -q -T -D -b 2
|
|
|
404e11 |
%endif
|
|
|
404e11 |
|
|
|
3d96d6 |
%patch1 -p1
|
|
|
2ae673 |
|
|
|
404e11 |
# Set up Go build subdir and links
|
|
|
404e11 |
mkdir -p %{_builddir}/src/github.com/performancecopilot
|
|
|
404e11 |
ln -s %{_builddir}/%{name}-%{version} \
|
|
|
404e11 |
%{_builddir}/src/github.com/performancecopilot/grafana-pcp
|
|
|
2ae673 |
|
|
|
404e11 |
|
|
|
404e11 |
%build
|
|
|
404e11 |
# Build frontend datasources
|
|
|
404e11 |
%if %{compile_frontend}
|
|
|
404e11 |
make dist-dashboards dist-frontend
|
|
|
2ae673 |
# webpack/copy-webpack-plugin sometimes outputs files with mode = 666 due to reasons unknown (race condition/umask issue afaics)
|
|
|
404e11 |
chmod -R g-w,o-w dist
|
|
|
404e11 |
%endif
|
|
|
404e11 |
|
|
|
404e11 |
# Build backend datasource
|
|
|
404e11 |
cd %{_builddir}/src/github.com/performancecopilot/grafana-pcp
|
|
|
404e11 |
export GOPATH=%{_builddir}
|
|
|
404e11 |
%gobuild -o dist/datasources/redis/pcp_redis_datasource_$(go env GOOS)_$(go env GOARCH) ./pkg
|
|
|
2ae673 |
|
|
|
2ae673 |
|
|
|
2ae673 |
%install
|
|
|
2ae673 |
install -d -m 755 %{buildroot}/%{install_dir}
|
|
|
2ae673 |
cp -a dist/* %{buildroot}/%{install_dir}
|
|
|
2ae673 |
|
|
|
404e11 |
%postun
|
|
|
404e11 |
# uninstall of old package
|
|
|
404e11 |
%systemd_postun_with_restart grafana-server.service
|
|
|
404e11 |
|
|
|
404e11 |
%posttrans
|
|
|
404e11 |
# install or upgrade of new package
|
|
|
404e11 |
if [ -x /usr/bin/systemctl ]; then
|
|
|
404e11 |
/usr/bin/systemctl try-restart grafana-server.service || :
|
|
|
404e11 |
fi
|
|
|
404e11 |
|
|
|
404e11 |
|
|
|
404e11 |
%check
|
|
|
404e11 |
# Test frontend datasources
|
|
|
404e11 |
%if %{compile_frontend}
|
|
|
404e11 |
yarn test
|
|
|
404e11 |
%endif
|
|
|
404e11 |
|
|
|
404e11 |
# Test backend datasource
|
|
|
404e11 |
cd %{_builddir}/src/github.com/performancecopilot/grafana-pcp
|
|
|
404e11 |
export GOPATH=%{_builddir}
|
|
|
404e11 |
%gotest ./pkg/...
|
|
|
404e11 |
|
|
|
404e11 |
|
|
|
2ae673 |
%files
|
|
|
2ae673 |
%{install_dir}
|
|
|
2ae673 |
|
|
|
2ae673 |
%license LICENSE NOTICE
|
|
|
2ae673 |
%doc README.md
|
|
|
2ae673 |
|
|
|
404e11 |
|
|
|
2ae673 |
%changelog
|
|
|
404e11 |
* Thu Nov 26 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 3.0.0-1
|
|
|
404e11 |
- update to 3.0.0 tagged upstream community sources, see CHANGELOG
|
|
|
404e11 |
- bundle golang dependencies and (optionally) node.js dependencies
|
|
|
404e11 |
|
|
|
cdf1dc |
* Fri Aug 07 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.2-3
|
|
|
cdf1dc |
- bpftrace: show process name and PID in flame graphs
|
|
|
cdf1dc |
|
|
|
3d96d6 |
* Fri Jul 24 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.2-2
|
|
|
3d96d6 |
- vector: do not show all cgroups in the container overview dashboard in case no containers are present on the system
|
|
|
3d96d6 |
|
|
|
1fc467 |
* Mon May 11 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.2-1
|
|
|
1fc467 |
- update to upstream version 2.0.2, see CHANGELOG
|
|
|
1fc467 |
|
|
|
2ae673 |
* Tue Jan 28 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-3
|
|
|
2ae673 |
- redis: pass correct timespec to pmproxy (fixes empty graphs for large time ranges)
|
|
|
2ae673 |
|
|
|
2ae673 |
* Tue Jan 07 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-2
|
|
|
2ae673 |
- redis: support wildcards in metric names
|
|
|
2ae673 |
- redis: fix legend and label support
|
|
|
2ae673 |
|
|
|
2ae673 |
* Mon Dec 16 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-1
|
|
|
2ae673 |
- upgrade to upstream 1.0.5
|
|
|
2ae673 |
- flame graphs: clean flame graph stacks every 5s (reduces CPU load)
|
|
|
2ae673 |
- general: implement PCP version checks
|
|
|
2ae673 |
- redis: set default sample interval to 60s (fixes empty graph borders)
|
|
|
2ae673 |
|
|
|
2ae673 |
* Mon Dec 16 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.3-2
|
|
|
2ae673 |
- remove node_modules/node-notifier directory from webpack (due to licensing issues)
|
|
|
2ae673 |
- upgrade copy-webpack-plugin, terser-webpack-plugin and remove uglifyjs-webpack-plugin to mitigate XSS vulnerability in serialize-javascript dependency
|
|
|
2ae673 |
|
|
|
2ae673 |
* Tue Nov 26 2019 Nathan Scott <nathans@redhat.com> 1.0.3-1
|
|
|
2ae673 |
- fix flame graph dependency (flamegraph.destroy error in javascript console)
|
|
|
2ae673 |
|
|
|
2ae673 |
* Tue Nov 12 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.2-1
|
|
|
2ae673 |
- handle counter wraps (overflows)
|
|
|
2ae673 |
- convert time based counters to time utilization
|
|
|
2ae673 |
- flame graphs: aggregate stack counts by selected time range in the Grafana UI
|
|
|
2ae673 |
- flame graphs: add option to hide idle stacks
|
|
|
2ae673 |
- vector: fix container dropdown in query editor
|
|
|
2ae673 |
- vector: remove container setting from datasource settings page
|
|
|
2ae673 |
- redis: fix value transformations (e.g. rate conversation of counters)
|
|
|
2ae673 |
- request more datapoints from the datasource to fill the borders of the graph panel
|
|
|
2ae673 |
|
|
|
2ae673 |
* Fri Oct 11 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.0-1
|
|
|
2ae673 |
- bpftrace: support for Flame Graphs
|
|
|
2ae673 |
- bpftrace: context-sensitive auto completion for bpftrace probes, builtin variables and functions incl. help texts
|
|
|
2ae673 |
- bpftrace: parse output of bpftrace scripts (e.g. using `printf()`) as CSV and display it in the Grafana table panel
|
|
|
2ae673 |
- bpftrace: sample dashboards (BPFtrace System Analysis, BPFtrace Flame Graphs)
|
|
|
2ae673 |
- vector: table output: show instance name in left column
|
|
|
2ae673 |
- vector: table output: support non-matching instance names (cells of metrics which don't have the specific instance will be blank)
|
|
|
2ae673 |
- vector & bpftrace: if the metric/script gets changed in the query editor, immeditately stop polling the old metric/deregister the old script
|
|
|
2ae673 |
- vector & bpftrace: improve pmwebd compatibility
|
|
|
2ae673 |
- misc: help texts for all datasources (visible with the **[ ? ]** button in the query editor)
|
|
|
2ae673 |
- misc: renamed PCP Live to PCP Vector
|
|
|
2ae673 |
- misc: logos for all datasources
|
|
|
2ae673 |
- misc: improved error handling
|
|
|
2ae673 |
|
|
|
2ae673 |
* Fri Aug 16 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 0.0.7-1
|
|
|
2ae673 |
- converted into a Grafana app plugin, renamed to grafana-pcp
|
|
|
2ae673 |
- redis: support for instance domains, labels, autocompletion, automatic rate conversation
|
|
|
2ae673 |
- live and bpftrace: initial commit of datasources
|
|
|
2ae673 |
|
|
|
2ae673 |
* Tue Jun 11 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.6-1
|
|
|
2ae673 |
- renamed package to grafana-pcp-redis, updated README, etc
|
|
|
2ae673 |
|
|
|
2ae673 |
* Wed Jun 05 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.5-1
|
|
|
2ae673 |
- renamed package to grafana-pcp-datasource, README, etc
|
|
|
2ae673 |
|
|
|
2ae673 |
* Fri May 17 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.4-1
|
|
|
2ae673 |
- add suggested pmproxy URL in config html
|
|
|
2ae673 |
- updated instructions and README.md now that grafana is in Fedora
|
|
|
2ae673 |
|
|
|
2ae673 |
* Fri Apr 12 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.3-1
|
|
|
2ae673 |
- require grafana v6.1.3 or later
|
|
|
2ae673 |
- install directory is now below /var/lib/grafana/plugins
|
|
|
2ae673 |
|
|
|
2ae673 |
* Wed Mar 20 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.2-1
|
|
|
2ae673 |
- initial version
|