GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: configuration for custom temporary file paths by StevenCurran · Pull Request #340 · grafana/pyroscope-java

Conversation

@StevenCurran

@StevenCurran StevenCurran commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Support config driven locations for .jfr files and bootstrap jars to avoid them going into the /tmp dir for apps that want to control this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StevenCurran
StevenCurran requested review from a team as code owners July 22, 2026 00:51
@cla-assistant

cla-assistant Bot commented Jul 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cla-assistant

cla-assistant Bot commented Jul 22, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 22, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/BootstrapApiInjector.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread agent/src/test/java/io/pyroscope/javaagent/AsyncProfilerDelegateJfrDirTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread agent/src/main/java/io/pyroscope/javaagent/BootstrapApiInjector.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread agent/src/main/java/io/pyroscope/javaagent/BootstrapApiInjector.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 22, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/AsyncProfilerDelegate.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 22, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/util/JfrFileUtil.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StevenCurran StevenCurran mentioned this pull request Jul 22, 2026
Config to control location of pyroscope.jfr files #338
Closed
korniltsev-grafanista
korniltsev-grafanista reviewed Jul 22, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java Outdated
private static final String PYROSCOPE_HTTP_HEADERS = "PYROSCOPE_HTTP_HEADERS";
private static final String PYROSCOPE_TENANT_ID = "PYROSCOPE_TENANT_ID";
private static final String PYROSCOPE_PROFILE_EXPORT_TIMEOUT = "PYROSCOPE_PROFILE_EXPORT_TIMEOUT";
private static final String PYROSCOPE_JFR_DIR = "PYROSCOPE_JFR_DIR";

@korniltsev-grafanista korniltsev-grafanista Jul 22, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be called PYROSCOPE_TMP_DIR ? since it is used for both JFR and jar files

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StevenCurran reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@StevenCurran StevenCurran Jul 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cursor[bot]
cursor Bot reviewed Jul 22, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread agent/src/main/java/io/pyroscope/javaagent/JFRJCMDProfilerDelegate.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StevenCurran
StevenCurran force-pushed the feature/jfr-location-config branch from 3e9d69d to c7ea30a Compare July 22, 2026 11:25
cursor[bot]
cursor Bot reviewed Jul 22, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/JFRJCMDProfilerDelegate.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StevenCurran
StevenCurran force-pushed the feature/jfr-location-config branch from d9319b7 to 4be8edd Compare July 22, 2026 11:38
cursor[bot]
cursor Bot reviewed Jul 22, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/AsyncProfilerDelegate.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread agent/src/main/java/io/pyroscope/javaagent/BootstrapApiInjector.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StevenCurran

StevenCurran commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@korniltsev-grafanista let me know how this looks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@korniltsev-grafanista korniltsev-grafanista changed the title Add configuration for custom temporary file paths feat: configuration for custom temporary file paths Jul 23, 2026
korniltsev-grafanista
korniltsev-grafanista reviewed Jul 23, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java Outdated
private String basicAuthUser;
private String basicAuthPassword;
private String jfrProfilerSettings;
private String tmpDir;

@korniltsev-grafanista korniltsev-grafanista Jul 23, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please annotate tmp dir fields and args as Nullable where appropriate. I know its not done for all the fields, but I think it improves readability

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
korniltsev-grafanista
korniltsev-grafanista reviewed Jul 23, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/AsyncProfilerDelegate.java Outdated
this.format = config.format;

if (format == Format.JFR && null == tempJFRFile) {
if (config.tmpDir != null && config.tmpDir.contains(",")) {

@korniltsev-grafanista korniltsev-grafanista Jul 23, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this validation to config builder routines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
korniltsev-grafanista
korniltsev-grafanista requested changes Jul 23, 2026
View reviewed changes

@korniltsev-grafanista korniltsev-grafanista left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with few nits
thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StevenCurran reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@github-actions

github-actions Bot commented Jul 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Signed commits report

All 1 commit between main and feature/jfr-location-config have verified signatures. ✅

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 25, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StevenCurran
StevenCurran force-pushed the feature/jfr-location-config branch from cc7ecd6 to 4b71396 Compare July 25, 2026 00:08
cursor[bot]
cursor Bot reviewed Jul 25, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StevenCurran

StevenCurran commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

lgtm with few nits thanks

Sorry for delay, addressed and push. lmk if all good.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

korniltsev-grafanista
korniltsev-grafanista requested changes Jul 27, 2026
View reviewed changes

@korniltsev-grafanista korniltsev-grafanista left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please take a look at #340 (comment) report, it looks valid to me.

otherwise lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StevenCurran
StevenCurran force-pushed the feature/jfr-location-config branch from 4b71396 to 94bf6d6 Compare July 27, 2026 15:52
@StevenCurran

StevenCurran commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

please take a look at (earlier comment) report, it looks valid to me.

otherwise lgtm

Updated addressing this, with a test too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StevenCurran
StevenCurran requested a review from korniltsev-grafanista July 27, 2026 16:35
korniltsev-grafanista
korniltsev-grafanista reviewed Jul 28, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java Outdated
try {
resolved = Paths.get(tmpDir).toAbsolutePath().toString();
} catch (java.nio.file.InvalidPathException e) {
resolved = tmpDir; // invalid path is caught later in TmpFileUtil

@korniltsev-grafanista korniltsev-grafanista Jul 28, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand, why do we swallow it here and resurface somewhere else?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@StevenCurran StevenCurran Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, fixed when Path

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
korniltsev-grafanista
korniltsev-grafanista reviewed Jul 28, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/config/Config.java Outdated
public final String APExtraArguments;
public final String basicAuthUser;
public final String basicAuthPassword;
public final @Nullable String tmpDir;

@korniltsev-grafanista korniltsev-grafanista Jul 28, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make it Path ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StevenCurran reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@StevenCurran StevenCurran Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
korniltsev-grafanista
korniltsev-grafanista reviewed Jul 28, 2026
View reviewed changes
Comment thread agent/src/main/java/io/pyroscope/javaagent/util/TmpFileUtil.java Outdated
return createTempFile(config.tmpDir, "pyroscope", ".jfr");
}

public static File createTempFile(String dir, String prefix, String suffix) throws IOException {

@korniltsev-grafanista korniltsev-grafanista Jul 28, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nullable

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StevenCurran reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@StevenCurran StevenCurran Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StevenCurran
StevenCurran force-pushed the feature/jfr-location-config branch from 94bf6d6 to 3591c20 Compare July 28, 2026 23:29
cursor[bot]
cursor Bot reviewed Jul 28, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3591c20. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread agent/src/main/java/io/pyroscope/javaagent/BootstrapApiInjector.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StevenCurran
StevenCurran force-pushed the feature/jfr-location-config branch from 3591c20 to cad5b10 Compare July 28, 2026 23:44
@StevenCurran
StevenCurran requested a review from korniltsev-grafanista July 28, 2026 23:48
korniltsev-grafanista
korniltsev-grafanista approved these changes Jul 29, 2026
View reviewed changes
korniltsev-grafanista
korniltsev-grafanista requested changes Jul 29, 2026
View reviewed changes

@korniltsev-grafanista korniltsev-grafanista left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Last request. All contributions are required to sign their commits with gpg/ssh
https://community.grafana.com/t/action-required-signed-commits-mandatory-for-all-grafana-repositories/163404

I can't merge without this

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StevenCurran
StevenCurran force-pushed the feature/jfr-location-config branch 2 times, most recently from 1a87637 to d501ac8 Compare July 29, 2026 22:36
@StevenCurran
Config to supply a path for the files usually created in /tmp. This i…
f6dbc2c
…ncludes bootstream jar, and the .jfr files created by the agent delegates. Signed commit
@StevenCurran
StevenCurran force-pushed the feature/jfr-location-config branch from d501ac8 to f6dbc2c Compare July 29, 2026 22:37
@StevenCurran

StevenCurran commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

LGTM

Last request. All contributions are required to sign their commits with gpg/ssh community.grafana.com/t/action-required-signed-commits-mandatory-for-all-grafana-repositories/163404

I can't merge without this

I squashed the commits and sorted out the GPG key, commit is showing verified now!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

korniltsev-grafanista
korniltsev-grafanista approved these changes Jul 30, 2026
View reviewed changes
@korniltsev-grafanista
korniltsev-grafanista merged commit a008256 into grafana:main Jul 30, 2026
72 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@korniltsev-grafanista korniltsev-grafanista korniltsev-grafanista approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@StevenCurran @korniltsev-grafanista
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.