Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 20240626_add-collec…
Browse files Browse the repository at this point in the history
…tion-rules-handling
  • Loading branch information
simonswine committed Aug 12, 2024
2 parents fef95be + 1fafaea commit bd29190
Show file tree
Hide file tree
Showing 209 changed files with 3,859 additions and 3,943 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.21.11"
go-version: "1.21.12"
cache: true
- run: yarn --frozen-lockfile
- run: make build
Expand Down Expand Up @@ -55,12 +55,12 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.21.11"
go-version: "1.21.12"
cache: true
- run: yarn --frozen-lockfile
- run: make build
- name: run nginx with /foobar/
run: docker-compose -f scripts/base-url/docker-compose.yaml up -d
run: docker compose -f scripts/base-url/docker-compose.yaml up -d
- name: Cypress run
uses: cypress-io/github-action@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.11
go-version: 1.21.12
- name: Run Fuzz_Merge_Single
run: go test -fuzz=Fuzz_Merge_Single --fuzztime 1h -run '^$' -v ./pkg/pprof/
3 changes: 1 addition & 2 deletions .github/workflows/helm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ jobs:
call-lint:
uses: grafana/helm-charts/.github/workflows/linter.yml@main
with:
filter_regex_include: .*operations/pyroscope/helm/.*
filter_regex_include: operations/pyroscope/helm/pyroscope/templates/.*

call-lint-test:
uses: grafana/helm-charts/.github/workflows/lint-test.yaml@main
with:
ct_configfile: operations/pyroscope/helm/ct.yaml
ct_check_version_increment: false
helm_version: v3.14.3
kubeVersion: "1.23"
2 changes: 1 addition & 1 deletion .github/workflows/publish-technical-documentation-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: "actions/checkout@v3"
- name: "Build website"
run: |
docker run -v ${PWD}/docs/sources:/hugo/content/docs/phlare/latest -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
docker run -v ${PWD}/docs/sources:/hugo/content/docs/pyroscope/latest -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
sync:
runs-on: "ubuntu-latest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: "actions/checkout@v3"
- name: "Build website"
run: |
docker run -v ${PWD}/docs/sources:/hugo/content/docs/phlare/latest -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
docker run -v ${PWD}/docs/sources:/hugo/content/docs/pyroscope/latest -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
sync:
runs-on: "ubuntu-latest"
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/pyrobench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on: issue_comment

