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

[Epic] Redefine Target data model to allow multiple Connection URLs #71

Open
andrewazores opened this issue Sep 12, 2023 · 0 comments
Open
Assignees
Labels
feat New feature or request

Comments

@andrewazores
Copy link
Member

andrewazores commented Sep 12, 2023

Currently, Targets are defined expecting unique Connection URLs. However, it can be the case that there are multiple known Connection URLs that point to the same JVM instance - either because there are overlapping built-in discovery plugins or because the target is discoverable by one of those mechanisms and also has the Cryostat Agent attached. The JVM ID hash is therefore intended to help identify which Target instances are actually duplicate references.

A better data model would be that Targets can be defined, which have 0 or 1 JVM IDs (ie. null String for Target definitions that have not yet been connected to, or non-null String afterward - this ID should still be simply a column on the Target table). There would be a separate model for Connection URLs. A Connection URL would belong to exactly one Target, but a Target would have a list of zero or more Connection URLs. When a new Connection URL is to be added, the Cryostat server should attempt to open a connection there and compute (JMX)/retrieve (HTTP) the JVM ID. If the JVM ID cannot be determined then this Connection URL is rejected. If the JVM ID is determined then it should be linked to an existing Target record, if any, or a new corresponding Target should be created. This way, a Target record has a one-to-one relationship with an actual JVM instance.

Any background tasks, such as Automated Rule processing, that operate over Targets, can then choose any of the known Connection URLs for that Target to perform their work. Probably HTTP URLs should be preferred over JMX URLs, and some other ranking preference heuristics could be applied as well, for example localhost should be high priority, raw IP addresses should be next priority, hostnames (or hostname.local) should be next, and finally other URLs using full resolvable domains.

See also #41

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
Status: Backlog
Status: Stretch Goals
Development

No branches or pull requests

1 participant