-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix(labels): map recording labels to unique jvm id #971
Conversation
147d285
to
9253205
Compare
@andrewazores I had some questions about handling the cryostat-defined labels
|
doPutMetadata(metadata: {
labels: [
{
"key": "template.name",
"value": "Continuous"
},
{
"key": "template.type",
"value": "TARGET"
},
]
}) You could also do something like this: doPutMetadata(metadata: {
labels: [
"template.name=Continuous",
"template.type=TARGET"
]
}) and then further parse those label strings to split the LHS and RHS by the
|
Whoops, I copied the error into my notes before sending this and the browser copy-paste turned
Agreed, I can use your first option.
Thanks, sounds good. |
e5b62c9
to
9b95255
Compare
For #878 I've pasted some docs for the recording metadata mutator I've added in this PR. Not sure where it should go or how it should be formatted.
|
src/main/java/io/cryostat/net/web/http/AbstractAuthenticatedRequestHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/io/cryostat/net/web/http/api/v2/graph/PutActiveRecordingMetadataMutator.java
Outdated
Show resolved
Hide resolved
src/main/java/io/cryostat/recordings/RecordingMetadataManager.java
Outdated
Show resolved
Hide resolved
src/main/java/io/cryostat/net/web/http/api/beta/RecordingMetadataLabelsPostHandler.java
Outdated
Show resolved
Hide resolved
I think using |
9d6e9dd
to
8855c16
Compare
About this PR, EDIT: Thinking about it even more, since ActiveRecordings are lost, the metadata along with them should be removed too... |
There is shutdown handling in the main |
Is there any way for the ITs to react to In more detail if it helps and what my problem is right now:
|
… migration for old metadata storage structure
…ctV2RequestHandler
3c5a57f
to
be56346
Compare
This PR/issue depends on: |
Fixes #960
Related cryostatio/cryostat-web#442
Depends on cryostatio/cryostat-core#141
Depends on cryostatio/cryostat-web#473
Stores metadata labels according to each target's (hopefully unique enough) generated JVM ID and recording name inside
recordingMetadataMap
. TherecordingMetadataMap
key format isPair< jvmId String, recordingName String>
.The "JVM ID" is a hashcode string generated by the helper method in cryostat-core from the target JVM's runtime properties.
When Cryostat archives a recording from a target JVM, the archived recording's labels will be stored according to the source target. Labels for re-uploaded recordings are mapped to a constant id
UNLABELLED_ARCHIVES_ID
.Known issues with this PR:
recordingMetadataMap
. Any metadata belonging to active recordings can be removed because active recordings are lost when a target restarts. Since both active and archived recordings are stored according to the same previous jvmId string, I searched Cryostat's archives for each metadata entry's recording name to determine if the recording is an archived recording. Is there a more efficient way to handle archived vs active recording metadata for the same target?RecordingMetadataIT
that checks that recording metadata is handled correctly when a target restarts shows that the metadata for active recordings is removed as expected, but viewing metadata for a recording archived before the target is restarted returns an empty labels map.