jobs:
pyrobench:
name: Run Pyrobench on demand by PR comment
if: ${{ (github.event.issue.pull_request) && contains(github.event.comment.body, '@pyrobench') }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Pyrobench
uses: grafana/pyrobench@main
with:
github_context: ${{ toJson(github) }}
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: "1.21.11"
go-version: "1.21.12"
cache: true
- uses: actions/setup-node@v3
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.11
go-version: 1.21.12
- name: Format
run: make fmt check/unstaged-changes
test:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.11
go-version: 1.21.12
- name: Go Mod
run: make check/go/mod
- name: Test
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.11
go-version: 1.21.12
- name: Run linter
run: make lint
- name: Check helm manifests
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Set up go
uses: actions/setup-go@v2
with:
go-version: 1.21.11
go-version: 1.21.12
- uses: actions/setup-node@v3
with:
node-version: lts/hydrogen
Expand All @@ -118,7 +118,7 @@ jobs:
- name: Set up go
uses: actions/setup-go@v2
with:
go-version: 1.21.11
go-version: 1.21.12
- uses: actions/setup-node@v3
with:
node-version: lts/hydrogen
Expand All @@ -132,7 +132,7 @@ jobs:
- name: Pyroscope Build & push multi-arch image
id: build-push
run: |
make docker-image/pyroscope/push "BUILDX_ARGS=--cache-from=type=gha --cache-to=type=gha"
make docker-image/pyroscope/push docker-image/pyroscope/push-debug "BUILDX_ARGS=--cache-from=type=gha --cache-to=type=gha"
deploy-dev-001:
if: github.event_name == 'push' && github.repository == 'grafana/pyroscope'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_ebpf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.11
go-version: 1.21.12
- name: Test
run: sudo make -C ./ebpf go/test/amd64
test_ebpf_qemu:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.11
go-version: 1.21.12
- name: Install qemu
run: sudo apt-get update && sudo apt-get -y install qemu-system-x86 qemu-system-aarch64
- name: Build tests
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/weekly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
run: echo "GORELEASER_CURRENT_TAG=v0.0.0-$(./tools/image-tag)" >> $GITHUB_ENV
- name: Set WEEKLY_IMAGE_TAG
run: echo "WEEKLY_IMAGE_TAG=$(./tools/image-tag)" >> $GITHUB_ENV
- name: Set GORELEASER_STRIP_DEBUG_INFO=false, so binaries are not stripped of debug info
run: echo "GORELEASER_STRIP_DEBUG_INFO=false" >> $GITHUB_ENV
# Forces goreleaser to use the correct previous tag for the changelog
- name: Set GORELEASER_PREVIOUS_TAG
run: echo "GORELEASER_PREVIOUS_TAG=$(git tag -l --sort=-version:refname | grep -E '^weekly-.*' | head -n 2 | tail -1)" >> $GITHUB_ENV
Expand All @@ -25,7 +27,7 @@ jobs:
git tag "$WEEKLY_IMAGE_TAG"
- uses: actions/setup-go@v3
with:
go-version: "1.21.11"
go-version: "1.21.12"
cache: true
# setup docker buildx
- name: Set up QEMU
Expand Down
29 changes: 6 additions & 23 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ version: 2
before:
hooks:
# This hook ensures that goreleaser uses the correct go version for a Pyroscope release
- sh -euc "go version | grep "go version go1.21.11 " || { echo "Unexpected go version"; exit 1; }"
- sh -euc 'go version | grep "go version go1.21.12 " || { echo "Unexpected go version"; exit 1; }'
env:
# Strip debug information from the binary by default, weekly builds will have debug information
- GORELEASER_DEBUG_INFO_FLAGS={{ if and (index .Env "GORELEASER_STRIP_DEBUG_INFO") (eq .Env.GORELEASER_STRIP_DEBUG_INFO "false") }}{{ else }}-s -w{{ end }}
builds:
- env:
- CGO_ENABLED=0
Expand All @@ -15,7 +18,6 @@ builds:
- arm64
- arm
goarm:
- "6"
- "7"
main: ./cmd/pyroscope
mod_timestamp: "{{ .CommitTimestamp }}"
Expand All @@ -26,7 +28,7 @@ builds:
- embedassets
ldflags:
- >
-extldflags "-static" -s -w
-extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
-X "github.com/grafana/pyroscope/pkg/util/build.Branch={{ .Branch }}"
-X "github.com/grafana/pyroscope/pkg/util/build.Version={{ .Version }}"
-X "github.com/grafana/pyroscope/pkg/util/build.Revision={{ .ShortCommit }}"
Expand All @@ -38,7 +40,7 @@ builds:
- netgo
ldflags:
- >
-extldflags "-static" -s -w
-extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
-X "github.com/grafana/pyroscope/pkg/util/build.Branch={{ .Branch }}"
-X "github.com/grafana/pyroscope/pkg/util/build.Version={{ .Version }}"
-X "github.com/grafana/pyroscope/pkg/util/build.Revision={{ .ShortCommit }}"
Expand All @@ -52,7 +54,6 @@ builds:
- arm64
- arm
goarm:
- "6"
- "7"
ignore:
- goos: windows
Expand Down Expand Up @@ -97,22 +98,6 @@ dockers:
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- use: buildx
goos: linux
goarch: arm
goarm: "6"
extra_files:
- cmd/pyroscope/pyroscope.yaml
dockerfile: ./cmd/pyroscope/Dockerfile
image_templates:
- "grafana/{{ .ProjectName }}:{{ .Version }}-armv6"
- "grafana/{{ .ProjectName }}:latest-armv6"
build_flag_templates:
- "--platform=linux/arm/v6"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- use: buildx
goos: linux
goarch: arm
Expand All @@ -135,13 +120,11 @@ docker_manifests:
image_templates:
- grafana/{{ .ProjectName }}:{{ .Version }}-amd64
- grafana/{{ .ProjectName }}:{{ .Version }}-arm64v8
- grafana/{{ .ProjectName }}:{{ .Version }}-armv6
- grafana/{{ .ProjectName }}:{{ .Version }}-armv7
- name_template: grafana/{{ .ProjectName }}:latest
image_templates:
- grafana/{{ .ProjectName }}:latest-amd64
- grafana/{{ .ProjectName }}:latest-arm64v8
- grafana/{{ .ProjectName }}:latest-armv6
- grafana/{{ .ProjectName }}:latest-armv7
nfpms:
- id: pyroscope
Expand Down
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ build: frontend/build go/bin ## Do a production build (requiring the frontend bu
build-dev: ## Do a dev build (without requiring the frontend)
$(MAKE) EMBEDASSETS="" go/bin

.PHONY: frontend/build
frontend/build: frontend/deps ## Do a production build for the frontend
yarn build

.PHONY: frontend/deps
frontend/deps:
yarn --frozen-lockfile
.PHONY: frontend/build
frontend/build:
docker build -f cmd/pyroscope/frontend.Dockerfile --output=public/build .

.PHONY: release
release/prereq: $(BIN)/goreleaser ## Ensure release pre requesites are met
Expand Down Expand Up @@ -165,7 +162,7 @@ check/go/mod: go/mod


define docker_buildx
docker buildx build $(1) --platform $(IMAGE_PLATFORM) $(BUILDX_ARGS) --build-arg=revision=$(GIT_REVISION) -t $(IMAGE_PREFIX)$(shell basename $(@D)) -t $(IMAGE_PREFIX)$(shell basename $(@D)):$(IMAGE_TAG) -f cmd/$(shell basename $(@D))/$(2)Dockerfile .
docker buildx build $(1) --platform $(IMAGE_PLATFORM) $(BUILDX_ARGS) --build-arg=revision=$(GIT_REVISION) -t $(IMAGE_PREFIX)$(shell basename $(@D)):$(2)latest -t $(IMAGE_PREFIX)$(shell basename $(@D)):$(2)$(IMAGE_TAG) -f cmd/$(shell basename $(@D))/$(2)Dockerfile .
endef

define deploy
Expand All @@ -191,6 +188,12 @@ docker-image/pyroscope/build-debug: GOARCH=amd64
docker-image/pyroscope/build-debug: frontend/build go/bin-debug $(BIN)/linux_amd64/dlv
$(call docker_buildx,--load,debug.)

.PHONY: docker-image/pyroscope/push-debug
docker-image/pyroscope/push-debug: GOOS=linux
docker-image/pyroscope/push-debug: GOARCH=amd64
docker-image/pyroscope/push-debug: frontend/build go/bin-debug $(BIN)/linux_amd64/dlv
$(call docker_buildx,--push,debug.)

.PHONY: docker-image/pyroscope/build
docker-image/pyroscope/build: GOOS=linux
docker-image/pyroscope/build: GOARCH=amd64
Expand Down Expand Up @@ -260,11 +263,11 @@ $(BIN)/buf: Makefile

$(BIN)/golangci-lint: Makefile
@mkdir -p $(@D)
GOBIN=$(abspath $(@D)) $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.2
GOBIN=$(abspath $(@D)) $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1

$(BIN)/protoc-gen-go: Makefile go.mod
@mkdir -p $(@D)
GOBIN=$(abspath $(@D)) $(GO) install google.golang.org/protobuf/cmd/[email protected].1
GOBIN=$(abspath $(@D)) $(GO) install google.golang.org/protobuf/cmd/[email protected].2

$(BIN)/protoc-gen-connect-go: Makefile go.mod
@mkdir -p $(@D)
Expand Down Expand Up @@ -327,7 +330,7 @@ $(BIN)/gotestsum: Makefile go.mod
@mkdir -p $(@D)
GOBIN=$(abspath $(@D)) $(GO) install gotest.tools/[email protected]

DLV_VERSION=v1.21.0
DLV_VERSION=v1.23.0

$(BIN)/dlv: Makefile go.mod
@mkdir -p $(@D)
Expand Down Expand Up @@ -357,7 +360,7 @@ helm/lint: $(BIN)/helm
$(BIN)/helm lint ./operations/pyroscope/helm/pyroscope/

helm/docs: $(BIN)/helm
docker run --rm --volume "$(CURDIR)/operations/pyroscope/helm:/helm-docs" -u "$(shell id -u)" jnorwood/helm-docs:v1.13.1
docker run --rm --volume "$(CURDIR)/operations/pyroscope/helm:/helm-docs" -u "$(shell id -u)" jnorwood/helm-docs:v1.8.1

.PHONY: goreleaser/lint
goreleaser/lint: $(BIN)/goreleaser
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Grafana Pyroscope is an open source continuous profiling platform. It will help
* Understand the call tree of your application
* Auto-instrument your code to link profiling data to traces

## 🔥 [Pyroscope Live Demo](https://demo.pyroscope.io/) 🔥
## 🔥 [Pyroscope Live Demo](https://play.grafana.org/a/grafana-pyroscope-app/)

[![Pyroscope GIF Demo](https://user-images.githubusercontent.com/23323466/143324845-16ff72df-231e-412d-bd0a-38ef2e09cba8.gif)](https://demo.pyroscope.io/)

Expand Down Expand Up @@ -116,20 +116,15 @@ For more information on how to use Pyroscope with other programming languages, i

You can download the latest version of pyroscope for macOS, linux and Docker from our [Releases page](https://github.com/grafana/pyroscope/releases).

## Supported Languages
## [Supported Languages][supported languages]

* [x] Go (via `pprof`)
* [x] Python (via `py-spy`)
* [x] Ruby (via `rbspy`)
* [x] Linux eBPF
* [x] Java (via `async-profiler`)
* [x] Rust (via `pprof-rs`)
* [x] .NET
* [x] PHP (via `phpspy`)
* [x] Node
Our documentation contains the most recent list of [supported languages] and also an overview over what [profiling types are supported per language][profile-types-languages].

Let us know what other integrations you want to see in [our issues](https://github.com/grafana/pyroscope/issues?q=is%3Aissue+is%3Aopen+label%3Anew-profilers) or in [our slack](https://slack.grafana.com).

[supported languages]: https://grafana.com/docs/pyroscope/latest/configure-client/
[profile-types-languages]: https://grafana.com/docs/pyroscope/latest/view-and-analyze-profile-data/profiling-types/#available-profiling-types

## Credits

Pyroscope is possible thanks to the excellent work of many people, including but not limited to:
Expand Down
Loading

0 comments on commit bd29190

Please sign in to comment.