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 incoming/indexer/storage information to V1 API's status endpoint #995

Closed
wants to merge 1 commit into from

Conversation

leo-naeka
Copy link

Performed during pycon 2018 at Lille, FR.

This PR adds a common API to all incoming/indexer/storage drivers to check their availability.
Availability (and some extra information on each driver, if available) is returned within the V1 status endpoint.

Should address the #958 issue (v1/status/ should be used instead of healthcheck/).

Copy link
Member

@jd jd left a comment

Choose a reason for hiding this comment

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

Test fails for a good reason; you'd also need to add a few Gabbi tests.

Otherwise that looks promising!

@@ -232,3 +233,6 @@ def process_measures_for_sack(self, sack):
self.ioctx.remove_omap_keys(op, tuple(processed_keys))
self.ioctx.operate_write_op(op, str(sack),
flags=self.OMAP_WRITE_FLAGS)

def get_health_status(self):
Copy link
Member

Choose a reason for hiding this comment

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

you can just go with get_health_status = get_ceph_health_status I guess?

@@ -0,0 +1,108 @@
# -*- coding:Utf-8 -*-
Copy link
Member

Choose a reason for hiding this comment

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

add license header (copy paste from any file)

from collections import OrderedDict
import six


Copy link
Member

Choose a reason for hiding this comment

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

This file has a bunch of Ceph, Redis, etc specific stuff so I'm not comforable having that here.

There's already a gnocchi/common directory where you can put those function, e.g. put the get_ceph_health_status in gnocchi/common/ceph.py file.

('name', driver.__class__.__name__)
])
try:
driver.s3.list_objects_v2(
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this is an heavy operation with a lot of data that can be returned. Maybe something lighter? or setting a limit of just returning 1 object?

@tobias-urdin
Copy link
Contributor

This is a great addition, would you like to continue working on this?

@unexceptable unexceptable mentioned this pull request Sep 15, 2020
@chungg
Copy link
Member

chungg commented Oct 2, 2020

@mergify rebase

@mergify
Copy link
Contributor

mergify bot commented Oct 2, 2020

Command rebase: failure

Branch rebase failed
First, rewinding head to replay your work on top of it...
Applying: Add incoming/indexer/storage information to V1 API's status endpoint
Using index info to reconstruct a base tree...
M gnocchi/indexer/init.py
M gnocchi/indexer/sqlalchemy.py
M gnocchi/rest/api.py
M gnocchi/storage/init.py
Falling back to patching base and 3-way merge...
Auto-merging gnocchi/storage/init.py
Auto-merging gnocchi/rest/api.py
CONFLICT (content): Merge conflict in gnocchi/rest/api.py
Auto-merging gnocchi/indexer/sqlalchemy.py
Auto-merging gnocchi/indexer/init.py
error: Failed to merge in the changes.
Patch failed at 0001 Add incoming/indexer/storage information to V1 API's status endpoint
Use 'git am --show-current-patch' to see the failed patch

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".

err-code: 8EB2E

Hey, I reacted but my real name is @Mergifyio

@tobias-urdin
Copy link
Contributor

Superceeded by #1078

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants