The Java Pyroscope agent does not use `pyroscope.application.name ` when profiling Gradle assemblies
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java
- Lĩnh vực
- build-system, observability
Hướng nghiên cứu
Bắt đầu với cấu hình gradle.properties và hành vi của Java Pyroscope agent khi Gradle truyền org.gradle.jvmargs cho daemon của nó. Tái hiện bằng gradle clean build --no-daemon và kiểm tra ứng dụng kết quả trong Pyroscope UI. Được xem là hoàn tất khi bản build báo cáo my-application với các tag env=prod và version=1.0 thay vì một tên được tự động tạo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem description
When trying to profile a Gradle project build using the Java Pyroscope agent, the application name that is set in the gradle.properties file via the system property -Dpyroscope.application.name , is not recognized and is not applied. Instead of the custom name specified in the configuration, the automatically generated default name is displayed in the Pyroscope user interface.
Expected behavior:
It is expected that after the Gradle build is completed with the java agent configured, an application with the name my-application and the corresponding tags {env=prod,version=1.0}, as it was specified in `gradle.properties'.
Current (actual) behavior:
In the Pyroscope user interface, instead of the expected name my-application, an automatically generated name is displayed, in this case javaspy.WeChRaEsRvWcEjq93mpGGg. This indicates that the agent is running and sending data, but it cannot correctly determine or apply the application name from the JVM arguments passed to the Gradle daemon.
As you can see in the attached screenshot, there is no my-application in the list of applications.
Steps to reproduce
To reproduce the problem, follow these steps::
- Installing and configuring the Gradle environment:
- Downloading the Gradle distribution:
wget https://services.gradle.org/distributions/gradle-8.14.2-bin.zip
- Creating a directory and unpacking an archive:
mkdir /opt/gradle
unzip -d /opt/gradle gradle-8.14.2-bin.zip
- Setting up the environment variable
PATH:
export PATH=$PATH:/opt/gradle/gradle-8.14.2/bin
- Creating a Gradle test project:
mkdir gradle-profiling-example
cd gradle-profiling-example
gradle init --type java-application --dsl kotlin --test-framework junit-jupiter --project-name simple-app --package com.example
- Loading the Java Pyroscope agent:
- The agent is loaded into the Gradle daemon cache directory to be accessible to the daemon JVM.
wget -O /home/user/.gradle/daemon/8.14.2/pyroscope.jar https://github.com/grafana/pyroscope-java/releases/download/v2.1.2/pyroscope.jar
- Note: The path is
/home/user/.gradle/daemon/8.14.2/may vary depending on the user and the version of Gradle.
- Launching the Pyroscope server:
- A
docker-compose' file is created.ymlin the root of the project with the following contents:
version: '3.8'
services:
pyroscope:
image: grafana/pyroscope:main-8c89229
ports:
- "4040:4040"
command:
- "server"
- The container starts:
docker-compose up -d
- Gradle configuration for profiling:
- The
gradle.propertiesfile is created or edited in the root of the project with the following content, where the JVM arguments for the Gradle daemon are specified:
# JVM arguments for Gradle Daemon
org.gradle.jvmargs=-javaagent:pyroscope.jar -Dpyroscope.application.name=my-application{env=prod,version=1.0} -Dpyroscope.server.address=http://localhost:4040 -Dpyroscope.profile=cpu,alloc,lock,network,wall
- Important:
pyroscope.jarmust be in a path accessible by the Gradle daemon. In this case, it was placed in his cache.
- Launching the profiled build:
- The project is being built. The '--no-daemon
flag is used to ensure that a new Gradle daemon is started that picks up arguments fromgradle.properties'.
gradle clean build --no-daemon
After completing these steps, when going to the Pyroscope web interface (http://localhost:4040 ) the problem described above is observed.
- Ngôn ngữ chính
- Java
- Star
- 125
- Fork
- 48
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của grafana/pyroscope-java
-
Clean up dead publishing repository config and credentials in subproject build filesCó thể đã có người làm @arnabnandy7 đã nhận 23 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
grafana/pyroscope-java#294 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
grafana/pyroscope-java#371 · 2 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
grafana/pyroscope-java#368 · 1 bình luận ·
-
improve asprof extractionĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
grafana/pyroscope-java#283 ·
-
libasyncProfiler-linux-x64.so dump in /tmpCó thể làm lại được @korniltsev-grafanista đã nhận 261 ngày trước và không có pull request nào đang mở. Đang mở
grafana/pyroscope-java#250 · 1 bình luận · 1 người được giao ·
Tất cả issue của grafana/pyroscope-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/rocketmq-dashboard#6716 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
DefaultRedisList.get(int) does not reject an index equal to the list sizeCó thể đã có người làm @ryujungkyun đã nhận hôm nay. Đang mởstatus: waiting-for-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
spring-projects/spring-data-redis#3471 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
:maddi-inspection-kotlin:test runs out of heap in a full maddi test run; exit 1 with no failing testĐang mởbuild/ci front-end:kotlin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
uwolfer/gerrit-intellij-plugin#768 ·
Maintainer thường phản hồi trong vòng 1 ngày