Skip to content

Commit

Permalink
chore: update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
korniltsev committed Apr 9, 2024
1 parent 71e2fbd commit 4a8d1e5
Show file tree
Hide file tree
Showing 20 changed files with 56 additions and 53 deletions.
4 changes: 2 additions & 2 deletions docs/sources/configure-client/language-sdks/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ First, add the Pyroscope dependency:
<dependency>
<groupId>io.pyroscope</groupId>
<artifactId>agent</artifactId>
<version>0.13.0</version>
<version>0.13.1</version>
</dependency>
```

```gradle
implementation("io.pyroscope:agent:0.13.0")
implementation("io.pyroscope:agent:0.13.1")
```

{{< /code >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.7 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1389,8 +1389,9 @@ github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF
github.com/grafana/otel-profiling-go v0.5.1/go.mod h1:ftN/t5A/4gQI19/8MoWurBEtC6gFw8Dns1sJZ9W4Tls=
github.com/grafana/pyroscope-go v1.1.1 h1:PQoUU9oWtO3ve/fgIiklYuGilvsm8qaGhlY4Vw6MAcQ=
github.com/grafana/pyroscope-go v1.1.1/go.mod h1:Mw26jU7jsL/KStNSGGuuVYdUq7Qghem5P8aXYXSXG88=
github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo=
github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE=
github.com/grafana/pyroscope-go/godeltaprof v0.1.7 h1:C11j63y7gymiW8VugJ9ZW0pWfxTZugdSJyC48olk5KY=
github.com/grafana/pyroscope-go/godeltaprof v0.1.7/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ go 1.17
require github.com/grafana/pyroscope-go v1.1.1

require (
github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.7 // indirect
github.com/klauspost/compress v1.17.3 // indirect
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
github.com/grafana/pyroscope-go v1.1.1 h1:PQoUU9oWtO3ve/fgIiklYuGilvsm8qaGhlY4Vw6MAcQ=
github.com/grafana/pyroscope-go v1.1.1/go.mod h1:Mw26jU7jsL/KStNSGGuuVYdUq7Qghem5P8aXYXSXG88=
github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo=
github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE=
github.com/grafana/pyroscope-go/godeltaprof v0.1.7 h1:C11j63y7gymiW8VugJ9ZW0pWfxTZugdSJyC48olk5KY=
github.com/grafana/pyroscope-go/godeltaprof v0.1.7/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE=
github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA=
github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
2 changes: 1 addition & 1 deletion examples/language-sdk-instrumentation/java/fib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /opt/app

RUN apt-get update && apt-get install ca-certificates -y && update-ca-certificates && apt-get install -y git

ADD https://github.com/grafana/pyroscope-java/releases/download/v0.13.0/pyroscope.jar /opt/app/pyroscope.jar
ADD https://github.com/grafana/pyroscope-java/releases/download/v0.13.1/pyroscope.jar /opt/app/pyroscope.jar

COPY Main.java ./

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ COPY --from=builder /opt/app/build/libs/rideshare-1.0-SNAPSHOT.jar /opt/app/buil

WORKDIR /opt/app

ADD https://github.com/grafana/pyroscope-java/releases/download/v0.13.0/pyroscope.jar /opt/app/pyroscope.jar
ADD https://github.com/grafana/pyroscope-java/releases/download/v0.13.1/pyroscope.jar /opt/app/pyroscope.jar

CMD sh -c "exec java -Dserver.port=${RIDESHARE_LISTEN_PORT} -javaagent:pyroscope.jar -jar ./build/libs/rideshare-1.0-SNAPSHOT.jar"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}

dependencies {
implementation("io.pyroscope:agent:0.13.0")
implementation("io.pyroscope:agent:0.13.1")
implementation("org.springframework.boot:spring-boot-starter-web")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM openjdk:11.0.11-jdk

WORKDIR /opt/app

ADD https://github.com/grafana/pyroscope-java/releases/download/v0.13.0/pyroscope.jar /opt/app/pyroscope.jar
ADD https://github.com/grafana/pyroscope-java/releases/download/v0.13.1/pyroscope.jar /opt/app/pyroscope.jar

COPY Main.java ./Main.java
RUN javac Main.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Django==3.2.25
djangorestframework==3.12.4
gunicorn==20.1.0
psycopg2-binary==2.9.1
pyroscope-io==0.8.5
pyroscope-io==0.8.6
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.9

RUN pip3 install fastapi pyroscope-io==0.8.5 uvicorn[standard]
RUN pip3 install fastapi pyroscope-io==0.8.6 uvicorn[standard]

ENV FLASK_ENV=development
ENV PYTHONUNBUFFERED=1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.9

RUN pip3 install flask pyroscope-io==0.8.5
RUN pip3 install flask pyroscope-io==0.8.6

ENV FLASK_ENV=development
ENV PYTHONUNBUFFERED=1
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyroscope-io==0.8.5
pyroscope-io==0.8.6
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "https://rubygems.org"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# gem "rails"
gem 'pyroscope', '= 0.5.10'
gem 'pyroscope', '= 0.5.11'
gem "sinatra", "~> 2.1"

gem "thin", "~> 1.8"
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ GEM
ffi (1.16.3)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
pyroscope (0.5.10-aarch64-linux)
pyroscope (0.5.11-aarch64-linux)
ffi
pyroscope (0.5.10-arm64-darwin)
pyroscope (0.5.11-arm64-darwin)
ffi
pyroscope (0.5.10-x86_64-linux)
pyroscope (0.5.11-x86_64-linux)
ffi
rack (2.2.8.1)
rack-protection (2.2.4)
Expand All @@ -33,7 +33,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
pyroscope (= 0.5.10)
pyroscope (= 0.5.11)
sinatra (~> 2.1)
thin (~> 1.8)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gem "sqlite3", "~> 1.4"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.6"

gem 'pyroscope', '= 0.5.10'
gem 'pyroscope', '= 0.5.11'

gem "pyroscope-otel", "~> 0.1.1"
gem 'opentelemetry-sdk', "~> 1.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ GEM
stringio
puma (5.6.8)
nio4r (~> 2.0)
pyroscope (0.5.10)
pyroscope (0.5.11)
ffi
pyroscope (0.5.10-aarch64-linux)
pyroscope (0.5.11-aarch64-linux)
ffi
pyroscope (0.5.10-arm64-darwin)
pyroscope (0.5.11-arm64-darwin)
ffi
pyroscope (0.5.10-x86_64-darwin)
pyroscope (0.5.11-x86_64-darwin)
ffi
pyroscope (0.5.10-x86_64-linux)
pyroscope (0.5.11-x86_64-linux)
ffi
pyroscope-otel (0.1.1)
opentelemetry-api (~> 1.1.0)
Expand Down Expand Up @@ -260,7 +260,7 @@ DEPENDENCIES
opentelemetry-instrumentation-rails
opentelemetry-sdk (~> 1.2.0)
puma (~> 5.6)
pyroscope (= 0.5.10)
pyroscope (= 0.5.11)
pyroscope-otel (~> 0.1.1)
rails (~> 7.0.8)
sprockets-rails
Expand Down
2 changes: 1 addition & 1 deletion examples/language-sdk-instrumentation/ruby/simple/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'pyroscope', '= 0.5.10'
gem 'pyroscope', '= 0.5.11'
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ GEM
remote: https://rubygems.org/
specs:
ffi (1.16.3)
pyroscope (0.5.10-aarch64-linux)
pyroscope (0.5.11-aarch64-linux)
ffi
pyroscope (0.5.10-arm64-darwin)
pyroscope (0.5.11-arm64-darwin)
ffi
pyroscope (0.5.10-x86_64-linux)
pyroscope (0.5.11-x86_64-linux)
ffi

PLATFORMS
Expand All @@ -15,7 +15,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
pyroscope (= 0.5.10)
pyroscope (= 0.5.11)

BUNDLED WITH
2.4.10
45 changes: 23 additions & 22 deletions tools/update_examples.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ func udpateDotnet() {

reDockerGlibc := regexp.MustCompile("COPY --from=pyroscope/pyroscope-dotnet:\\d+\\.\\d+\\.\\d+-glibc")
replDockerGlibc := fmt.Sprintf("COPY --from=pyroscope/pyroscope-dotnet:%s-glibc", last.version())
replaceInplace(reDockerGlibc, "examples/dotnet/fast-slow/Dockerfile", replDockerGlibc)
replaceInplace(reDockerGlibc, "examples/dotnet/rideshare/Dockerfile", replDockerGlibc)
replaceInplace(reDockerGlibc, "examples/dotnet/web-new/Dockerfile", replDockerGlibc)
replaceInplace(reDockerGlibc, "examples/language-sdk-instrumentation/dotnet/fast-slow/Dockerfile", replDockerGlibc)
replaceInplace(reDockerGlibc, "examples/language-sdk-instrumentation/dotnet/rideshare/Dockerfile", replDockerGlibc)
replaceInplace(reDockerGlibc, "examples/language-sdk-instrumentation/dotnet/web-new/Dockerfile", replDockerGlibc)
replaceInplace(reDockerGlibc, "docs/sources/configure-client/language-sdks/dotnet.md", replDockerGlibc)

reDockerMusl := regexp.MustCompile("COPY --from=pyroscope/pyroscope-dotnet:\\d+\\.\\d+\\.\\d+-musl")
replDockerMusl := fmt.Sprintf("COPY --from=pyroscope/pyroscope-dotnet:%s-musl", last.version())
replaceInplace(reDockerMusl, "examples/dotnet/fast-slow/musl.Dockerfile", replDockerMusl)
replaceInplace(reDockerMusl, "examples/dotnet/rideshare/musl.Dockerfile", replDockerMusl)
replaceInplace(reDockerMusl, "examples/language-sdk-instrumentation/dotnet/fast-slow/musl.Dockerfile", replDockerMusl)
replaceInplace(reDockerMusl, "examples/language-sdk-instrumentation/dotnet/rideshare/musl.Dockerfile", replDockerMusl)

reUrl := regexp.MustCompile("https://github\\.com/grafana/pyroscope-dotnet/releases/download/v\\d+\\.\\d+\\.\\d+-pyroscope/pyroscope.\\d+\\.\\d+\\.\\d+-glibc-x86_64.tar.gz")
replUrl := fmt.Sprintf("https://github.com/grafana/pyroscope-dotnet/releases/download/v%s-pyroscope/pyroscope.%s-glibc-x86_64.tar.gz", last.version(), last.version())
Expand All @@ -64,10 +64,10 @@ func updatePython() {

re := regexp.MustCompile("pyroscope-io==\\d+\\.\\d+\\.\\d+")
repl := fmt.Sprintf("pyroscope-io==%s", last.version())
replaceInplace(re, "examples/python/simple/requirements.txt", repl)
replaceInplace(re, "examples/python/rideshare/flask/Dockerfile", repl)
replaceInplace(re, "examples/python/rideshare/fastapi/Dockerfile", repl)
replaceInplace(re, "examples/python/rideshare/django/app/requirements.txt", repl)
replaceInplace(re, "examples/language-sdk-instrumentation/python/simple/requirements.txt", repl)
replaceInplace(re, "examples/language-sdk-instrumentation/python/rideshare/flask/Dockerfile", repl)
replaceInplace(re, "examples/language-sdk-instrumentation/python/rideshare/fastapi/Dockerfile", repl)
replaceInplace(re, "examples/language-sdk-instrumentation/python/rideshare/django/app/requirements.txt", repl)

}

Expand All @@ -78,13 +78,13 @@ func updateRuby() {

re := regexp.MustCompile("gem ['\"]pyroscope['\"].*")
repl := fmt.Sprintf("gem 'pyroscope', '= %s'", last.version())
replaceInplace(re, "examples/ruby/rideshare/Gemfile", repl)
replaceInplace(re, "examples/ruby/rideshare_rails/Gemfile", repl)
replaceInplace(re, "examples/ruby/simple/Gemfile", repl)
replaceInplace(re, "examples/language-sdk-instrumentation/ruby/rideshare/Gemfile", repl)
replaceInplace(re, "examples/language-sdk-instrumentation/ruby/rideshare_rails/Gemfile", repl)
replaceInplace(re, "examples/language-sdk-instrumentation/ruby/simple/Gemfile", repl)

s.sh("cd examples/ruby/rideshare && bundle update pyroscope")
s.sh("cd examples/ruby/rideshare_rails && bundle update pyroscope")
s.sh("cd examples/ruby/simple && bundle update pyroscope")
s.sh("cd examples/language-sdk-instrumentation/ruby/rideshare && bundle update pyroscope")
s.sh("cd examples/language-sdk-instrumentation/ruby/rideshare_rails && bundle update pyroscope")
s.sh("cd examples/language-sdk-instrumentation/ruby/simple && bundle update pyroscope")
}

func updateJava() {
Expand All @@ -93,14 +93,13 @@ func updateJava() {
fmt.Println(last)
reJarURL := regexp.MustCompile("https://github\\.com/grafana/pyroscope-java/releases/download/(v\\d+\\.\\d+\\.\\d+)/pyroscope\\.jar")
lastJarURL := "https://github.com/grafana/pyroscope-java/releases/download/" + last.versionV() + "/pyroscope.jar"
//ADD https://github.com/grafana/pyroscope-java/releases/download/v0.11.5/pyroscope.jar /opt/app/pyroscope.jar
replaceInplace(reJarURL, "examples/java/fib/Dockerfile", lastJarURL)
replaceInplace(reJarURL, "examples/java/simple/Dockerfile", lastJarURL)
replaceInplace(reJarURL, "examples/java/rideshare/Dockerfile", lastJarURL)
replaceInplace(reJarURL, "examples/language-sdk-instrumentation/java/fib/Dockerfile", lastJarURL)
replaceInplace(reJarURL, "examples/language-sdk-instrumentation/java/simple/Dockerfile", lastJarURL)
replaceInplace(reJarURL, "examples/language-sdk-instrumentation/java/rideshare/Dockerfile", lastJarURL)

reGradelDep := regexp.MustCompile("implementation\\(\"io\\.pyroscope:agent:\\d+\\.\\d+\\.\\d+\"\\)")
lastGradleDep := fmt.Sprintf("implementation(\"io.pyroscope:agent:%s\")", last.version())
replaceInplace(reGradelDep, "examples/java/rideshare/build.gradle.kts", lastGradleDep)
replaceInplace(reGradelDep, "examples/language-sdk-instrumentation/java/rideshare/build.gradle.kts", lastGradleDep)
replaceInplace(reGradelDep, "docs/sources/configure-client/language-sdks/java.md", lastGradleDep)

reMaven := regexp.MustCompile("<version>\\d+\\.\\d+\\.\\d+</version>")
Expand All @@ -123,6 +122,10 @@ func updateGodeltaprof() {
last := tags[len(tags)-1]
log.Println(last.tag.Name)
s.sh(" go get github.com/grafana/pyroscope-go/godeltaprof@" + last.versionV() + " && go mod tidy")
s.sh("cd ./examples/language-sdk-instrumentation/golang-push/rideshare && go get github.com/grafana/pyroscope-go/godeltaprof@" + last.versionV() +
" && go mod tidy")
s.sh("cd ./examples/language-sdk-instrumentation/golang-push/simple && go get github.com/grafana/pyroscope-go/godeltaprof@" + last.versionV() +
" && go mod tidy")
}

var s = sh{}
Expand All @@ -132,8 +135,6 @@ func updateGolang() {
last2 := tags[len(tags)-1]
last := last2
log.Println(last.tag.Name)
s.sh("cd ./examples/golang-push/rideshare && go get github.com/grafana/pyroscope-go@" + last.versionV() +
" && go mod tidy")
s.sh("cd ./examples/language-sdk-instrumentation/golang-push/rideshare && go get github.com/grafana/pyroscope-go@" + last.versionV() +
" && go mod tidy")
s.sh("cd ./examples/language-sdk-instrumentation/golang-push/simple && go get github.com/grafana/pyroscope-go@" + last.versionV() +
Expand Down

0 comments on commit 4a8d1e5

Please sign in to comment.