ui: Add Stores page to React UI#2754
Conversation
Signed-off-by: Prem Kumar <prmsrswt@gmail.com>
Signed-off-by: Prem Kumar <prmsrswt@gmail.com>
|
It crashes for me because in my API response I have There are some interesting So, I'm certain that it has some weird |
GiedriusS
left a comment
There was a problem hiding this comment.
Code LGTM, just one suggestion/reminder. Awesome work! I like how simple the implementation is.
Returning string explicitly is a good idea. And yeah sure, I'll keep a note of it and fix this in a future PR. |
Signed-off-by: Prem Kumar <prmsrswt@gmail.com>
There was a problem hiding this comment.
Shouldn't we add a minimum time constant and use it? Because now we check for that huge value in the min time column. And we should add both checks to both columns because sometimes those values might appear in different columns when we don't want StoreAPIs to match anything e.g. when Thanos Store doesn't find any blocks or cannot do its synchronization
|
I am not sure what do we need to use as Also, please correct me if I am wrong. What I understand from this is that we should check if a particular field is greater than |
GiedriusS
left a comment
There was a problem hiding this comment.
I guess this should be good to go, just need the tests like talked on Slack :P Since this PR is small enough, we can put them together. I can't comment personally on the React code's nuances because I don't know much about it so I think @squat should look more into that part. Awesome work!
Signed-off-by: Prem Kumar <prmsrswt@gmail.com>
Signed-off-by: Prem Kumar <prmsrswt@gmail.com>
Signed-off-by: Prem Kumar <prmsrswt@gmail.com>
GiedriusS
left a comment
There was a problem hiding this comment.
Sorry for the late response! Played a bit with it, looks awesome. 🎉 ❤️ The tests are thorough and seem to cover all cases. It should be good to go, IMHO.
| const td = row.find({ 'data-testid': 'lastCheck' }); | ||
| expect(td).toHaveLength(1); | ||
|
|
||
| if (parseTime(lastCheck) >= MAX_TIME) { |
There was a problem hiding this comment.
AFAICT the only condition that we don't check in the tests is this but we can add another case in a follow-up PR
squat
left a comment
There was a problem hiding this comment.
super good! only small comments but not blockers
| const navConfig: { [component: string]: NavConfig[] } = { | ||
| query: [{ name: 'Graph', uri: '/new/graph' }], | ||
| query: [ | ||
| { name: 'Graph', uri: '/new/graph' }, |
There was a problem hiding this comment.
Can't wait till we can get rid of the"new" prefix :)
| return ( | ||
| <ListGroup> | ||
| {labelSet.map(({ labels }, idx) => ( | ||
| <ListGroupItem key={idx}> |
There was a problem hiding this comment.
One thing, for consistency let's try to use the same variable named for common things like indexes in loops. Not sure about the rest of the tsx codebase in the repo but let's just pick either i or idx
There was a problem hiding this comment.
We haven't found any other loops that use some other name and other code uses idx as well
| <StoreLabels labelSets={labelSets} /> | ||
| </td> | ||
| <td data-testid="minTime"> | ||
| {minTime >= MAX_TIME ? <FontAwesomeIcon icon={faInfinity} /> : formatTime(minTime)} |
There was a problem hiding this comment.
strictly speaking should this rather be > instead of >=?
There was a problem hiding this comment.
Talked about this in our sync - this is OK for now. It would be worth investigating whether momentjs has some kind of constant or function that we could compare against i.e. highest possible date that it supports.
| {minTime >= MAX_TIME ? <FontAwesomeIcon icon={faInfinity} /> : formatTime(minTime)} | ||
| </td> | ||
| <td data-testid="maxTime"> | ||
| {maxTime >= MAX_TIME ? <FontAwesomeIcon icon={faInfinity} /> : formatTime(maxTime)} |
* upstream/release-0.14: (46 commits) Cut release v0.14.0-rc.1 (thanos-io#2853) Query: correctly marshal errors to JSON and ignore if nil (thanos-io#2848) ci: Manually download promu in crossbuild stage (thanos-io#2828) Cut release v0.14.0-rc.0 (thanos-io#2826) Soft cut changelog on master to indicate v0.14.0 being in progress (thanos-io#2824) Update ThanosReceiveNoUpload to select sum == 0 (thanos-io#2819) receive: Added more observability, fixed leaktest, to actually check leaks ): (thanos-io#2817) Query: always return a string in the `lastError` field (thanos-io#2809) Added missing CHANGELOG entry for PR 2613 (thanos-io#2820) receive: Fixed small options race; Removed unused StartTime feature. (thanos-io#2816) go.mod: Bump Prometheus to current latest (thanos-io#2814) Implement CLI Flags page in React UI (thanos-io#2796) Improve ThanosReceiveNoUpload to only alert on current instances store: Preallocate output buffer when encoding postings. (thanos-io#2812) compact: introduce flag --block-viewer.global.sync-block-interval (thanos-io#2752) docs: compact: add blurb about how retention policy works (thanos-io#2808) Reduced memory allocations in readIndexRange() (thanos-io#2807) ui: Add Stores page to React UI (thanos-io#2754) Added Kemal to Maintainer Role; Kemal is volounteering to be next release shephard (thanos-io#2804) proposal: Add scalable rule storage proposal (thanos-io#2661) ...
Changes
Verification
Tested locally using both development build of react and the
thanosbinary with production build of react.