Explore: Implement logs sample in Explore (#61864)

* Implement log samples

* Explore: Implement logs sample panel

* Log samples: Add documentation

* Update docs

* Add info for log sample

* Fix label

* Update

* Default to true

* Fix copy in test

* Update public/app/features/explore/LogsSamplePanel.tsx

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Use timeZone from grafana/schema

* Rename data props to queryResponse

* Unify name to logs sample

* Remove redundant optional parameters in LogsSamplePanel

* Make intervalMs parameter optional in dataFrameToLogsModel and remove undefined argument when not needed

* Fix incorrect position of copy log line button

* Update public/app/core/logsModel.ts

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
This commit is contained in:
Ivana Huckova
2023-01-24 19:10:27 +01:00
committed by GitHub
parent e5920c211e
commit a0921f2e88
14 changed files with 296 additions and 45 deletions

View File

@@ -198,11 +198,13 @@ function isLogsData(series: DataFrame) {
* Convert dataFrame into LogsModel which consists of creating separate array of log rows and metrics series. Metrics
* series can be either already included in the dataFrame or will be computed from the log rows.
* @param dataFrame
* @param intervalMs In case there are no metrics series, we use this for computing it from log rows.
* @param intervalMs Optional. In case there are no metrics series, we use this for computing it from log rows.
* @param absoluteRange Optional. Used to store absolute range of executed queries in logs model. This is used for pagination.
* @param queries Optional. Used to store executed queries in logs model. This is used for pagination.
*/
export function dataFrameToLogsModel(
dataFrame: DataFrame[],
intervalMs: number | undefined,
intervalMs?: number,
absoluteRange?: AbsoluteTimeRange,
queries?: DataQuery[]
): LogsModel {
@@ -748,7 +750,7 @@ export function queryLogsVolume<TQuery extends DataQuery, TOptions extends DataS
}
/**
* Creates an observable, which makes requests to get logs samples.
* Creates an observable, which makes requests to get logs sample.
*/
export function queryLogsSample<TQuery extends DataQuery, TOptions extends DataSourceJsonData>(
datasource: DataSourceApi<TQuery, TOptions>,