-
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
[Perfomance] Add Inline documentation for TTFMP #212393
Conversation
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
if (description?.length > MAX_DESCRIPTION_LENGTH) { | ||
// eslint-disable-next-line no-console | ||
console.error( | ||
`The description for the measure: ${target} is too long. The maximum length is ${MAX_DESCRIPTION_LENGTH}. Strings longer than ${MAX_DESCRIPTION_LENGTH} will not be indexed or stored` |
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.
Is there a discrepancy here when considering the added length of the prefix [TTFMP]
resulting in the actual acceptable length of text entered being 248? Is that worth being denoted in the error message?
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.
Since the prefix is mandatory, the total allowed length remains 256 characters.
The console error will only be visible to developers, but I want to include a warning because any input exceeding 256 characters will be ignored by the indexer due to ignore_above 256
, as long keywords tend to cause issues in ES.
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.
console.warn probably fit better
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.
Do we only want to warn, or do we also want to truncate the description to the max size?
Maybe in some cases, the warning is missed, and we send a very long description.
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.
The string will no be indexed above 256 but it's a good point. We could truncate and avoid sending the long text which won't be indexed
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.
updated here 1cb6e66
src/core/packages/analytics/browser-internal/src/track_performance_measure_entries.ts
Outdated
Show resolved
Hide resolved
...m/packages/shared/kbn-ebt-tools/src/performance_metrics/context/measure_interaction/index.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.
LGTM, just some open questions.
@elastic/obs-ui-devex-team |
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.
LGTM!
Tested and it works as expected. Thanks for adding description
in meta.
type ApmPageId = 'services' | 'traces' | 'dependencies'; | ||
type InfraPageId = 'hosts'; | ||
|
||
export type Key = `${ApmPageId}` | `${InfraPageId}`; |
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.
Will all plugins have to define their page keys explicitly here? Is this to discourage changing prefixes?
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.
Yes, the idea is also to encourage consistency, discoverability and avoid duplicate keys.
src/platform/packages/shared/kbn-ebt-tools/src/performance_metrics/context/types.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.
Code LGTM!
Added a comment about truncating the description if it is long.
if (description?.length > MAX_DESCRIPTION_LENGTH) { | ||
// eslint-disable-next-line no-console | ||
console.error( | ||
`The description for the measure: ${target} is too long. The maximum length is ${MAX_DESCRIPTION_LENGTH}. Strings longer than ${MAX_DESCRIPTION_LENGTH} will not be indexed or stored` |
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.
Do we only want to warn, or do we also want to truncate the description to the max size?
Maybe in some cases, the warning is missed, and we send a very long description.
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
Summary
closes https://github.com/elastic/observability-dev/issues/4101
Pass the
description
as metadata. The prefix [TTFMP] is required.How to test
yarn kbn bootstrap