Skip to content
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(graphql): filter active recordings by various properties #868

Merged

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Mar 17, 2022

Fixes #823

Allows querying active recordings with filters on name, state, startTime (before or after timestamp inclusive), duration (greater/equal or lesser/equal to duration), continuous, toDisk, and the value of the "template" metadata label if any.

Example query for recordings using the Profiling template which have already stopped, running on Cryostat's own JVM:

query {
    targetNodes(filter: { name: "service:jmx:rmi:///jndi/rmi://localhost:9091/jmxrmi" }) {
        recordings {
            active(filter: {
                state: "STOPPED",
                templateLabel: "template=Profiling,type=TARGET"
                }) {
                name
                state
                startTime
                duration
                continuous
                toDisk
                maxSize
                maxAge
                metadata {
                    labels
                }
                reportUrl
                downloadUrl
            }
        }
    }
}

@andrewazores andrewazores added the feat New feature or request label Mar 17, 2022
@andrewazores andrewazores force-pushed the graphql-active-recording-filter branch from 019a3af to dce4964 Compare March 18, 2022 15:45
Copy link
Contributor

@jan-law jan-law left a comment

Choose a reason for hiding this comment

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

All the active recording filters with run.sh are working well

src/main/resources/types.graphqls Outdated Show resolved Hide resolved
hareetd
hareetd previously approved these changes Mar 18, 2022
Copy link
Contributor

@hareetd hareetd left a comment

Choose a reason for hiding this comment

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

Works well, I didn't run into any OOM issues with smoketest.

jan-law
jan-law previously approved these changes Mar 18, 2022
@andrewazores andrewazores dismissed stale reviews from jan-law and hareetd via d7a1d8d March 18, 2022 20:41
@andrewazores andrewazores merged commit f7f7e50 into cryostatio:main Mar 19, 2022
@andrewazores andrewazores deleted the graphql-active-recording-filter branch March 19, 2022 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL active recordings query filters
3 participants