-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover][APM] Trace badge icons for traces summary cell #209824
Conversation
/ci |
2 similar comments
/ci |
/ci |
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...ages/shared/kbn-discover-utils/src/data_types/logs/utils/get_available_trace_badge_fields.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and really liked the quick filtering with highlighted attributes!
I noticed that badges are being added to all documents in the table, not just those with data_stream.type:"traces"
. Is this intentional and aligned with the original goal?
I get that impacting other documents comes at no extra cost, but I just want to ensure we're all aware and that it still makes sense in the context of improving the traces experience, especially since we won't rely on the APM Data View as an enabler forever.
Metrics | Logs |
---|---|
![]() |
![]() |
...es/shared/kbn-discover-contextual-components/src/data_types/logs/components/translations.tsx
Outdated
Show resolved
Hide resolved
src/platform/packages/shared/kbn-discover-utils/src/data_types/logs/types.ts
Show resolved
Hide resolved
}, | ||
resolve: ({ dataSource }) => { | ||
if ( | ||
isDataSourceType(dataSource, DataSourceType.DataView) && | ||
dataSource.dataViewId === 'apm_static_data_view_id_default' | ||
dataSource.dataViewId.includes('apm_static_data_view_id') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding support for multiple spaces!
src/platform/packages/shared/kbn-discover-utils/src/field_constants.ts
Outdated
Show resolved
Hide resolved
src/platform/packages/shared/kbn-discover-utils/src/field_constants.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a bit of feedback, but the Data Discovery changes look good overall. I just noticed one issue when testing. It looks like filtering doesn't work for formatted fields -- are we able to pass the unformatted values instead?
filters.mp4
@@ -38,7 +43,7 @@ export interface SummaryColumnFactoryDeps { | |||
share?: SharePluginStart; | |||
} | |||
|
|||
export type SummaryColumnProps = DataGridCellValueElementProps; | |||
export type SummaryColumnProps = DataGridCellValueElementProps & { isTracesSummary?: boolean }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I partly wonder if it would be better to either decompose these components or make them more generic vs adding a flag, but I guess it depends on how many variants we expect to have, and Logs UX would know better.
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...context_awareness/profile_providers/observability/traces_data_source_profile/profile.test.ts
Outdated
Show resolved
Hide resolved
a25bde7
to
a195f39
Compare
Similar to @davismcphee comment around the formatted filters I've noticed this one Screen.Recording.2025-02-11.at.6.09.22.PM.mov |
@kpatticha Which synthtrace dataset are you testing with or with real data? |
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
...d/kbn-discover-contextual-components/src/data_types/logs/components/summary_column/utils.tsx
Outdated
Show resolved
Hide resolved
I used synthrace. First run |
So, I refactored a bunch of the code, so it should be a bit more robust and also more reusable in additional contexts. However, I decided to not try to force the microsecond formatting, because there's a lot of machinery already for deciding how something gets formatted, and I don't want to second guess what it is doing. I brought back the translated labels for the Event Outcome badge, but it is only translated for the badge itself. On the popover, it shows the raw value, so to make it clear that the actual value that is being filtered on is what is represented by the raw value.
|
For today, I removed the translations for |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
History
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filtering is now working as expected, and the Data Discovery changes LGTM 👍 I left a couple more comments around field formatting, but I think this is good to approve on our end now. Thanks for working on it!
|
||
return availableResourceFields.map((name) => ({ | ||
name, | ||
value: resourceDoc[name], | ||
rawValue: resourceDoc[name], | ||
value: getFormattedValue(name, resourceDoc[name], dataView), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value: getFormattedValue(name, resourceDoc[name], dataView), | |
value: formatFieldValue( | |
resourceDoc[name], | |
row.raw, | |
fieldFormats, | |
dataView, | |
dataView.getFieldByName(name), | |
'html' | |
), |
Since there's no longer any special handling going on here, I'd definitely recommend dropping the getFormattedValue
function and using formatFieldValue
since it's the standard util and will produce the best output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the change to make use of formatFieldValue
, but as a note, there's a soundness hole with it in that in some circumstances, it doesn't actually return a string
value. This is due to FieldFormat.convert
not actually turning a value into string
if there is no formatter present for it, instead it simply casts it to string. As such, I put TODOs on the places I've changed to using formatFieldValue
to remove the string guards once the method no longer has a soundness hole.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating it 👍 And interesting, TIL. I suppose that would be an issue regardless for any use of getFormatterForField
, but I don't think it's an actual scenario. It looks like converter
never returns undefined and we we just have a redundant null check there. We should be able to drop it and get rid of value as string
. Our team owns that code so we can take a look at it as a followup and update here too.
src/platform/plugins/shared/discover/public/components/data_types/logs/service_name_cell.tsx
Outdated
Show resolved
Hide resolved
## Summary It was [pointed out](#209824 (comment)) during a recent review that the field format `convert()` value does some odd casting. It looks like this probably isn't necessary since `converter` should never be undefined, and we can just return the result directly. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]>
…#211342) ## Summary It was [pointed out](elastic#209824 (comment)) during a recent review that the field format `convert()` value does some odd casting. It looks like this probably isn't necessary since `converter` should never be undefined, and we can just return the result directly. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]>
Summary
Adds badges for the Summary cell in the Traces Data Source Profile mode for Discover. Shows
service.name
,event.outcome
,transaction.name
,transaction.duration.us
,span.name
andspan.duration.us
depending on whether the fields are available on the log document.Closes #208692
How to Test
traces_logs_entitities.ts
apm_static_data_view_id
with index patterns that match ontraces-*
, and add the following to yourkibana.dev.yml
and:service.name
,event.outcome
,transaction.name
andtransaction.duration.us
orspan.name
andspan.duration.us