Skip to content

Conversation

korniltsev-grafanista
Copy link
Contributor

@korniltsev-grafanista korniltsev-grafanista commented Sep 17, 2025

  • Decouple ExtractDistributions from asprof.Profiler
  • Remove asprof.Profiler alltogether - after decoupling archive extraction logic, turns out it does nothing - use asprof.Distribution instead everywhere.
  • Add an undocumented argument to use a custom asprof distribution - useful for cases when there is a fix for some problem upstream, but alloy has not been updated yet, so users could have a workaround without waiting for pyroscope to update the asprof within the alloy. Also useful for development - clone asprof, run make, point alloy to the build dir.
  • Update playground to allow Java profiling

This is for the next release, we should wait before RC is cut

Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@aleks-p aleks-p left a comment

Choose a reason for hiding this comment

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

Looks good to me. I left a few minor remarks, none of them blocking.

TmpDir string `alloy:"tmp_dir,attr,optional"`
ProfilingConfig ProfilingConfig `alloy:"profiling_config,block,optional"`

// undocumented
Copy link
Contributor

Choose a reason for hiding this comment

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

is the plan to document this at a later time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it would be nice if there was a notion of experimental configuration. I am just scared to commiting to maintain this. We can document it / make it public separately.

format int
}

func (a *Archive) SHA1() string {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we make this private?

dist asprof.Distribution
err error
)
if a.Dist != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add some logging here to know if we are running with an embedded or a custom distribution?

korniltsev-grafanista and others added 3 commits October 9, 2025 21:22
* pyroscope.java: add integration tests

fix package name

Revert "pyroscope.java: Fix java log level parameter (#4440)"

This reverts commit 4909877.

move the helper to pyroscope package

* second integration test

* revert compose tests

* revert unneeded changes

* fix buildtag

* fix buildtag

* improve start time for pyroscope container

* skip integration test if it's not pyoroscope job

* update makefile

* pyroscope.java: Fix java log level parameter (#4440)

* pyroscope.java: Fix java log level parameter

The version bundled of the async profiler has no loglevel parameter:

```
ts=2025-09-16T08:16:50.898924708Z level=error component_path=/profiling.feature component_id=pyroscope.java.java_pods pid=1184752 err="failed to start: asprof failed to run: asprof failed to run /tmp/alloy-asprof-ae0261b1093f2bc4df44a87300fef98dcdebccb5/bin/asprof: exit status 1  Unrecognized option: --loglevel\n"
```

* Quiet is not a valid argument for the async-profiler cli

It can only be used for attaching using agent

* remove comments

* fix

---------

Co-authored-by: Christian Simon <[email protected]>
@korniltsev-grafanista korniltsev-grafanista requested a review from a team as a code owner October 9, 2025 14:26
@korniltsev-grafanista korniltsev-grafanista enabled auto-merge (squash) October 9, 2025 14:26
@korniltsev-grafanista korniltsev-grafanista merged commit 612bbb3 into main Oct 9, 2025
41 checks passed
@korniltsev-grafanista korniltsev-grafanista deleted the korniltsev/refactor-java-extraction branch October 9, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants