-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(harvester): add config for maxAge/maxSize for exit uploads #30
Conversation
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.
config: harvester period: 30 seconds, on-exit max-age: 1 minute
I tried viewing the uploaded on-exit recording to check the max-age limit that way, and it says that the recording is 6.8 minutes long. I assume it is checking the JFR recording metadata the archived recording is getting pieced from. Just something interesting to note. The recording exit data is about ~50 seconds long, when setting the max-age to PT1M.
Does the agent have knowledge of Cryostat templates? EDIT:
|
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.
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.
Update README with new config variables?
Yep, it does not support this - not yet, anyway. I don't know if I want the Agent to become aware of the existing Cryostat custom event templates that are stored and managed by Cryostat. I think what seems more idiomatic is for any such custom templates to be packaged together with the application that will also house the Agent (ex. included as a layer in the application Dockerfile). This way the template is available locally to the Agent and there is less need to transfer information over the network. Eventually if/when Cryostat can talk to the Agent to list event templates and start recordings on demand then it can do that based on the event templates that are available to the particular Agent instance. |
I think you are correct, this value comes from the difference between the recording start time in the recording metadata and the current timestamp. Pretty sure I've had this conversation with @tthvo before. The more accurate way to determine the recording length would be to actually parse the recording and find the minimum and maximum timestamps on each event in the recording, but that's a bit more intensive to do. |
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.
Works well. Looks good to me!
https://github.com/cryostatio/cryostat/blob/main/src/container/include/cryostat.jfc That's how Cryostat's own customized event template works, to show a concrete example. This is probably better anyway because if there are application-specific custom events registered in the application's source code, then there should also be customizations to the event template |
Fixes #23
Usual test instructions.
mvn install
this PR.cd quarkus-test ; ./mvnw -U clean package && podman build -t quay.io/andrewazores/quarkus-test:latest -f src/main/docker/Dockerfile.jvm . ; podman image prune -f
cd cryostat ; sh smoketest.sh
Modify
smoketest.sh
to suit, for example:The Agent should periodically (every 30s with this config) push files into the Cryostat general archives. The file sizes will vary, but in my testing they range between ~350 and ~700 KB.
Then do
podman stop quarkus-test-agent-1
to explicitly stop the container. This passes theSIGTERM
to the JVM, triggering the Agent to perform the exit upload. This should cause a localSnapshot
to be taken, dumped, and closed (closure observable in logs), and those contents uploaded to the archives. ThemaxSize
JFR setting does not work as may be expected when the configured size is smaller than each individual recording chunk, so using this setting with a smaller limit will only force the upload of the single most recent chunk I believe. The harvester period and template can be experimented with to generate larger recordings so that the exit maxSize may have a more noticeable practical effect.File compression support mentioned in the issue is not implemented here because it is not (yet) supported by the backend.