Skip to content

fix: table columns width misconfigured#233619

Merged
rmyz merged 2 commits intoelastic:mainfrom
p55d2k:fix/table-columns-width-misconfigured
Sep 1, 2025
Merged

fix: table columns width misconfigured#233619
rmyz merged 2 commits intoelastic:mainfrom
p55d2k:fix/table-columns-width-misconfigured

Conversation

@p55d2k
Copy link
Copy Markdown
Contributor

@p55d2k p55d2k commented Sep 1, 2025

Infrastructure Hosts Alert Column Width Fix

Fix to Issue #233398.

Problem Analysis

The issue was that when OpenTelemetry schema (semconv) is selected, the alerts column was taking up too much space compared to when System Integration schema (ecs) is used.

Root Cause

  1. Schema-dependent columns: When OpenTelemetry schema is selected, the network columns (rx/tx) are hidden based on this condition:

    searchCriteria.preferredSchema !== 'semconv'
  2. Fixed width allocation: The alerts column had a fixed width of 95px, while metric columns used percentage-based widths (12% when alerts are shown, 16% when not shown).

  3. Insufficient responsive calculation: The column width calculations didn't account for the presence/absence of network columns based on the schema.

Solution Implemented

1. Dynamic Metric Column Width Calculation

const showNetworkColumns = searchCriteria.preferredSchema !== 'semconv';
const metricColumnsWidth = useMemo(() => {
  if (displayAlerts) {
    return showNetworkColumns ? '12%' : '16%';
  }
  return showNetworkColumns ? '16%' : '20%';
}, [displayAlerts, showNetworkColumns]);

2. Dynamic Title Column Width Calculation

const titleColumnWidth = useMemo(() => {
  if (displayAlerts) {
    return showNetworkColumns ? '15%' : '20%';
  }
  return showNetworkColumns ? '20%' : '25%';
}, [displayAlerts, showNetworkColumns]);

3. Reduced Alert Column Width

  • Changed from width: '95px' to width: '80px' for a more compact alerts column

Width Allocation Summary

ECS Schema (with network columns):

  • With alerts: Alerts: 80px, Title: 15%, Metrics: 12% each (5 columns), Network: 12% each (2 columns)
  • Without alerts: Title: 20%, Metrics: 16% each (5 columns), Network: 12% each (2 columns)

OpenTelemetry Schema (without network columns):

  • With alerts: Alerts: 80px, Title: 20%, Metrics: 16% each (5 columns)
  • Without alerts: Title: 25%, Metrics: 20% each (5 columns)

Files Modified

  • /x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/hooks/use_hosts_table.tsx

@p55d2k p55d2k requested a review from a team September 1, 2025 10:48
@rmyz rmyz added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Sep 1, 2025
@rmyz rmyz self-requested a review September 1, 2025 10:54
@rmyz
Copy link
Copy Markdown
Contributor

rmyz commented Sep 1, 2025

/ci

@rmyz rmyz added the Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. label Sep 1, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@rmyz
Copy link
Copy Markdown
Contributor

rmyz commented Sep 1, 2025

@p55d2k thanks for opening this!

You'll need to sign the CLA: elastic.co/contributor-agreement

I've reviewed the PR, and it looks good.
I will approve it and merge it once the CI is green.

Copy link
Copy Markdown
Contributor

@rmyz rmyz left a comment

Choose a reason for hiding this comment

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

tested and LGTM

@p55d2k
Copy link
Copy Markdown
Contributor Author

p55d2k commented Sep 1, 2025

Hi @rmyz I've signed the CLA and downloaded it, do I have to upload it somewhere? Thanks!

@rmyz
Copy link
Copy Markdown
Contributor

rmyz commented Sep 1, 2025

Hi @rmyz I've signed the CLA and downloaded it, do I have to upload it somewhere? Thanks!

I think if you already did the process it should be enough

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

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.0MB 1.0MB +124.0B

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/saved-objects-service.html#_mappings

id before after diff
_data_stream_timestamp 1 - -1
_doc_count 1 - -1
_ignored_source 1 - -1
_index_mode 1 - -1
_inference_fields 1 - -1
_tier 1 - -1
apm-custom-dashboards 5 - -5
apm-server-schema 2 - -2
apm-service-group 5 - -5
application_usage_daily 2 - -2
config 2 - -2
config-global 2 - -2
coreMigrationVersion 1 - -1
created_at 1 - -1
created_by 1 - -1
entity-definition 9 - -9
entity-discovery-api-key 2 - -2
event_loop_delays_daily 2 - -2
favorites 4 - -4
file 11 - -11
file-upload-usage-collection-telemetry 3 - -3
fileShare 5 - -5
infra-custom-dashboards 4 - -4
infrastructure-monitoring-log-view 2 - -2
intercept_trigger_record 5 - -5
legacy-url-alias 7 - -7
managed 1 - -1
ml-job 6 - -6
ml-module 13 - -13
ml-trained-model 7 - -7
monitoring-telemetry 2 - -2
namespace 1 - -1
namespaces 1 - -1
observability-onboarding-state 2 - -2
originId 1 - -1
product-doc-install-status 7 - -7
references 4 - -4
sample-data-telemetry 3 - -3
security-ai-prompt 8 - -8
slo 11 - -11
space 5 - -5
synthetics-monitor 34 - -34
synthetics-monitor-multi-space 34 - -34
tag 4 - -4
type 1 - -1
typeMigrationVersion 1 - -1
ui-metric 2 - -2
updated_at 1 - -1
updated_by 1 - -1
upgrade-assistant-ml-upgrade-operation 3 - -3
upgrade-assistant-reindex-operation 3 - -3
uptime-synthetics-api-key 2 - -2
url 5 - -5
usage-counters 2 - -2
total -246

@rmyz
Copy link
Copy Markdown
Contributor

rmyz commented Sep 1, 2025

@elasticmachine run docs-build

@rmyz rmyz merged commit 0812c37 into elastic:main Sep 1, 2025
14 checks passed
ymao1 pushed a commit to ymao1/kibana that referenced this pull request Sep 2, 2025
Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
MichelLosier pushed a commit to MichelLosier/kibana that referenced this pull request Sep 2, 2025
Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
kowalczyk-krzysztof pushed a commit to kowalczyk-krzysztof/kibana that referenced this pull request Sep 3, 2025
Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting 💝community release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants