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

UI: Fetch alert history #3501

Merged
merged 19 commits into from
Sep 29, 2021
Merged

UI: Fetch alert history #3501

merged 19 commits into from
Sep 29, 2021

Conversation

JBWatenbergScality
Copy link
Contributor

Component:

ui

Context:

In order to display the Global health component we have to provide a way for the UI to retrieve alert history.

Summary:

This PR improve the behavior of useHistoryAlert to take in account platform downTimes.

Acceptance criteria:

Unit testing

@JBWatenbergScality JBWatenbergScality requested a review from a team as a code owner August 19, 2021 13:54
@bert-e
Copy link
Contributor

bert-e commented Aug 19, 2021

Hello jbwatenbergscality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Aug 19, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@bert-e
Copy link
Contributor

bert-e commented Sep 21, 2021

Conflict

There is a conflict between your branch improvement/ui-alert-history and the
destination branch development/2.11.

Please resolve the conflict on the feature branch (improvement/ui-alert-history).

git fetch && \
git checkout origin/improvement/ui-alert-history && \
git merge origin/development/2.11

Resolve merge conflicts and commit

git push origin HEAD:improvement/ui-alert-history

@JBWatenbergScality JBWatenbergScality changed the base branch from development/2.11 to feature/replace-the-metrics-charts-with-the-new-linetemporalchart September 21, 2021 08:00
@ChengYanJin ChengYanJin force-pushed the feature/replace-the-metrics-charts-with-the-new-linetemporalchart branch from 45c1ab9 to bb64655 Compare September 21, 2021 08:08
@JBWatenbergScality JBWatenbergScality force-pushed the improvement/ui-alert-history branch 3 times, most recently from 25eb470 to 4fc7988 Compare September 22, 2021 08:41
@ChengYanJin ChengYanJin force-pushed the feature/replace-the-metrics-charts-with-the-new-linetemporalchart branch 2 times, most recently from 2936a76 to eb78221 Compare September 22, 2021 09:07
@JBWatenbergScality JBWatenbergScality force-pushed the improvement/ui-alert-history branch 3 times, most recently from c495b8e to 611469e Compare September 22, 2021 14:46
@ChengYanJin ChengYanJin force-pushed the feature/replace-the-metrics-charts-with-the-new-linetemporalchart branch from c503a5b to 7a3aeff Compare September 22, 2021 16:09
Copy link
Contributor

@ChengYanJin ChengYanJin left a comment

Choose a reason for hiding this comment

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

I just have some requests to write some comments to help us to remember the issue we faced...

And thanks for rebasing to my branch again, it was not very clean before :/

exact
path="/"
component={() => <Redirect to="/nodes" />}
<AlertHistoryProvider>
Copy link
Contributor

Choose a reason for hiding this comment

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

I am just wondering should we wrap this AlertHisotryProvider in App.js?

@@ -176,5 +176,6 @@
"core": "Core",
"view_details": "View details",
"start": "Start",
"no_data_available_for_metrics": "No data available for displaying the Metrics"
"no_data_available_for_metrics": "No data available for displaying the Metrics",
"global_health_explanation": "The Global Health is the overall status of your Platform over a specific period.\nThe statuses of the Volumes and Nodes, the Network and the Services are monitored.\n(circle with StatusHealthy) OK, the Platform is healthy.\n(circle with StatusWarning) Warning, the Platform is degraded but not at risk.\n(circle with StatusCritical) Critical status, the Platform is degraded and at risk.\nHover or click on an alert segment on the Global Health bar for more details."
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we don't have a french translation for this long text yet?

@@ -46,7 +48,7 @@ export function getAlertsLoki(start: string, end: string): Promise<Alert[]> {

return lokiApiClient
.get(
`/loki/api/v1/query_range?start=${start}&end=${end}&query=${METALK8S_HISTORY_ALERTS_QUERY}`,
`/loki/api/v1/query_range?start=${start}&end=${end}&limit=1000&query=${METALK8S_HISTORY_ALERTS_QUERY}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

can we write down the reason why we set the limit to 1000?

@@ -122,11 +113,15 @@ const DashboardPage = (props: {}) => {
onClick: () => {
writeUrlTimeSpan(option);
},
selected: queryTimeSpansCodes.find(timespan => timespan.duration === metricsTimeSpan)?.label === option,
selected:
queryTimeSpansCodes.find((item) => item.label === label)?.label ===
Copy link
Contributor

Choose a reason for hiding this comment

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

Just FYI:
I exposed the queryTimeSpansCodes from core-ui as well ;) To make sure we have a single source of truth.

const newCurrentDate = new Date();
setCurrentTime(newCurrentDate);
const newCurrentDate = new Date().getTime();
const newCurrentTime = newCurrentDate - (newCurrentDate % (frequency * 1000));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here it worth writiing down why we did this change (what problem we were trying to solve)

Base automatically changed from feature/replace-the-metrics-charts-with-the-new-linetemporalchart to development/2.11 September 23, 2021 07:49
@bert-e
Copy link
Contributor

bert-e commented Sep 23, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

ChengYanJin
ChengYanJin previously approved these changes Sep 23, 2021
@bert-e
Copy link
Contributor

bert-e commented Sep 28, 2021

Conflict

There is a conflict between your branch improvement/ui-alert-history and the
destination branch development/2.11.

Please resolve the conflict on the feature branch (improvement/ui-alert-history).

git fetch && \
git checkout origin/improvement/ui-alert-history && \
git merge origin/development/2.11

Resolve merge conflicts and commit

git push origin HEAD:improvement/ui-alert-history

@bert-e
Copy link
Contributor

bert-e commented Sep 28, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@JBWatenbergScality
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Sep 29, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following options are set: approve

Copy link
Contributor

@ChengYanJin ChengYanJin left a comment

Choose a reason for hiding this comment

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

LGTM!

@bert-e
Copy link
Contributor

bert-e commented Sep 29, 2021

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/2.11

The following branches will NOT be impacted:

  • development/2.0
  • development/2.1
  • development/2.10
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Sep 29, 2021

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.11

The following branches have NOT changed:

  • development/2.0
  • development/2.1
  • development/2.10
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

Please check the status of the associated issue None.

Goodbye jbwatenbergscality.

@bert-e bert-e merged commit dbff559 into development/2.11 Sep 29, 2021
@bert-e bert-e deleted the improvement/ui-alert-history branch September 29, 2021 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants