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

[Infra][ObsUX] Hosts & Container Logs only overview #202992

Merged
merged 10 commits into from
Dec 10, 2024

Conversation

Bluefinger
Copy link
Contributor

@Bluefinger Bluefinger commented Dec 4, 2024

Summary

Enables a logs only overview for hosts & containers. Disables the metrics tab as there's no data incoming for metrics, and provides Logs charts on the overview page detailing the Log Rate (all logs generated) and Log Error Rate (all recorded errors).

Recording.2024-12-04.183310.mp4

Closes #201752

How to test

This is tested using synthtrace data, loading the scenario below:

node scripts/synthtrace traces_logs_entities.ts --live

This loads a logs-only host, though if other scenarios contain logs only containers, feel free to use those as well.

  • Go to Inventory page. Click on a host or container.
  • If it is a logs only host/container, no metrics tab should be shown. Metrics KPI charts should be replaced with Logs KPI charts (Log Rate and Log Error Rate).
  • If the host/container contains metrics, the metrics tab should be visible and the normal Metrics KPI charts should be present.

@Bluefinger Bluefinger added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Dec 4, 2024
@Bluefinger Bluefinger requested a review from a team as a code owner December 4, 2024 17:37
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Dec 4, 2024
Copy link
Contributor

github-actions bot commented Dec 4, 2024

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@cauemarcondes
Copy link
Contributor

The Log charts colour don't match the design.

Screenshot 2024-12-05 at 09 32 50

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM, just some nits

@Bluefinger
Copy link
Contributor Author

@elasticmachine merge upstream

@Bluefinger
Copy link
Contributor Author

@elasticmachine merge upstream

@Bluefinger Bluefinger enabled auto-merge (squash) December 5, 2024 18:10
@Bluefinger Bluefinger disabled auto-merge December 9, 2024 14:01
@crespocarlos crespocarlos self-requested a review December 10, 2024 09:16
Comment on lines 12 to 43
const LOG_RATE = i18n.translate('xpack.infra.assetDetails.charts.logRate', {
defaultMessage: 'Log Rate',
});

const LOG_ERROR_RATE = i18n.translate('xpack.infra.assetDetails.charts.logErrorRate', {
defaultMessage: 'Log Error Rate',
});

const logMetric: LensConfig & { id: string } = {
id: 'logMetric',
chartType: 'metric',
title: LOG_RATE,
label: LOG_RATE,
trendLine: true,
value: 'count()',
format: 'number',
decimals: 1,
normalizeByUnit: 's',
};

const logErrorMetric: LensConfig & { id: string } = {
id: 'logErrorMetric',
chartType: 'metric',
title: LOG_ERROR_RATE,
label: LOG_ERROR_RATE,
trendLine: true,
value:
'count(kql=\'log.level: "error" OR log.level: "ERROR" OR error.log.level: "error" OR error.log.level: "ERROR"\')',
format: 'number',
decimals: 1,
normalizeByUnit: 's',
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather centralize these formulas here x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/**/formulas but I understand it'd be a relatively big change because the structure is not prepared to support logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe as a follow-up PR? That way, we don't pollute this one with too many changes and then this change can be evaluated as its own thing?

@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 10, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 60973ef
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-202992-60973efe23af

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #20 / AgentPolicyListPage Uninstall command flyout should not render "Uninstall agents on this policy" menu item for managed Agent

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
infra 1539 1542 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
infra 1.8MB 1.8MB +1.9KB

History

@Bluefinger Bluefinger merged commit 305bb1b into elastic:main Dec 10, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.x

https://github.com/elastic/kibana/actions/runs/12260624734

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 10, 2024
## Summary

Enables a logs only overview for hosts & containers. Disables the
metrics tab as there's no data incoming for metrics, and provides Logs
charts on the overview page detailing the Log Rate (all logs generated)
and Log Error Rate (all recorded errors).

https://github.com/user-attachments/assets/ced14b6d-dd08-4514-9066-6c02c62d5ff8

Closes elastic#201752

## How to test

This is tested using synthtrace data, loading the scenario below:

```
node scripts/synthtrace traces_logs_entities.ts --live
```

This loads a logs-only host, though if other scenarios contain logs only
containers, feel free to use those as well.

* Go to Inventory page. Click on a host or container.
* If it is a logs only host/container, no metrics tab should be shown.
Metrics KPI charts should be replaced with Logs KPI charts (Log Rate and
Log Error Rate).
* If the host/container contains metrics, the metrics tab should be
visible and the normal Metrics KPI charts should be present.

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 305bb1b)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.17 Backport failed because of merge conflicts
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 202992

Questions ?

Please refer to the Backport tool documentation

Bluefinger added a commit to Bluefinger/kibana that referenced this pull request Dec 11, 2024
## Summary

Enables a logs only overview for hosts & containers. Disables the
metrics tab as there's no data incoming for metrics, and provides Logs
charts on the overview page detailing the Log Rate (all logs generated)
and Log Error Rate (all recorded errors).

https://github.com/user-attachments/assets/ced14b6d-dd08-4514-9066-6c02c62d5ff8

Closes elastic#201752

## How to test

This is tested using synthtrace data, loading the scenario below:

```
node scripts/synthtrace traces_logs_entities.ts --live
```

This loads a logs-only host, though if other scenarios contain logs only
containers, feel free to use those as well.

* Go to Inventory page. Click on a host or container.
* If it is a logs only host/container, no metrics tab should be shown.
Metrics KPI charts should be replaced with Logs KPI charts (Log Rate and
Log Error Rate).
* If the host/container contains metrics, the metrics tab should be
visible and the normal Metrics KPI charts should be present.

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 305bb1b)

# Conflicts:
#	x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/overview/overview.tsx
@Bluefinger
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
## Summary

Enables a logs only overview for hosts & containers. Disables the
metrics tab as there's no data incoming for metrics, and provides Logs
charts on the overview page detailing the Log Rate (all logs generated)
and Log Error Rate (all recorded errors).


https://github.com/user-attachments/assets/ced14b6d-dd08-4514-9066-6c02c62d5ff8

Closes elastic#201752

## How to test

This is tested using synthtrace data, loading the scenario below:

```
node scripts/synthtrace traces_logs_entities.ts --live
```

This loads a logs-only host, though if other scenarios contain logs only
containers, feel free to use those as well.

* Go to Inventory page. Click on a host or container.
* If it is a logs only host/container, no metrics tab should be shown.
Metrics KPI charts should be replaced with Logs KPI charts (Log Rate and
Log Error Rate).
* If the host/container contains metrics, the metrics tab should be
visible and the normal Metrics KPI charts should be present.

---------

Co-authored-by: Elastic Machine <[email protected]>
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Dec 12, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

1 similar comment
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport missing Added to PRs automatically when the are determined to be missing a backport. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Infra] Adapt hosts and container views to logs-only data
5 participants