The Java Pyroscope agent does not use `pyroscope.application.name ` when profiling Gradle assemblies
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- build-system, observability
Direzione di ricerca
Inizia dalla configurazione di gradle.properties e dal comportamento del Java Pyroscope agent quando Gradle passa org.gradle.jvmargs al suo daemon. Riproduci il problema con gradle clean build --no-daemon e ispeziona l'applicazione risultante nella Pyroscope UI. Il lavoro è completato quando la build riporta my-application con i tag env=prod e version=1.0 invece di un nome generato automaticamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 124
- Fork
- 50
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di grafana/pyroscope-java
-
Clean up dead publishing repository config and credentials in subproject build filesForse già presa @arnabnandy7 l’ha presa 29 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
grafana/pyroscope-java#294 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
grafana/pyroscope-java#371 · 2 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
grafana/pyroscope-java#368 · 1 commento ·
-
improve asprof extractionAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
grafana/pyroscope-java#283 ·
-
libasyncProfiler-linux-x64.so dump in /tmpForse di nuovo libera @korniltsev-grafanista l’ha presa 268 giorni fa e non c’è nessuna pull request aperta. Aperta
grafana/pyroscope-java#250 · 1 commento · 1 assegnatario ·
Tutte le issue di grafana/pyroscope-java
Issue simili
-
enhancement web-ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
jenkinsci/jenkins#27583 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/rocketmq-dashboard#7302 ·
I maintainer di solito rispondono entro 3 giorni
-
area: android good first issue help wanted testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Gautam-aman/ResQNet#56 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation hermes-queue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
chrisalunlloyd2-sudo/mindpalace#294 ·
I maintainer di solito rispondono entro 1 giorno