grafana
Auto-generated from grafana/grafana by Mutable.ai Auto WikiRevise
grafana | |
---|---|
GitHub Repository | |
Developer | grafana |
Written in | TypeScript |
Stars | 60k |
Watchers | 1.3k |
Created | 12/11/2013 |
Last updated | 04/03/2024 |
License | GNU Affero General Public License v3.0 |
Homepage | grafana.com |
Repository | grafana/grafana |
Auto Wiki | |
Revision | |
Software Version | 0.0.8Basic |
Generated from | Commit aad79c |
Generated at | 04/05/2024 |
The Grafana repository is a powerful open-source data visualization and monitoring platform that allows users to create, explore, and share interactive dashboards. The repository contains the core functionality of the Grafana application, including features such as alerting, annotations, data source management, dashboard creation and management, Explore functionality, and various panel visualizations.
The most important parts of the repository are the …/alerting
, …/dashboard
, …/datasource
, and …/explore
directories, which collectively provide the foundation for the Grafana application's core features.
The …/alerting
directory contains the implementation of the alerting system in Grafana, including the management of alert rules, notification channels, and various other components and utilities that are essential for the alerting feature. The ThresholdMapper
class is responsible for mapping alert conditions to graph thresholds, and the alertDef.ts
file defines the structure of an alert query using the alertQueryDef
object.
The …/dashboard
directory contains the core functionality for managing and rendering Grafana dashboards. This includes the DashboardModel
class, which is the central component for managing the state and functionality of a Grafana dashboard, and the PanelModel
class, which is responsible for managing the state and behavior of individual panels within a dashboard. The DashboardLoaderSrv
and DashboardSrv
services handle the loading and saving of dashboards, respectively.
The …/datasource
directory contains the implementation of various data source plugins for the Grafana application, allowing users to connect to and query data from a wide range of data sources, such as Prometheus, Elasticsearch, Loki, and Jaeger. Each data source plugin is implemented as a separate subdirectory, with the main implementation in a datasource.ts
file.
The …/explore
directory provides the core functionality for the Grafana Explore feature, which allows users to quickly iterate on queries, explore data, and visualize the results in various formats, such as graphs, logs, tables, and trace views. This includes the implementation of the Trace View component, which provides a comprehensive visualization and analysis experience for trace data, and the Logs feature, which handles the rendering, interaction, and management of log data.
The Grafana repository relies on several key technologies and design choices, including:
- React: The Grafana user interface is built using the React library, which provides a component-based architecture and efficient rendering.
- Redux: The application state is managed using the Redux library, which provides a predictable state container and a unidirectional data flow.
- Modular Design: The codebase is organized into well-defined modules and directories, each with a specific responsibility, promoting maintainability and extensibility.
- Plugins: The Grafana platform is designed to be extensible through plugins, allowing users to integrate with a wide range of data sources and visualizations.
- Backend Services: The repository includes a robust set of backend services and APIs that provide the foundation for the Grafana application, handling tasks such as authentication, authorization, and data storage.
Alerting Dashboards and Panels Data Source Integration Visualization and UI Components Backend Services and API Plugins and Extensions Explore Functionality Internationalization and Localization Utility Functions and Services
AlertingRevise
The core functionality of the …/alerting
directory is to manage the alerting system in the Grafana application. This includes the management of alert rules, notification channels, and the overall state of the alerting system.
Alert RulesRevise
References: public/app/features/alerting/unified/components/rule-editor
, public/app/features/alerting/unified/components/rules
, public/app/features/alerting/unified/api
The core functionality for managing alert rules in the Grafana Alerting Unified system is implemented in the …/rule-editor
directory. This includes components and utilities for creating, editing, and deleting both Grafana-managed and cloud-based alert rules.
Alert NotificationsRevise
References: public/app/features/alerting/unified/components/receivers
, public/app/features/alerting/unified/api
The …/receivers
directory contains the core functionality for managing alert notification receivers in the Grafana Alerting Unified feature.
Alerting State ManagementRevise
References: public/app/features/alerting/unified/components/alert-groups
, public/app/features/alerting/unified/components/silences
, public/app/features/alerting/unified/home
, public/app/features/alerting/unified/insights
, public/app/features/alerting/unified/state
The core functionality for managing the state and lifecycle of alerts in the Grafana Alerting Unified system is primarily implemented in the following components and modules:
Alerting IntegrationsRevise
References: public/app/features/alerting/unified/components/receivers/grafanaAppReceivers
, public/app/features/alerting/unified/components/bridges
The Grafana Alerting Unified feature provides functionality to integrate with other Grafana plugins and services, such as the Grafana On-Call and Incident Management plugins.
Dashboards and PanelsRevise
References: public/app/features/dashboard
, packages/grafana-data
The core functionality for managing and rendering Grafana dashboards is primarily handled in the …/dashboard
directory. This directory contains components and services responsible for loading, saving, and interacting with dashboards, as well as handling various dashboard-related features.
Dashboard Loading and InitializationRevise
References: public/app/features/dashboard/state/initDashboard.ts
, public/app/features/dashboard/state/reducers.ts
The initDashboard.ts
file in the Grafana codebase is responsible for initializing and loading a dashboard. It handles the process of fetching the dashboard data, creating the dashboard model, and setting up the necessary services and dependencies.
Dashboard State ManagementRevise
References: public/app/features/dashboard/state/DashboardModel.ts
, public/app/features/dashboard/state/PanelModel.ts
The DashboardModel
class in the …/DashboardModel.ts
file is the central component for managing the state and functionality of a Grafana dashboard. It handles various aspects of the dashboard, including:
Dashboard Rendering and LayoutRevise
References: public/app/features/dashboard/dashgrid/DashboardGrid.tsx
, public/app/features/dashboard/dashgrid/DashboardPanel.tsx
, public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx
The DashboardGrid
class in the file …/DashboardGrid.tsx
is responsible for rendering the dashboard grid layout in the Grafana application. It uses the ReactGridLayout
library to manage the positioning and resizing of panels within the dashboard.
Dashboard Sharing and ExportingRevise
References: public/app/features/dashboard/components/ShareModal
, public/app/features/dashboard/components/DashExportModal
The …/ShareModal
directory contains the functionality for sharing and exporting Grafana dashboards. This includes generating shareable links, creating public snapshots, embedding dashboards or panels, and exporting dashboards as JSON.
Dashboard Settings and ConfigurationRevise
The DashboardSettings
component in the Grafana dashboard settings is responsible for managing the various settings and configurations of a Grafana dashboard. This includes functionality for handling general settings, annotations, variables, links, and permissions.
Panel Editor and ConfigurationRevise
The core functionality for the panel editor in the Grafana dashboard is managed by the PanelEditor
component, defined in the …/PanelEditor.tsx
file. This component is responsible for handling the state of the panel, managing user interactions, and rendering the various UI elements required for editing a panel.
AI-Powered Dashboard EnhancementsRevise
References: public/app/features/dashboard/components/GenAI
The …/GenAI
directory contains the core functionality for integrating large language models (LLMs) into the Grafana dashboard. This includes components for generating and managing AI-generated content, such as panel descriptions, dashboard titles, and dashboard changes summaries.
Data Source IntegrationRevise
References: public/app/plugins/datasource
, packages/grafana-data
The Grafana data visualization platform provides a wide range of data source plugins, allowing users to connect to and query data from a diverse set of data sources. These data source plugins are implemented in the …/datasource
directory, and each plugin handles the specific functionality required to interact with its respective data source.
Alertmanager Data SourceRevise
The AlertManagerDatasource
class is the main implementation of the Alertmanager data source in the Grafana application. This data source is responsible for interacting with the Alertmanager component of the Prometheus monitoring system, allowing Grafana to display and manage alerts from the Alertmanager.
Azure Monitor Data SourceRevise
References: public/app/plugins/datasource/azuremonitor/datasource.ts
, public/app/plugins/datasource/azuremonitor/azure_log_analytics/azure_log_analytics_datasource.ts
, public/app/plugins/datasource/azuremonitor/azure_monitor/azure_monitor_datasource.ts
The Datasource
class in …/datasource.ts
is the main entry point for the Azure Monitor data source plugin in Grafana. It serves as a wrapper around several sub-datasources, each responsible for handling specific types of Azure Monitor queries:
Cloud Monitoring Data SourceRevise
References: public/app/plugins/datasource/cloud-monitoring/datasource.ts
, public/app/plugins/datasource/cloud-monitoring/CloudMonitoringMetricFindQuery.ts
The CloudMonitoringDataSource
class in the …/datasource.ts
file is the main implementation of the Google Cloud Monitoring data source in Grafana. This class is responsible for handling data queries, annotations, and variable support for the Cloud Monitoring service.
CloudWatch Data SourceRevise
The CloudWatchDatasource
class is the main implementation of the CloudWatch data source plugin for Grafana. It provides functionality to query CloudWatch metrics, logs, and annotations.
Elasticsearch Data SourceRevise
The grafana/public/app/plugins/datasource/elasticsearch/datasource.ts
file contains the implementation of the Elasticsearch data source plugin for Grafana. The main class responsible for this implementation is the ElasticDatasource
class, which extends the DataSourceWithBackend
class and implements several interfaces to provide additional functionality.
Grafana Data SourceRevise
References: public/app/plugins/datasource/grafana/datasource.ts
, public/app/plugins/datasource/grafana/components
The GrafanaDatasource
class is the main implementation of the Grafana data source plugin. It extends the DataSourceWithBackend
class and provides functionality for querying and retrieving data from the Grafana data source.
Grafana PostgreSQL Data SourceRevise
References: public/app/plugins/datasource/grafana-postgresql-datasource/datasource.ts
, public/app/plugins/datasource/grafana-postgresql-datasource/configuration
The PostgresDatasource
class in the …/datasource.ts
file is the main implementation of the Grafana PostgreSQL data source. It extends the SqlDatasource
class from the @grafana/sql
package, which provides a common interface for working with SQL-based data sources.
Visualization and UI ComponentsRevise
References: packages/grafana-ui/src
, public/app/plugins/panel
The Grafana UI library, located in the …/src
directory, provides a comprehensive set of reusable UI components and visualization functionality that power the Grafana user interface. This directory is organized into several sub-directories, each focusing on a specific aspect of the user interface.
Components for Rendering VisualizationsRevise
References: packages/grafana-ui/src/components
The core UI components responsible for rendering various data visualizations in the Grafana user interface are primarily located in the …/components
directory. These components provide a wide range of functionality, from basic UI elements like buttons and labels to more complex data visualization components.
Date and Time PickersRevise
The …/DateTimePickers
directory contains a collection of React components and utility functions that provide date and time picker functionality for the Grafana UI library.
Form ComponentsRevise
References: packages/grafana-ui/src/components/Forms
The …/Forms
directory contains a collection of reusable React components that provide form-related functionality for the Grafana user interface.
Table VisualizationRevise
References: packages/grafana-ui/src/components/Table
The core functionality of the table visualization component in the Grafana UI library is implemented in the …/Table
directory. This directory contains a comprehensive set of components, hooks, and utility functions that work together to provide a highly customizable and feature-rich table implementation.
Node Graph VisualizationRevise
References: public/app/plugins/panel/nodeGraph
The core functionality of the node graph visualization in the Grafana UI is implemented in the …/nodeGraph
directory. The main components and functionality are as follows:
XY Chart VisualizationRevise
References: public/app/plugins/panel/xychart
The core functionality of the XY chart visualization component in the Grafana UI is implemented in the …/xychart
directory. The main components and functionality are as follows:
Stat PanelRevise
References: public/app/plugins/panel/stat
The Stat panel is a native panel plugin in the Grafana data visualization platform. The core functionality of the Stat panel is to display a single large statistic with an optional graph sparkline.
Canvas PanelRevise
References: public/app/plugins/panel/canvas
The Canvas Panel in the Grafana application provides a flexible canvas-based visualization feature. The core functionality of this panel is managed by the CanvasPanel
class, located in the …/CanvasPanel.tsx
file.
Geomap PanelRevise
References: public/app/plugins/panel/geomap
The Geomap Panel is a plugin that provides geographic data visualization in the Grafana UI. The core functionality of the Geomap Panel is implemented in the …/geomap
directory.
Time Series PanelRevise
References: public/app/plugins/panel/timeseries
The Time Series panel is a core panel plugin in the Grafana data visualization platform. It is responsible for rendering time series data in a variety of visualizations, including line charts, area charts, and bar charts.
Table PanelRevise
References: public/app/plugins/panel/table
The Table Panel is a core panel plugin in the Grafana data visualization platform. It provides a highly flexible table-based visualization that supports multiple data formats, including time series, tables, annotations, and raw JSON data.
Backend Services and APIRevise
References: pkg/api
, pkg/apimachinery
, pkg/services
The core backend services and API functionality that provide the foundation for the Grafana application include the following:
Access ControlRevise
References: pkg/services/accesscontrol
The core functionality of the …/accesscontrol
directory is to manage access control and permissions for various Grafana resources. This includes the following key components:
Alerting ServiceRevise
References: pkg/services/ngalert
The core functionality for the Grafana Unified Alerting system is managed in the …/ngalert
directory. This directory contains the following key components:
API ServerRevise
References: pkg/services/apiserver
The core functionality of the Grafana API server is implemented in the …/apiserver
directory. The main components and their responsibilities are as follows:
Dashboard ManagementRevise
References: pkg/services/dashboards
The core functionality for managing and rendering Grafana dashboards is implemented in the …/dashboards
directory. This directory contains the following key components:
Data Source IntegrationRevise
References: pkg/services/sqlstore
The core functionality for the data source integration in Grafana is provided in the …/datasource
directory. This directory contains the implementation of various data source plugins, allowing users to connect to and query data from a wide range of data sources, such as Alertmanager, Azure Monitor, Cloud Monitoring, CloudWatch, Elasticsearch, Grafana, and more.
Live Data StreamingRevise
References: pkg/services/live
The core functionality for the Grafana Live service, which enables real-time communication and event broadcasting within the Grafana platform, is implemented in the …/live
directory. This directory contains several sub-directories, each with its own specialized functionality:
Plugins IntegrationRevise
References: pkg/services/pluginsintegration
The …/pluginsintegration
directory is responsible for managing the integration of plugins in the Grafana application. It provides a comprehensive set of services and components that handle various aspects of plugin management, including plugin discovery, initialization, validation, and external integration.
ProvisioningRevise
References: pkg/services/provisioning
The core functionality for provisioning various resources in the Grafana application, including dashboards, data sources, plugins, and alerting configurations, is implemented in the …/provisioning
directory.
Secrets ManagementRevise
References: pkg/services/secrets
The core functionality for managing secrets and encryption keys in the Grafana application is implemented in the …/secrets
directory. The key components are:
Storage ServiceRevise
References: pkg/services/store
The core functionality for managing the storage of various entities in the Grafana application, including dashboards, folders, library panels, playlists, reports, and snapshots, is implemented in the …/store
directory.
Plugins and ExtensionsRevise
References: public/app/plugins
, packages/grafana-plugin-configs
The Grafana data visualization platform allows users to extend its functionality through plugins. These plugins can provide integrations with various data sources, as well as custom panel visualizations.
Data Source PluginsRevise
References: public/app/plugins/datasource
The …/datasource
directory contains the implementation of various data source plugins for Grafana, allowing users to connect to and query data from a wide range of data sources.
Alertmanager Data SourceRevise
References: public/app/plugins/datasource/alertmanager
The main implementation of the Alertmanager data source is the AlertManagerDatasource
class, which is defined in the …/DataSource.ts
file. This class is responsible for handling the communication between Grafana and the Alertmanager component of the Prometheus monitoring system.
Azure Monitor Data SourceRevise
References: public/app/plugins/datasource/azuremonitor
The AzureMonitorDatasource
class is the main implementation of the Azure Monitor data source in the Grafana application. It extends the DataSourceWithBackend
class, which provides the base functionality for a Grafana data source.
Cloud Monitoring Data SourceRevise
References: public/app/plugins/datasource/cloud-monitoring
The main implementation of the Google Cloud Monitoring data source is handled by the CloudMonitoringDatasource
class, defined in the …/datasource.ts
file.
CloudWatch Data SourceRevise
References: public/app/plugins/datasource/cloudwatch
The main implementation of the CloudWatch data source is provided by the CloudWatchDatasource
class, which is responsible for handling different types of CloudWatch queries, including metrics, logs, and annotations.
Elasticsearch Data SourceRevise
References: public/app/plugins/datasource/elasticsearch
The main implementation of the Elasticsearch data source in the Grafana application is located in the …/elasticsearch
directory. This directory contains the core functionality for managing and rendering various aspects of the Elasticsearch query, including the query editor, metric and bucket aggregations, and data links.
Grafana Data SourceRevise
References: public/app/plugins/datasource/grafana
The main implementation of the Grafana data source is provided in the GrafanaDatasource
class, located in the …/datasource.ts
file. This class is responsible for handling data queries, annotations, and other data-related functionality for the Grafana data source plugin.
Grafana PostgreSQL Data SourceRevise
The main implementation of the Grafana PostgreSQL data source is provided in the …/grafana-postgresql-datasource
directory. The key components and functionality are as follows:
Loki Data SourceRevise
References: public/app/plugins/datasource/loki
The main implementation of the Loki data source in the Grafana data visualization platform is located in the …/loki
directory. This directory contains the core functionality for rendering the Loki query editor, handling Loki annotations, providing a cheat sheet for the Loki query language, and managing the Loki log context UI.
InfluxDB Data SourceRevise
References: public/app/plugins/datasource/influxdb
The main implementation of the InfluxDB data source in the Grafana application is handled by the InfluxDatasource
class, defined in the …/datasource.ts
file. This class provides the core functionality for querying data, handling annotations, and retrieving metadata from an InfluxDB time series database.
Prometheus Data SourceRevise
References: public/app/plugins/datasource/prometheus
The main implementation of the Prometheus data source in the Grafana application is located in the …/prometheus
directory. This directory contains the core functionality for querying, visualizing, and managing Prometheus data within the Grafana ecosystem.
Tempo Data SourceRevise
References: public/app/plugins/datasource/tempo
The main implementation of the Tempo data source is located in the …/tempo
directory. This directory contains several sub-directories and files that provide various features and capabilities for the Tempo data source plugin.
Panel VisualizationsRevise
References: public/app/plugins/panel
The Grafana data visualization platform provides a wide range of panel visualizations, each with its own implementation and functionality. These panel plugins allow users to display data in various formats, including time series graphs, heatmaps, gauges, histograms, and more.
Alert List PanelRevise
References: public/app/plugins/panel/alertlist
The Alert List panel in the Grafana monitoring platform is responsible for displaying a list of alerts, allowing users to view and interact with the current state of alerts or recent alert state changes. The core functionality of the Alert List panel is implemented in the …/alertlist
directory.
Annotation List PanelRevise
References: public/app/plugins/panel/annolist
The Annotation List panel is a core feature of the Grafana data visualization platform, allowing users to quickly collect, filter, and access annotations for easy reference or referral. The main implementation of this panel is found in the …/annolist
directory.
Bar Chart PanelRevise
References: public/app/plugins/panel/barchart
The implementation of the Bar Chart panel in the Grafana data visualization tool is primarily handled by the BarChartPanel
component in the …/BarChartPanel.tsx
file.
Bar Gauge PanelRevise
References: public/app/plugins/panel/bargauge
The implementation of the Bar Gauge panel in the Grafana data visualization platform is primarily handled in the …/bargauge
directory. The key components and functionality are as follows:
Candlestick PanelRevise
References: public/app/plugins/panel/candlestick
The Candlestick panel in the Grafana data visualization platform is responsible for rendering a candlestick chart, which is commonly used to display the price movements of securities, derivatives, or currencies.
Canvas PanelRevise
References: public/app/plugins/panel/canvas
The Canvas Panel in the Grafana application is implemented in the …/canvas
directory. The main component responsible for rendering and managing the canvas-based visualization is the CanvasPanel
class, defined in the …/CanvasPanel.tsx
file.
Dashboard List PanelRevise
References: public/app/plugins/panel/dashlist
The Dashboard List panel is a Grafana panel plugin that allows users to display a list of dashboards based on various criteria, such as starred dashboards, recently viewed dashboards, and dashboards matching a search query.
Datagrid PanelRevise
References: public/app/plugins/panel/datagrid
The Datagrid Panel in the Grafana project is a core panel plugin that allows users to view, edit, and manipulate tabular data within the Grafana application. The main implementation of this panel is located in the …/datagrid
directory.
Debug PanelRevise
References: public/app/plugins/panel/debug
The Debug Panel in Grafana is a panel plugin that provides various debugging tools and information to help users debug their panels. The main implementation of this panel is in the …/DebugPanel.tsx
file.
Flame Graph PanelRevise
References: public/app/plugins/panel/flamegraph
The Flame Graph panel in the Grafana application is implemented in the …/flamegraph
directory. The main functionality is handled by the FlameGraphPanel
component, which is responsible for rendering the flame graph visualization.
Geomap PanelRevise
References: public/app/plugins/panel/geomap
The Geomap panel in the Grafana visualization plugin is responsible for rendering geographic data on a map. The core functionality of the Geomap panel is implemented in the …/
directory.
Node Graph PanelRevise
References: public/app/plugins/panel/nodeGraph
The Node Graph panel in the Grafana nodeGraph
plugin provides a comprehensive visualization of a directed graph or network. The core functionality of this panel is implemented in the …/NodeGraph.tsx
file.
Time Series PanelRevise
References: public/app/plugins/panel/timeseries
The TimeSeriesPanel
component in the …/TimeSeriesPanel.tsx
file is responsible for rendering a time series panel in the Grafana visualization tool. It handles the display of time series data, annotations, thresholds, and various plugins that enhance the functionality of the panel.
Table PanelRevise
References: public/app/plugins/panel/table
The core functionality of the Table Panel in the Grafana data visualization platform is to render a table-based visualization. The TablePanel
component, defined in …/TablePanel.tsx
, is responsible for this functionality.
XY Chart PanelRevise
References: public/app/plugins/panel/xychart
The XY Chart panel in the Grafana data visualization platform provides a flexible way to plot arbitrary X vs Y data in a graph. The core functionality of this panel is implemented in the …/xychart
directory.
Configuration and SettingsRevise
References: packages/grafana-data/src
The …/src
directory contains the core functionality and data types used throughout the Grafana data visualization platform. This directory covers a wide range of functionality, including configuration and settings management.
ThemesRevise
References: packages/grafana-data/src/themes
The …/themes
directory in the Grafana project provides a comprehensive set of utilities and functionality for managing and customizing the visual themes of the Grafana application.
Date and Time HandlingRevise
References: packages/grafana-data/src/datetime
The …/datetime
directory contains a comprehensive set of utilities and functionality for handling date and time-related operations in the Grafana application. This includes:
Value FormattingRevise
References: packages/grafana-data/src/valueFormats
The grafana-data/src/valueFormats
directory contains a collection of modules and utilities for formatting various types of values, including numerical, date/time, and boolean values.
Explore FunctionalityRevise
References: public/app/features/explore
The Grafana Explore feature provides a powerful and flexible interface for users to focus on querying data without the overhead of building dashboards. The core functionality of the Explore feature is implemented across several directories and files in the Grafana codebase, with each component handling a specific aspect of the overall functionality.
Trace View FunctionalityRevise
The Trace View component in the Grafana Explore feature provides a comprehensive visualization and analysis experience for trace data. The core functionality includes:
Critical Path ComputationRevise
The core functionality for computing the critical path in a Jaeger trace is implemented in the …/index.tsx
file. This file exports two key functions:
Trace View HeaderRevise
The …/TracePageHeader
directory contains the implementation of the header section for the Trace View in the Grafana Explore feature. This header displays key information about the trace, such as the trace name, duration, timestamp, and relevant HTTP tags (method, status, and URL). It also includes functionality for external links, trace actions, and span filters.
Trace Timeline ViewerRevise
The core functionality of the Trace Timeline Viewer is implemented in the …/TraceTimelineViewer
directory. This directory contains several key components that work together to provide a virtualized and interactive view of the trace timeline.
Common Components and UtilitiesRevise
The …/common
directory contains several reusable React components that are used throughout the Grafana Explore TraceView feature. These components provide common functionality, such as rendering breakable text, copy-to-clipboard buttons, external links, labeled lists, and search input fields.
Trace Data ModelingRevise
The …/model
directory contains the core functionality for handling and transforming trace data in the Grafana Explore module. This directory defines the main types and classes used to represent the structure and relationships within a trace, including TDdgService
, TDdgOperation
, TDdgPath
, and PathElem
. It also provides utility functions for processing and computing trace links, as well as transforming the trace data into a format suitable for the Grafana Explore application.
Selectors and UtilitiesRevise
The utility functions and selectors related to the handling and visualization of trace data are located in the …/selectors
directory.
Span Bar SettingsRevise
The SpanBarSettings
component in the …/settings
directory provides the functionality for configuring the span bar settings in the Grafana Explore TraceView component.
Logs FunctionalityRevise
References: public/app/features/explore/Logs
The core functionality for the Logs feature in the Grafana Explore section is handled by the …/Logs
directory. This directory contains several key components and utilities that are responsible for rendering, interacting with, and managing log data within the Grafana Explore experience.
Live LogsRevise
References: public/app/features/explore/Logs
The LiveLogs
component in the …/LiveLogs.tsx
file is responsible for rendering live logs in real-time in the Grafana Explore feature. This component allows users to pause, resume, and clear the log stream.
Logs Deduplication and FilteringRevise
References: public/app/features/explore/Logs
The Logs
component in the …/Logs.tsx
file is responsible for rendering and managing the display of historical log data in the Grafana Explore feature. This component provides functionality for deduplicating and filtering log rows, allowing users to customize the way log data is presented.
Log Context and PermalinksRevise
References: public/app/features/explore/Logs
The Logs
component in the …/Logs.tsx
file is responsible for handling the log context and permalink functionality in the Grafana Explore feature.
Logs ContainerRevise
References: public/app/features/explore/Logs
The LogsContainer
component is the central hub for managing the logs functionality in the Grafana Explore feature. It is responsible for the following key functionalities:
Logs TableRevise
References: public/app/features/explore/Logs
The LogsTable
component in the …/LogsTable.tsx
file is responsible for rendering a table-based view of the log data in the Grafana Explore feature. It provides functionality for sorting, filtering, and applying field overrides to the log data.
Logs Volume FunctionalityRevise
References: public/app/features/explore/Logs
The LogsVolumePanel
component in the …/LogsVolumePanel.tsx
file is responsible for rendering a logs volume histogram graph in the Grafana Explore feature. The component handles various scenarios, such as loading state, timeout errors, and errors in the logs volume data.
Explore State ManagementRevise
References: public/app/features/explore/state
The Redux state management logic for the Explore feature in Grafana is implemented in the …/state
directory. This includes actions, reducers, and utility functions for managing the state of the Explore panes, data sources, queries, time ranges, rich history, and correlation editor.
Explore HooksRevise
References: public/app/features/explore/hooks
The Grafana Explore feature utilizes several React hooks to handle various aspects of its functionality. These hooks play a crucial role in synchronizing the Explore state with the URL, managing keyboard shortcuts, updating the page title and navigation, and handling the split size of the Explore panes.
Rich History FunctionalityRevise
References: public/app/features/explore/RichHistory
The Rich History feature in the Grafana Explore view allows users to view, filter, and interact with their past queries. The core functionality is implemented in the following files and components:
Prometheus List ViewRevise
References: public/app/features/explore/PrometheusListView
The …/PrometheusListView
directory contains the components and utilities responsible for rendering the Prometheus list view in the Grafana Explore UI. The main functionality includes transforming Prometheus query results into a format suitable for display in a virtualized list, rendering the list items with expandable attributes, and providing functionality for copying the raw query string to the clipboard.
Explore UtilitiesRevise
References: public/app/features/explore/utils
The …/utils
directory contains a wide range of utility functions and services used throughout the Grafana Explore feature. These utilities are responsible for processing and decorating data frames from different data sources, such as graphs, logs, tables, and flame graphs, to prepare them for display in the Explore view.
Explore ExtensionsRevise
References: public/app/features/explore/extensions
The functionality for extending the Explore feature in Grafana is provided in the …/extensions
directory. This includes the implementation of the "Add to Dashboard" and "Add Correlation" functionality.
Explore GraphRevise
References: public/app/features/explore/Graph
The core functionality for rendering a graph visualization in the Grafana Explore feature is provided by the ExploreGraph
component and related utility functions.
Logs UtilitiesRevise
References: public/app/features/explore/Logs/utils
The …/utils
directory contains several utility files that provide functionality related to the Logs feature in the Grafana Explore section.
Content OutlineRevise
References: public/app/features/explore/ContentOutline
The implementation of the content outline feature in the Grafana Explore panel is handled in the …/ContentOutline
directory. The main components and functionality are:
Explore Functionality TestsRevise
References: public/app/features/explore/spec
The …/spec
directory contains unit tests for the Explore feature in Grafana. The tests cover various aspects of the Explore functionality, including:
Internationalization and LocalizationRevise
References: public/app/core/internationalization
The core functionality for handling internationalization and localization in the Grafana application is implemented in the …/internationalization
directory. This directory contains the necessary components and utilities to set up the i18next library for managing translations, provide utility functions for changing the language and formatting dates, and export a custom Trans
component for rendering translated content.
Internationalization ConstantsRevise
References: public/app/core/internationalization/constants.ts
, public/app/core/internationalization/constants.test.ts
The constants.ts
file in the Grafana internationalization module defines various constants and language definitions for supporting multiple languages in the Grafana application.
Internationalization SetupRevise
References: public/app/core/internationalization/index.tsx
The grafana/public/app/core/internationalization/index.tsx
file is responsible for setting up the internationalization and localization functionality in the Grafana application. It initializes the i18next
library, which is a popular internationalization framework for JavaScript, and provides utility functions for managing the current language and formatting dates.
Translated Content RenderingRevise
References: public/app/core/internationalization/index.tsx
The Trans
component and related utility functions in the …/index.tsx
file are responsible for rendering translated content in the Grafana application.
Utility Functions and ServicesRevise
References: public/app/core/utils
, packages/grafana-data/src
The Grafana codebase provides a wide range of utility functions and services that are used throughout the application. These utilities cover various aspects of the application, including data handling, event management, and geo layer functionality.
CSV UtilitiesRevise
References: packages/grafana-data/src/utils/csv.ts
The csv.ts
file in the grafana-data
package provides functionality for reading and writing CSV (Comma-Separated Values) data in Grafana. The key features include:
Data Link UtilitiesRevise
References: packages/grafana-data/src/utils/dataLinks.ts
The dataLinks.ts
file in the grafana-data
package provides utility functions and types related to data links in Grafana. The primary functionality is centered around the mapInternalLinkToExplore()
function, which is responsible for creating internal links for the Grafana Explore feature.
Data Source UtilitiesRevise
References: packages/grafana-data/src/utils/datasource.ts
The grafana-data/src/utils/datasource.ts
file contains utility functions related to data sources in the Grafana application. These functions provide functionality for working with data source references, updating data source options, and handling secure JSON data.
Deprecation Warning UtilityRevise
The deprecationWarning()
function in the …/deprecationWarning.ts
file provides a utility for logging deprecation warnings to the console. This function helps inform users about deprecated functionality in the Grafana application and suggests alternative options where applicable.
Array and Number UtilitiesRevise
References: packages/grafana-data/src/utils/arrayUtils.ts
, packages/grafana-data/src/utils/numbers.ts
The arrayUtils.ts
file provides utility functions for working with arrays, including:
Location and URL UtilitiesRevise
The location.ts
and url.ts
files in the …/utils
directory provide a set of utility functions for working with URLs and the browser's location object in the Grafana application.
Value Mapping UtilitiesRevise
References: packages/grafana-data/src/utils/valueMappings.ts
The valueMappings.ts
file in the Grafana data package provides utility functions for handling value mappings in Grafana. Value mappings are used to transform data values into more meaningful or readable text representations.
Miscellaneous UtilitiesRevise
References: packages/grafana-data/src/utils/makeClassES5Compatible.ts
, packages/grafana-data/src/utils/matchPluginId.ts
, packages/grafana-data/src/utils/namedColorsPalette.ts
, packages/grafana-data/src/utils/nodeGraph.ts
, packages/grafana-data/src/utils/selectUtils.ts
, packages/grafana-data/src/utils/series.ts
, packages/grafana-data/src/utils/unaryOperators.ts
, packages/grafana-data/src/utils/variables.ts
, packages/grafana-data/src/utils/withLoadingIndicator.ts
This subsection covers the various other utility files in the …/utils
directory, including functionality for text processing, string manipulation, node graph rendering, and variable handling.