mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs Panel: Generate types from schema (#63716)
This commit is contained in:
parent
d56896cf72
commit
5ad074ff2c
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
keywords:
|
||||||
|
- grafana
|
||||||
|
- schema
|
||||||
|
title: LogsPanelCfg kind
|
||||||
|
---
|
||||||
|
> Both documentation generation and kinds schemas are in active development and subject to change without prior notice.
|
||||||
|
|
||||||
|
## LogsPanelCfg
|
||||||
|
|
||||||
|
#### Maturity: [experimental](../../../maturity/#experimental)
|
||||||
|
#### Version: 0.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Property | Type | Required | Description |
|
||||||
|
|----------------|-------------------------|----------|-------------|
|
||||||
|
| `PanelOptions` | [object](#paneloptions) | **Yes** | |
|
||||||
|
|
||||||
|
### PanelOptions
|
||||||
|
|
||||||
|
| Property | Type | Required | Description |
|
||||||
|
|----------------------|---------|----------|---------------------------------------------------------------|
|
||||||
|
| `dedupStrategy` | string | **Yes** | Possible values are: `none`, `exact`, `numbers`, `signature`. |
|
||||||
|
| `enableLogDetails` | boolean | **Yes** | |
|
||||||
|
| `prettifyLogMessage` | boolean | **Yes** | |
|
||||||
|
| `showCommonLabels` | boolean | **Yes** | |
|
||||||
|
| `showLabels` | boolean | **Yes** | |
|
||||||
|
| `showTime` | boolean | **Yes** | |
|
||||||
|
| `sortOrder` | string | **Yes** | Possible values are: `Descending`, `Ascending`. |
|
||||||
|
| `wrapLogMessage` | boolean | **Yes** | |
|
||||||
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { DataFrame } from './dataFrame';
|
|||||||
import { DataQueryRequest, DataQueryResponse } from './datasource';
|
import { DataQueryRequest, DataQueryResponse } from './datasource';
|
||||||
import { DataQuery } from './query';
|
import { DataQuery } from './query';
|
||||||
import { AbsoluteTimeRange } from './time';
|
import { AbsoluteTimeRange } from './time';
|
||||||
|
export { LogsDedupStrategy, LogsSortOrder } from '@grafana/schema';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of log level abbreviation to canonical log level.
|
* Mapping of log level abbreviation to canonical log level.
|
||||||
@ -39,11 +40,6 @@ export enum LogsMetaKind {
|
|||||||
Error,
|
Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LogsSortOrder {
|
|
||||||
Descending = 'Descending',
|
|
||||||
Ascending = 'Ascending',
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface LogsMetaItem {
|
export interface LogsMetaItem {
|
||||||
label: string;
|
label: string;
|
||||||
value: string | number | Labels;
|
value: string | number | Labels;
|
||||||
@ -106,13 +102,6 @@ export interface LogLabelStatsModel {
|
|||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LogsDedupStrategy {
|
|
||||||
none = 'none',
|
|
||||||
exact = 'exact',
|
|
||||||
numbers = 'numbers',
|
|
||||||
signature = 'signature',
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @deprecated will be removed in the next major version */
|
/** @deprecated will be removed in the next major version */
|
||||||
export interface LogsParser {
|
export interface LogsParser {
|
||||||
/**
|
/**
|
||||||
|
@ -109,6 +109,11 @@ export enum FrameGeometrySourceMode {
|
|||||||
Lookup = 'lookup',
|
Lookup = 'lookup',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum LogsSortOrder {
|
||||||
|
Ascending = 'Ascending',
|
||||||
|
Descending = 'Descending',
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO docs
|
* TODO docs
|
||||||
*/
|
*/
|
||||||
@ -697,6 +702,13 @@ export interface FrameGeometrySource {
|
|||||||
wkt?: string;
|
wkt?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum LogsDedupStrategy {
|
||||||
|
exact = 'exact',
|
||||||
|
none = 'none',
|
||||||
|
numbers = 'numbers',
|
||||||
|
signature = 'signature',
|
||||||
|
}
|
||||||
|
|
||||||
export interface Labels {}
|
export interface Labels {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
4
packages/grafana-schema/src/common/logs.cue
Normal file
4
packages/grafana-schema/src/common/logs.cue
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
package common
|
||||||
|
|
||||||
|
LogsSortOrder: "Descending" | "Ascending" @cuetsy(kind="enum")
|
||||||
|
LogsDedupStrategy: "none" | "exact" | "numbers" | "signature" @cuetsy(kind="enum",memberNames="none|exact|numbers|signature")
|
@ -892,7 +892,9 @@
|
|||||||
},
|
},
|
||||||
"logspanelcfg": {
|
"logspanelcfg": {
|
||||||
"category": "composable",
|
"category": "composable",
|
||||||
"codeowners": [],
|
"codeowners": [
|
||||||
|
"grafana/observability-logs"
|
||||||
|
],
|
||||||
"currentVersion": [
|
"currentVersion": [
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
@ -900,13 +902,13 @@
|
|||||||
"grafanaMaturityCount": 0,
|
"grafanaMaturityCount": 0,
|
||||||
"lineageIsGroup": true,
|
"lineageIsGroup": true,
|
||||||
"links": {
|
"links": {
|
||||||
"docs": "n/a",
|
"docs": "https://grafana.com/docs/grafana/next/developers/kinds/composable/logspanelcfg/schema-reference",
|
||||||
"go": "n/a",
|
"go": "n/a",
|
||||||
"schema": "n/a",
|
"schema": "https://github.com/grafana/grafana/tree/main/public/app/plugins/panel/logs/panelcfg.cue",
|
||||||
"ts": "n/a"
|
"ts": "https://github.com/grafana/grafana/tree/main/public/app/plugins/panel/logs/panelcfg.gen.ts"
|
||||||
},
|
},
|
||||||
"machineName": "logspanelcfg",
|
"machineName": "logspanelcfg",
|
||||||
"maturity": "planned",
|
"maturity": "experimental",
|
||||||
"name": "LogsPanelCfg",
|
"name": "LogsPanelCfg",
|
||||||
"pluralMachineName": "logspanelcfgs",
|
"pluralMachineName": "logspanelcfgs",
|
||||||
"pluralName": "LogsPanelCfgs",
|
"pluralName": "LogsPanelCfgs",
|
||||||
@ -1994,6 +1996,7 @@
|
|||||||
"geomappanelcfg",
|
"geomappanelcfg",
|
||||||
"histogrampanelcfg",
|
"histogrampanelcfg",
|
||||||
"librarypanel",
|
"librarypanel",
|
||||||
|
"logspanelcfg",
|
||||||
"lokidataquery",
|
"lokidataquery",
|
||||||
"newspanelcfg",
|
"newspanelcfg",
|
||||||
"nodegraphpanelcfg",
|
"nodegraphpanelcfg",
|
||||||
@ -2008,7 +2011,7 @@
|
|||||||
"textpanelcfg",
|
"textpanelcfg",
|
||||||
"xychartpanelcfg"
|
"xychartpanelcfg"
|
||||||
],
|
],
|
||||||
"count": 24
|
"count": 25
|
||||||
},
|
},
|
||||||
"mature": {
|
"mature": {
|
||||||
"name": "mature",
|
"name": "mature",
|
||||||
@ -2056,7 +2059,6 @@
|
|||||||
"jaegerdataquery",
|
"jaegerdataquery",
|
||||||
"jaegerdatasourcecfg",
|
"jaegerdatasourcecfg",
|
||||||
"livepanelcfg",
|
"livepanelcfg",
|
||||||
"logspanelcfg",
|
|
||||||
"lokidatasourcecfg",
|
"lokidatasourcecfg",
|
||||||
"microsoftsqlserverdataquery",
|
"microsoftsqlserverdataquery",
|
||||||
"microsoftsqlserverdatasourcecfg",
|
"microsoftsqlserverdatasourcecfg",
|
||||||
@ -2080,7 +2082,7 @@
|
|||||||
"zipkindataquery",
|
"zipkindataquery",
|
||||||
"zipkindatasourcecfg"
|
"zipkindatasourcecfg"
|
||||||
],
|
],
|
||||||
"count": 47
|
"count": 46
|
||||||
},
|
},
|
||||||
"stable": {
|
"stable": {
|
||||||
"name": "stable",
|
"name": "stable",
|
||||||
|
44
public/app/plugins/panel/logs/panelcfg.cue
Normal file
44
public/app/plugins/panel/logs/panelcfg.cue
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
// Copyright 2023 Grafana Labs
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License")
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package grafanaplugin
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/grafana/grafana/packages/grafana-schema/src/common"
|
||||||
|
)
|
||||||
|
|
||||||
|
composableKinds: PanelCfg: {
|
||||||
|
maturity: "experimental"
|
||||||
|
|
||||||
|
lineage: {
|
||||||
|
seqs: [
|
||||||
|
{
|
||||||
|
schemas: [
|
||||||
|
{
|
||||||
|
PanelOptions: {
|
||||||
|
showLabels: bool
|
||||||
|
showCommonLabels: bool
|
||||||
|
showTime: bool
|
||||||
|
wrapLogMessage: bool
|
||||||
|
prettifyLogMessage: bool
|
||||||
|
enableLogDetails: bool
|
||||||
|
sortOrder: common.LogsSortOrder
|
||||||
|
dedupStrategy: common.LogsDedupStrategy
|
||||||
|
} @cuetsy(kind="interface")
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
24
public/app/plugins/panel/logs/panelcfg.gen.ts
Normal file
24
public/app/plugins/panel/logs/panelcfg.gen.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Generated by:
|
||||||
|
// public/app/plugins/gen.go
|
||||||
|
// Using jennies:
|
||||||
|
// TSTypesJenny
|
||||||
|
// PluginTSTypesJenny
|
||||||
|
//
|
||||||
|
// Run 'make gen-cue' from repository root to regenerate.
|
||||||
|
|
||||||
|
import * as common from '@grafana/schema';
|
||||||
|
|
||||||
|
export const PanelCfgModelVersion = Object.freeze([0, 0]);
|
||||||
|
|
||||||
|
export interface PanelOptions {
|
||||||
|
dedupStrategy: common.LogsDedupStrategy;
|
||||||
|
enableLogDetails: boolean;
|
||||||
|
prettifyLogMessage: boolean;
|
||||||
|
showCommonLabels: boolean;
|
||||||
|
showLabels: boolean;
|
||||||
|
showTime: boolean;
|
||||||
|
sortOrder: common.LogsSortOrder;
|
||||||
|
wrapLogMessage: boolean;
|
||||||
|
}
|
@ -1,12 +1 @@
|
|||||||
import { LogsSortOrder, LogsDedupStrategy } from '@grafana/data';
|
export { PanelOptions as Options } from './panelcfg.gen';
|
||||||
|
|
||||||
export interface Options {
|
|
||||||
showLabels: boolean;
|
|
||||||
showCommonLabels: boolean;
|
|
||||||
showTime: boolean;
|
|
||||||
wrapLogMessage: boolean;
|
|
||||||
prettifyLogMessage: boolean;
|
|
||||||
enableLogDetails: boolean;
|
|
||||||
sortOrder: LogsSortOrder;
|
|
||||||
dedupStrategy: LogsDedupStrategy;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user