grafana/public/app/features/logs/components/panel/LogList.tsx

591 lines
19 KiB
TypeScript
Raw Normal View History

import { css } from '@emotion/css';
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
import { debounce } from 'lodash';
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
import { Grammar } from 'prismjs';
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, MouseEvent } from 'react';
import { Align, VariableSizeList } from 'react-window';
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
import {
CoreApp,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
DataFrame,
EventBus,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
EventBusSrv,
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
GrafanaTheme2,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
LogLevel,
LogRowModel,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
LogsDedupStrategy,
LogsMetaItem,
LogsSortOrder,
store,
TimeRange,
} from '@grafana/data';
import { Trans, t } from '@grafana/i18n';
import { ConfirmModal, Icon, PopoverContent, useStyles2, useTheme2 } from '@grafana/ui';
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
import { PopoverMenu } from 'app/features/explore/Logs/PopoverMenu';
import { GetFieldLinksFn } from 'app/plugins/panel/logs/types';
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
import { InfiniteScrollMode, InfiniteScroll, LoadMoreLogsType } from './InfiniteScroll';
import { getGridTemplateColumns, LogLineTimestampResolution } from './LogLine';
import { LogLineDetails, LogLineDetailsMode } from './LogLineDetails';
import { GetRowContextQueryFn, LogLineMenuCustomItem } from './LogLineMenu';
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
import { LogListContextProvider, LogListState, useLogListContext } from './LogListContext';
import { LogListControls } from './LogListControls';
import { LOG_LIST_SEARCH_HEIGHT, LogListSearch } from './LogListSearch';
import { LogListSearchContextProvider, useLogListSearchContext } from './LogListSearchContext';
import { preProcessLogs, LogListModel, getLevelsFromLogs } from './processing';
import { useKeyBindings } from './useKeyBindings';
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
import { usePopoverMenu } from './usePopoverMenu';
import { LogLineVirtualization, getLogLineSize, LogFieldDimension, ScrollToLogsEvent } from './virtualization';
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
export interface Props {
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
app: CoreApp;
containerElement: HTMLDivElement;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
dedupStrategy: LogsDedupStrategy;
detailsMode?: LogLineDetailsMode;
displayedFields: string[];
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
enableLogDetails: boolean;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
eventBus?: EventBus;
filterLevels?: LogLevel[];
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
fontSize?: LogListFontSize;
getFieldLinks?: GetFieldLinksFn;
getRowContextQuery?: GetRowContextQueryFn;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
grammar?: Grammar;
infiniteScrollMode?: InfiniteScrollMode;
initialScrollPosition?: 'top' | 'bottom';
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
isLabelFilterActive?: (key: string, value: string, refId?: string) => Promise<boolean>;
loading?: boolean;
loadMore?: LoadMoreLogsType;
logLineMenuCustomItems?: LogLineMenuCustomItem[];
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logOptionsStorageKey?: string;
logs: LogRowModel[];
logsMeta?: LogsMetaItem[];
logSupportsContext?: (row: LogRowModel) => boolean;
noInteractions?: boolean;
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
onClickFilterLabel?: (key: string, value: string, frame?: DataFrame) => void;
onClickFilterOutLabel?: (key: string, value: string, frame?: DataFrame) => void;
onClickFilterString?: (value: string, refId?: string) => void;
onClickFilterOutString?: (value: string, refId?: string) => void;
onClickShowField?: (key: string) => void;
onClickHideField?: (key: string) => void;
OTel logs: Move OTel augmented attributes out of the log line to a field (#110901) * OTel: make attributes a field * Logs: normalize field names * chore: remove test * Translations * Cleaner approach compatible with "show original line" * Revert "Cleaner approach compatible with "show original line"" This reverts commit e27c3de4ede5538f12cc8fc27d0aee06906c7792. * formats: remove scope name from default attributes * Logs: sync panel state once * otel formatting: exclude dashboards * Fix dashboard exclusion * LogsMetaRow: introduce new reset option for OTel logs * Translations * Update test * Rename constant * processing: only add otel attributes field for otel logs * Implement defaultDisplayedFields * Update translations * Logs: initialize displayed fields with panel state * Address lint issues * LogLine: fix log attributes field title * Optimization: memo HighlightedLogRenderer * Otel log attributes: highlight when rendering * getOtelAttributesField: update * OTEL_RESOURCE_ATTRS_REGEX: exclude cluster, namespace, and pod * DisplayedFields: respect syntaxHighlighting state * chore: revert experimental changes * chore: use argument * chore: remove comment * formats: update tests * LogList: add integration test * LogLine: more integration tests * LogList: more integration tests * LogList: even more tests * LogList: add assertion * processing: update tests * formats: more tests * LogLabels: update test * LogLine: update test * Prettier * Logs Panel: add dashboard option * Translations * Table: exclude generated field * LogListContext: invert order of effects * Explore: remove unnecessary effect * Explore: unify displayed fields effects * Remove log * Rename field * Update supressions
2025-10-07 19:19:27 +08:00
onLogOptionsChange?: (option: LogListOptions, value: string | boolean | string[]) => void;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
onLogLineHover?: (row?: LogRowModel) => void;
onPermalinkClick?: (row: LogRowModel) => Promise<void>;
onPinLine?: (row: LogRowModel) => void;
onOpenContext?: (row: LogRowModel, onClose: () => void) => void;
onUnpinLine?: (row: LogRowModel) => void;
permalinkedLogId?: string;
pinLineButtonTooltipTitle?: PopoverContent;
pinnedLogs?: string[];
prettifyJSON?: boolean;
setDisplayedFields?: (displayedFields: string[]) => void;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
showControls: boolean;
OTel logs: Move OTel augmented attributes out of the log line to a field (#110901) * OTel: make attributes a field * Logs: normalize field names * chore: remove test * Translations * Cleaner approach compatible with "show original line" * Revert "Cleaner approach compatible with "show original line"" This reverts commit e27c3de4ede5538f12cc8fc27d0aee06906c7792. * formats: remove scope name from default attributes * Logs: sync panel state once * otel formatting: exclude dashboards * Fix dashboard exclusion * LogsMetaRow: introduce new reset option for OTel logs * Translations * Update test * Rename constant * processing: only add otel attributes field for otel logs * Implement defaultDisplayedFields * Update translations * Logs: initialize displayed fields with panel state * Address lint issues * LogLine: fix log attributes field title * Optimization: memo HighlightedLogRenderer * Otel log attributes: highlight when rendering * getOtelAttributesField: update * OTEL_RESOURCE_ATTRS_REGEX: exclude cluster, namespace, and pod * DisplayedFields: respect syntaxHighlighting state * chore: revert experimental changes * chore: use argument * chore: remove comment * formats: update tests * LogList: add integration test * LogLine: more integration tests * LogList: more integration tests * LogList: even more tests * LogList: add assertion * processing: update tests * formats: more tests * LogLabels: update test * LogLine: update test * Prettier * Logs Panel: add dashboard option * Translations * Table: exclude generated field * LogListContext: invert order of effects * Explore: remove unnecessary effect * Explore: unify displayed fields effects * Remove log * Rename field * Update supressions
2025-10-07 19:19:27 +08:00
/**
* Experimental. When OTel logs are displayed, add an extra displayed field with relevant key-value pairs from labels and metadata
* @alpha
*/
showLogAttributes?: boolean;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
showTime: boolean;
showUniqueLabels?: boolean;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
sortOrder: LogsSortOrder;
timeRange: TimeRange;
timestampResolution?: LogLineTimestampResolution;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
timeZone: string;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
syntaxHighlighting?: boolean;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
wrapLogMessage: boolean;
}
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
export type LogListFontSize = 'default' | 'small';
OTel logs: Move OTel augmented attributes out of the log line to a field (#110901) * OTel: make attributes a field * Logs: normalize field names * chore: remove test * Translations * Cleaner approach compatible with "show original line" * Revert "Cleaner approach compatible with "show original line"" This reverts commit e27c3de4ede5538f12cc8fc27d0aee06906c7792. * formats: remove scope name from default attributes * Logs: sync panel state once * otel formatting: exclude dashboards * Fix dashboard exclusion * LogsMetaRow: introduce new reset option for OTel logs * Translations * Update test * Rename constant * processing: only add otel attributes field for otel logs * Implement defaultDisplayedFields * Update translations * Logs: initialize displayed fields with panel state * Address lint issues * LogLine: fix log attributes field title * Optimization: memo HighlightedLogRenderer * Otel log attributes: highlight when rendering * getOtelAttributesField: update * OTEL_RESOURCE_ATTRS_REGEX: exclude cluster, namespace, and pod * DisplayedFields: respect syntaxHighlighting state * chore: revert experimental changes * chore: use argument * chore: remove comment * formats: update tests * LogList: add integration test * LogLine: more integration tests * LogList: more integration tests * LogList: even more tests * LogList: add assertion * processing: update tests * formats: more tests * LogLabels: update test * LogLine: update test * Prettier * Logs Panel: add dashboard option * Translations * Table: exclude generated field * LogListContext: invert order of effects * Explore: remove unnecessary effect * Explore: unify displayed fields effects * Remove log * Rename field * Update supressions
2025-10-07 19:19:27 +08:00
export type LogListOptions = keyof LogListState | 'wrapLogMessage' | 'prettifyLogMessage' | 'defaultDisplayedFields';
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
type LogListComponentProps = Omit<
Props,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
| 'app'
| 'dedupStrategy'
| 'displayedFields'
| 'enableLogDetails'
| 'logOptionsStorageKey'
| 'permalinkedLogId'
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
| 'showTime'
| 'sortOrder'
| 'syntaxHighlighting'
| 'wrapLogMessage'
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
>;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
export const LogList = ({
app,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
displayedFields,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
containerElement,
logOptionsStorageKey,
detailsMode,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
dedupStrategy,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
enableLogDetails,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
eventBus,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
filterLevels,
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
fontSize = logOptionsStorageKey ? (store.get(`${logOptionsStorageKey}.fontSize`) ?? 'default') : 'default',
getFieldLinks,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
getRowContextQuery,
grammar,
infiniteScrollMode,
initialScrollPosition = 'top',
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
isLabelFilterActive,
loading,
loadMore,
logLineMenuCustomItems,
logs,
logsMeta,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logSupportsContext,
noInteractions,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
onClickFilterLabel,
onClickFilterOutLabel,
onClickFilterString,
onClickFilterOutString,
onClickShowField,
onClickHideField,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
onLogOptionsChange,
onLogLineHover,
onPermalinkClick,
onPinLine,
onOpenContext,
onUnpinLine,
permalinkedLogId,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
pinLineButtonTooltipTitle,
pinnedLogs,
prettifyJSON = logOptionsStorageKey ? store.getBool(`${logOptionsStorageKey}.prettifyLogMessage`, true) : true,
setDisplayedFields,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
showControls,
OTel logs: Move OTel augmented attributes out of the log line to a field (#110901) * OTel: make attributes a field * Logs: normalize field names * chore: remove test * Translations * Cleaner approach compatible with "show original line" * Revert "Cleaner approach compatible with "show original line"" This reverts commit e27c3de4ede5538f12cc8fc27d0aee06906c7792. * formats: remove scope name from default attributes * Logs: sync panel state once * otel formatting: exclude dashboards * Fix dashboard exclusion * LogsMetaRow: introduce new reset option for OTel logs * Translations * Update test * Rename constant * processing: only add otel attributes field for otel logs * Implement defaultDisplayedFields * Update translations * Logs: initialize displayed fields with panel state * Address lint issues * LogLine: fix log attributes field title * Optimization: memo HighlightedLogRenderer * Otel log attributes: highlight when rendering * getOtelAttributesField: update * OTEL_RESOURCE_ATTRS_REGEX: exclude cluster, namespace, and pod * DisplayedFields: respect syntaxHighlighting state * chore: revert experimental changes * chore: use argument * chore: remove comment * formats: update tests * LogList: add integration test * LogLine: more integration tests * LogList: more integration tests * LogList: even more tests * LogList: add assertion * processing: update tests * formats: more tests * LogLabels: update test * LogLine: update test * Prettier * Logs Panel: add dashboard option * Translations * Table: exclude generated field * LogListContext: invert order of effects * Explore: remove unnecessary effect * Explore: unify displayed fields effects * Remove log * Rename field * Update supressions
2025-10-07 19:19:27 +08:00
showLogAttributes,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
showTime,
showUniqueLabels,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
sortOrder,
syntaxHighlighting = logOptionsStorageKey ? store.getBool(`${logOptionsStorageKey}.syntaxHighlighting`, true) : true,
timeRange,
timestampResolution,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
timeZone,
wrapLogMessage,
}: Props) => {
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
return (
<LogListContextProvider
app={app}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
containerElement={containerElement}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
dedupStrategy={dedupStrategy}
detailsMode={detailsMode}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
displayedFields={displayedFields}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
enableLogDetails={enableLogDetails}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
filterLevels={filterLevels}
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
fontSize={fontSize}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
getRowContextQuery={getRowContextQuery}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
isLabelFilterActive={isLabelFilterActive}
logs={logs}
logsMeta={logsMeta}
logLineMenuCustomItems={logLineMenuCustomItems}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logOptionsStorageKey={logOptionsStorageKey}
logSupportsContext={logSupportsContext}
noInteractions={noInteractions}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
onClickFilterLabel={onClickFilterLabel}
onClickFilterOutLabel={onClickFilterOutLabel}
onClickFilterString={onClickFilterString}
onClickFilterOutString={onClickFilterOutString}
onClickShowField={onClickShowField}
onClickHideField={onClickHideField}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
onLogOptionsChange={onLogOptionsChange}
onLogLineHover={onLogLineHover}
onPermalinkClick={onPermalinkClick}
onPinLine={onPinLine}
onOpenContext={onOpenContext}
onUnpinLine={onUnpinLine}
permalinkedLogId={permalinkedLogId}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
pinLineButtonTooltipTitle={pinLineButtonTooltipTitle}
pinnedLogs={pinnedLogs}
prettifyJSON={prettifyJSON}
setDisplayedFields={setDisplayedFields}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
showControls={showControls}
OTel logs: Move OTel augmented attributes out of the log line to a field (#110901) * OTel: make attributes a field * Logs: normalize field names * chore: remove test * Translations * Cleaner approach compatible with "show original line" * Revert "Cleaner approach compatible with "show original line"" This reverts commit e27c3de4ede5538f12cc8fc27d0aee06906c7792. * formats: remove scope name from default attributes * Logs: sync panel state once * otel formatting: exclude dashboards * Fix dashboard exclusion * LogsMetaRow: introduce new reset option for OTel logs * Translations * Update test * Rename constant * processing: only add otel attributes field for otel logs * Implement defaultDisplayedFields * Update translations * Logs: initialize displayed fields with panel state * Address lint issues * LogLine: fix log attributes field title * Optimization: memo HighlightedLogRenderer * Otel log attributes: highlight when rendering * getOtelAttributesField: update * OTEL_RESOURCE_ATTRS_REGEX: exclude cluster, namespace, and pod * DisplayedFields: respect syntaxHighlighting state * chore: revert experimental changes * chore: use argument * chore: remove comment * formats: update tests * LogList: add integration test * LogLine: more integration tests * LogList: more integration tests * LogList: even more tests * LogList: add assertion * processing: update tests * formats: more tests * LogLabels: update test * LogLine: update test * Prettier * Logs Panel: add dashboard option * Translations * Table: exclude generated field * LogListContext: invert order of effects * Explore: remove unnecessary effect * Explore: unify displayed fields effects * Remove log * Rename field * Update supressions
2025-10-07 19:19:27 +08:00
showLogAttributes={showLogAttributes}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
showTime={showTime}
showUniqueLabels={showUniqueLabels}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
sortOrder={sortOrder}
syntaxHighlighting={syntaxHighlighting}
timestampResolution={timestampResolution}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
wrapLogMessage={wrapLogMessage}
>
<LogListSearchContextProvider>
<LogListComponent
containerElement={containerElement}
eventBus={eventBus}
getFieldLinks={getFieldLinks}
grammar={grammar}
initialScrollPosition={initialScrollPosition}
infiniteScrollMode={infiniteScrollMode}
loading={loading}
loadMore={loadMore}
logs={logs}
showControls={showControls}
timeRange={timeRange}
timeZone={timeZone}
/>
</LogListSearchContextProvider>
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
</LogListContextProvider>
);
};
const LogListComponent = ({
containerElement,
eventBus = new EventBusSrv(),
getFieldLinks,
grammar,
initialScrollPosition = 'top',
infiniteScrollMode = 'interval',
loading,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
loadMore,
logs,
showControls,
timeRange,
timeZone,
}: LogListComponentProps) => {
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const {
app,
displayedFields,
dedupStrategy,
detailsMode,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
filterLevels,
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
fontSize,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
forceEscape,
hasLogsWithErrors,
hasSampledLogs,
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
onClickFilterString,
onClickFilterOutString,
permalinkedLogId,
prettifyJSON,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
showDetails,
showTime,
showUniqueLabels,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
sortOrder,
timestampResolution,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
toggleDetails,
wrapLogMessage,
} = useLogListContext();
const [processedLogs, setProcessedLogs] = useState<LogListModel[]>([]);
const [listHeight, setListHeight] = useState(getListHeight(containerElement, app));
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
const theme = useTheme2();
const listRef = useRef<VariableSizeList | null>(null);
const widthRef = useRef(containerElement.clientWidth);
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const wrapperRef = useRef<HTMLDivElement | null>(null);
const scrollRef = useRef<HTMLDivElement | null>(null);
const virtualization = useMemo(() => new LogLineVirtualization(theme, fontSize), [theme, fontSize]);
const dimensions = useMemo(
() =>
wrapLogMessage
? []
: virtualization.calculateFieldDimensions(
processedLogs,
displayedFields,
timestampResolution,
showUniqueLabels
),
[displayedFields, processedLogs, showUniqueLabels, timestampResolution, virtualization, wrapLogMessage]
);
const styles = useStyles2(getStyles, dimensions, displayedFields, { showTime });
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const widthContainer = wrapperRef.current ?? containerElement;
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
const {
closePopoverMenu,
handleTextSelection,
onDisableCancel,
onDisableConfirm,
onDisablePopoverMenu,
popoverState,
showDisablePopoverOptions,
} = usePopoverMenu(wrapperRef.current);
useKeyBindings();
const { filterLogs, matchingUids, searchVisible } = useLogListSearchContext();
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const levelFilteredLogs = useMemo(
() =>
filterLevels.length === 0 ? processedLogs : processedLogs.filter((log) => filterLevels.includes(log.logLevel)),
[filterLevels, processedLogs]
);
const filteredLogs = useMemo(
() =>
matchingUids && filterLogs
? levelFilteredLogs.filter((log) => matchingUids.includes(log.uid))
: levelFilteredLogs,
[filterLogs, levelFilteredLogs, matchingUids]
);
// When log lines report size discrepancies, we debounce the calculation reset to give time to
// use the smallest log index to reset the heights.
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const debouncedResetAfterIndex = useMemo(() => {
return debounce((index: number) => {
listRef.current?.resetAfterIndex(index);
overflowIndexRef.current = Infinity;
}, 0);
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
}, []);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
const debouncedScrollToItem = useMemo(() => {
return debounce((index: number, align?: Align) => {
listRef.current?.scrollToItem(index, align);
}, 250);
}, []);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
useEffect(() => {
const subscription = eventBus.subscribe(ScrollToLogsEvent, (e: ScrollToLogsEvent) =>
handleScrollToEvent(e, filteredLogs, listRef.current)
);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
return () => subscription.unsubscribe();
}, [eventBus, filteredLogs]);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
useEffect(() => {
setProcessedLogs(
preProcessLogs(
logs,
{
getFieldLinks,
escape: forceEscape ?? false,
prettifyJSON,
order: sortOrder,
timeZone,
virtualization,
wrapLogMessage,
},
grammar
)
);
virtualization.resetLogLineSizes();
listRef.current?.resetAfterIndex(0);
}, [forceEscape, getFieldLinks, grammar, logs, prettifyJSON, sortOrder, timeZone, virtualization, wrapLogMessage]);
useEffect(() => {
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
listRef.current?.resetAfterIndex(0);
}, [wrapLogMessage, showDetails, displayedFields, dedupStrategy]);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
useLayoutEffect(() => {
const handleResize = (entry: ResizeObserverEntry) => {
setListHeight(getListHeight(containerElement, app, searchVisible));
if (widthRef.current !== entry.contentRect.width) {
widthRef.current = entry.contentRect.width;
}
};
const observer = new ResizeObserver((entries: ResizeObserverEntry[]) => {
if (entries.length) {
handleResize(entries[0]);
}
});
observer.observe(containerElement);
return () => observer.disconnect();
}, [app, containerElement, searchVisible]);
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const overflowIndexRef = useRef(Infinity);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
const handleOverflow = useCallback(
(index: number, id: string, height?: number) => {
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
if (height !== undefined) {
virtualization.storeLogLineSize(id, widthContainer, height);
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
}
if (index === overflowIndexRef.current) {
return;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
overflowIndexRef.current = index < overflowIndexRef.current ? index : overflowIndexRef.current;
debouncedResetAfterIndex(overflowIndexRef.current);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
},
[debouncedResetAfterIndex, virtualization, widthContainer]
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
);
const handleScrollPosition = useCallback(
(log?: LogListModel) => {
const scrollToUID = log ? log.uid : permalinkedLogId;
if (scrollToUID) {
const index = processedLogs.findIndex((log) => log.uid === scrollToUID);
if (index >= 0) {
listRef.current?.scrollToItem(index, 'start');
return;
}
}
listRef.current?.scrollToItem(initialScrollPosition === 'top' ? 0 : processedLogs.length - 1);
},
[initialScrollPosition, permalinkedLogId, processedLogs]
);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const handleLogLineClick = useCallback(
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
(e: MouseEvent<HTMLElement>, log: LogListModel) => {
if (handleTextSelection(e, log)) {
// Event handled by the parent.
return;
}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
toggleDetails(log);
},
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
[handleTextSelection, toggleDetails]
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
);
const focusLogLine = useCallback(
(log: LogListModel) => {
const index = filteredLogs.findIndex((filteredLog) => filteredLog.uid === log.uid);
if (index >= 0) {
debouncedScrollToItem(index, 'start');
}
},
[debouncedScrollToItem, filteredLogs]
);
const logLevels = useMemo(() => getLevelsFromLogs(processedLogs), [processedLogs]);
if (!containerElement || listHeight == null) {
// Wait for container to be rendered
return null;
}
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
return (
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
<div className={styles.logListContainer}>
{showControls && <LogListControls logLevels={logLevels} eventBus={eventBus} />}
{detailsMode === 'sidebar' && showDetails.length > 0 && (
<LogLineDetails
containerElement={containerElement}
focusLogLine={focusLogLine}
logs={filteredLogs}
timeRange={timeRange}
timeZone={timeZone}
showControls={showControls}
/>
)}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
<div className={styles.logListWrapper} ref={wrapperRef}>
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
{popoverState.selection && popoverState.selectedRow && (
<PopoverMenu
close={closePopoverMenu}
row={popoverState.selectedRow}
selection={popoverState.selection}
{...popoverState.popoverMenuCoordinates}
onClickFilterString={onClickFilterString}
onClickFilterOutString={onClickFilterOutString}
onDisable={onDisablePopoverMenu}
/>
)}
{showDisablePopoverOptions && (
<ConfirmModal
isOpen
title={t('logs.log-rows.disable-popover.title', 'Disable menu')}
body={
<>
<Trans i18nKey="logs.log-rows.disable-popover.message">
You are about to disable the logs filter menu. To re-enable it, select text in a log line while
holding the alt key.
</Trans>
<div className={styles.shortcut}>
<Icon name="keyboard" />
<Trans i18nKey="logs.log-rows.disable-popover-message.shortcut">alt+select to enable again</Trans>
</div>
</>
}
confirmText={t('logs.log-rows.disable-popover.confirm', 'Confirm')}
icon="exclamation-triangle"
onConfirm={onDisableConfirm}
onDismiss={onDisableCancel}
/>
)}
<LogListSearch logs={levelFilteredLogs} listRef={listRef.current} />
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
<InfiniteScroll
displayedFields={displayedFields}
handleOverflow={handleOverflow}
infiniteScrollMode={infiniteScrollMode}
loading={loading}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
logs={filteredLogs}
loadMore={loadMore}
onClick={handleLogLineClick}
scrollElement={scrollRef.current}
showTime={showTime}
sortOrder={sortOrder}
timeRange={timeRange}
timeZone={timeZone}
setInitialScrollPosition={handleScrollPosition}
virtualization={virtualization}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
wrapLogMessage={wrapLogMessage}
>
{({ getItemKey, itemCount, onItemsRendered, Renderer }) => (
<VariableSizeList
className={styles.logList}
height={listHeight}
itemCount={itemCount}
itemSize={getLogLineSize.bind(null, virtualization, filteredLogs, widthContainer, displayedFields, {
detailsMode,
hasLogsWithErrors,
hasSampledLogs,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
showDuplicates: dedupStrategy !== LogsDedupStrategy.none,
showDetails,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
showTime,
wrap: wrapLogMessage,
})}
itemKey={getItemKey}
layout="vertical"
onItemsRendered={onItemsRendered}
outerRef={scrollRef}
overscanCount={5}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
ref={listRef}
style={wrapLogMessage ? { overflowY: 'scroll' } : { overflow: 'scroll' }}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
width="100%"
>
{Renderer}
</VariableSizeList>
)}
</InfiniteScroll>
</div>
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
</div>
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
);
};
function getStyles(
theme: GrafanaTheme2,
dimensions: LogFieldDimension[],
displayedFields: string[],
{ showTime }: { showTime: boolean }
) {
const columns = showTime ? dimensions : dimensions.filter((_, index) => index > 0);
return {
logList: css({
'& .unwrapped-log-line': {
display: 'grid',
gridTemplateColumns: getGridTemplateColumns(columns, displayedFields),
'& .field': {
overflow: 'hidden',
},
},
}),
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logListContainer: css({
display: 'flex',
flexDirection: 'row-reverse',
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
// Minimum width to prevent rendering issues and a sausage-like logs panel.
minWidth: theme.spacing(35),
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
}),
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
logListWrapper: css({
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
position: 'relative',
width: '100%',
New Logs Panel: font size selector and Log Details size improvments (#106376) * LogList: create font size option * LogList: prevent option fontSize bouncing * LogListContext: fix stored container size bigger than container * LogList: render smaller font size * virtualization: adjust to variable font size * virtualization: strip white characters of at the start successive long lines * LogList: add font size to log size cache * LogList: use getters instead of fixed constants * LogLine: prevent unnecessary overflow calls * virtualization: strip ansi color codes before measuring * LogListDetails: adjust size on resize and give logs panel a min width * LogsPanel: add showControls as a dashboard option * virtualization: update test * virtualization: add small test case * processing: update font size * LogListControls: update test * Extract translations * Logs Panel: enable controls by default * LogListContext: update mock * ControlledLogRows: add missing prop * LogLine: remove height ref * LogList: dont touch the debounced function on successive calls * LogLine: update test * LogsPanel: make controls default to false again * LogsPanel: make controls default to false again * LogLineDetails: fix height resizing and make close button sticky * LogLine: memo log component * LogLineDetails: fix close button position * New Logs Panel: Add Popover Menu support (#106394) * LogList: add popover menu support * LogList: test popover menu * Chore: remove unnecessary optional chain op * LogLinedDetails: fix close button position with and without scroll
2025-06-10 17:59:01 +08:00
}),
shortcut: css({
display: 'inline-flex',
alignItems: 'center',
gap: theme.spacing(1),
color: theme.colors.text.secondary,
opacity: 0.7,
fontSize: theme.typography.bodySmall.fontSize,
marginTop: theme.spacing(1),
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
}),
};
}
function handleScrollToEvent(event: ScrollToLogsEvent, logs: LogListModel[], list: VariableSizeList | null) {
if (event.payload.scrollTo === 'top') {
list?.scrollTo(0);
} else if (event.payload.scrollTo === 'bottom') {
list?.scrollToItem(logs.length - 1);
} else {
// uid
const index = logs.findIndex((log) => log.uid === event.payload.scrollTo);
if (index >= 0) {
list?.scrollToItem(index, 'center');
}
}
}
function getListHeight(containerElement: HTMLDivElement, app: CoreApp, searchVisible = false) {
return (
(app === CoreApp.Explore
? Math.max(window.innerHeight * 0.8, containerElement.clientHeight)
: containerElement.clientHeight) - (searchVisible ? LOG_LIST_SEARCH_HEIGHT : 0)
);
}