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

Add metrics for stopped instances #12639

Merged
merged 10 commits into from
Jan 18, 2024

Conversation

simondeziel
Copy link
Member

@simondeziel simondeziel commented Dec 7, 2023

Thomas' PR #12476 without the metrics: Add LXD server info commit ece77a1
This would fix #12333.

@simondeziel simondeziel marked this pull request as ready for review December 8, 2023 16:47
lxd/api_metrics.go Outdated Show resolved Hide resolved
@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Dec 11, 2023
@simondeziel simondeziel force-pushed the 12333-metrics-instances-only branch from e42971b to 6f81b06 Compare January 8, 2024 19:01
@MusicDin
Copy link
Member

MusicDin commented Jan 8, 2024

Just a small nit, the API extension should be the first commit

@simondeziel simondeziel force-pushed the 12333-metrics-instances-only branch from 6f81b06 to 04429c7 Compare January 8, 2024 22:41
@simondeziel
Copy link
Member Author

@tomponline please take another look, thanks.

@tomponline
Copy link
Member

@simondeziel needs a rebase please

@simondeziel simondeziel force-pushed the 12333-metrics-instances-only branch from 04429c7 to 49e729d Compare January 18, 2024 14:28
simondeziel and others added 10 commits January 18, 2024 09:33
This adds the running state to container metrics. The value will be
either "RUNNING" or "STOPPED.

Signed-off-by: Thomas Hipp <[email protected]>
This checks the running state when retrieving metrics. Warnings will
only be shown if metrics cannot be retrieved for running containers.
Also, if values are returned for stopped containers as well, these will
also be included.

Signed-off-by: Thomas Hipp <[email protected]>
This adds the running state to VM metrics. The value is hard-coded as
"RUNNING" since metrics can only be retrieved from running VMs. That is
because LXD needs to connect either to the agent or the QEMU monitor in
order to get metrics.

Signed-off-by: Thomas Hipp <[email protected]>
This adds support for filtering metrics based only on the project name.
It will allow filtering metrics which are tied to a project but not to
an instance.

Signed-off-by: Thomas Hipp <[email protected]>
This extends the metrics filter to additionally filter samples by
project only if there's no instance name.

Signed-off-by: Thomas Hipp <[email protected]>
This adds the number of containers and VMs per project to the metrics.

Signed-off-by: Thomas Hipp <[email protected]>
Signed-off-by: Thomas Hipp <[email protected]>
@simondeziel simondeziel force-pushed the 12333-metrics-instances-only branch from 49e729d to a7655bc Compare January 18, 2024 14:34
@simondeziel
Copy link
Member Author

@tomponline rebased (twice!), please take another look, thanks.

@tomponline
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus /metrics endpoint changes
4 participants