Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
721e1d75
Commit
721e1d75
authored
Dec 05, 2018
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renames Grafana Logging ds to Loki
parent
3c330c8e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
33 additions
and
34 deletions
+33
-34
public/app/features/plugins/built_in_plugins.ts
+2
-2
public/app/plugins/datasource/logging/README.md
+0
-4
public/app/plugins/datasource/loki/README.md
+3
-0
public/app/plugins/datasource/loki/components/LokiCheatSheet.tsx
+1
-1
public/app/plugins/datasource/loki/components/LokiQueryField.tsx
+7
-7
public/app/plugins/datasource/loki/components/LokiStartPage.tsx
+3
-3
public/app/plugins/datasource/loki/datasource.ts
+3
-3
public/app/plugins/datasource/loki/img/grafana_icon.svg
+0
-0
public/app/plugins/datasource/loki/img/loki_icon.svg
+0
-0
public/app/plugins/datasource/loki/language_provider.test.ts
+0
-0
public/app/plugins/datasource/loki/language_provider.ts
+1
-1
public/app/plugins/datasource/loki/module.ts
+6
-6
public/app/plugins/datasource/loki/partials/config.html
+0
-0
public/app/plugins/datasource/loki/plugin.json
+7
-7
public/app/plugins/datasource/loki/query_utils.test.ts
+0
-0
public/app/plugins/datasource/loki/query_utils.ts
+0
-0
public/app/plugins/datasource/loki/result_transformer.test.ts
+0
-0
public/app/plugins/datasource/loki/result_transformer.ts
+0
-0
public/app/plugins/datasource/loki/syntax.ts
+0
-0
No files found.
public/app/features/plugins/built_in_plugins.ts
View file @
721e1d75
...
@@ -4,7 +4,7 @@ import * as elasticsearchPlugin from 'app/plugins/datasource/elasticsearch/modul
...
@@ -4,7 +4,7 @@ import * as elasticsearchPlugin from 'app/plugins/datasource/elasticsearch/modul
import
*
as
opentsdbPlugin
from
'app/plugins/datasource/opentsdb/module'
;
import
*
as
opentsdbPlugin
from
'app/plugins/datasource/opentsdb/module'
;
import
*
as
grafanaPlugin
from
'app/plugins/datasource/grafana/module'
;
import
*
as
grafanaPlugin
from
'app/plugins/datasource/grafana/module'
;
import
*
as
influxdbPlugin
from
'app/plugins/datasource/influxdb/module'
;
import
*
as
influxdbPlugin
from
'app/plugins/datasource/influxdb/module'
;
import
*
as
lo
ggingPlugin
from
'app/plugins/datasource/logging
/module'
;
import
*
as
lo
kiPlugin
from
'app/plugins/datasource/loki
/module'
;
import
*
as
mixedPlugin
from
'app/plugins/datasource/mixed/module'
;
import
*
as
mixedPlugin
from
'app/plugins/datasource/mixed/module'
;
import
*
as
mysqlPlugin
from
'app/plugins/datasource/mysql/module'
;
import
*
as
mysqlPlugin
from
'app/plugins/datasource/mysql/module'
;
import
*
as
postgresPlugin
from
'app/plugins/datasource/postgres/module'
;
import
*
as
postgresPlugin
from
'app/plugins/datasource/postgres/module'
;
...
@@ -33,7 +33,7 @@ const builtInPlugins = {
...
@@ -33,7 +33,7 @@ const builtInPlugins = {
'app/plugins/datasource/opentsdb/module'
:
opentsdbPlugin
,
'app/plugins/datasource/opentsdb/module'
:
opentsdbPlugin
,
'app/plugins/datasource/grafana/module'
:
grafanaPlugin
,
'app/plugins/datasource/grafana/module'
:
grafanaPlugin
,
'app/plugins/datasource/influxdb/module'
:
influxdbPlugin
,
'app/plugins/datasource/influxdb/module'
:
influxdbPlugin
,
'app/plugins/datasource/lo
gging/module'
:
logging
Plugin
,
'app/plugins/datasource/lo
ki/module'
:
loki
Plugin
,
'app/plugins/datasource/mixed/module'
:
mixedPlugin
,
'app/plugins/datasource/mixed/module'
:
mixedPlugin
,
'app/plugins/datasource/mysql/module'
:
mysqlPlugin
,
'app/plugins/datasource/mysql/module'
:
mysqlPlugin
,
'app/plugins/datasource/postgres/module'
:
postgresPlugin
,
'app/plugins/datasource/postgres/module'
:
postgresPlugin
,
...
...
public/app/plugins/datasource/logging/README.md
deleted
100644 → 0
View file @
3c330c8e
# Grafana Logging Datasource - Native Plugin
This is a
**built in**
datasource that allows you to connect to Grafana's logging service.
\ No newline at end of file
public/app/plugins/datasource/loki/README.md
0 → 100644
View file @
721e1d75
# Loki Datasource - Native Plugin
This is a
**built in**
datasource that allows you to connect to the Loki logging service.
public/app/plugins/datasource/lo
gging/components/Logging
CheatSheet.tsx
→
public/app/plugins/datasource/lo
ki/components/Loki
CheatSheet.tsx
View file @
721e1d75
...
@@ -15,7 +15,7 @@ const CHEAT_SHEET_ITEMS = [
...
@@ -15,7 +15,7 @@ const CHEAT_SHEET_ITEMS = [
export
default
(
props
:
any
)
=>
(
export
default
(
props
:
any
)
=>
(
<
div
>
<
div
>
<
h2
>
Lo
gging
Cheat Sheet
</
h2
>
<
h2
>
Lo
ki
Cheat Sheet
</
h2
>
{
CHEAT_SHEET_ITEMS
.
map
(
item
=>
(
{
CHEAT_SHEET_ITEMS
.
map
(
item
=>
(
<
div
className=
"cheat-sheet-item"
key=
{
item
.
expression
}
>
<
div
className=
"cheat-sheet-item"
key=
{
item
.
expression
}
>
<
div
className=
"cheat-sheet-item__title"
>
{
item
.
title
}
</
div
>
<
div
className=
"cheat-sheet-item__title"
>
{
item
.
title
}
</
div
>
...
...
public/app/plugins/datasource/lo
gging/components/Logging
QueryField.tsx
→
public/app/plugins/datasource/lo
ki/components/Loki
QueryField.tsx
View file @
721e1d75
...
@@ -49,7 +49,7 @@ interface CascaderOption {
...
@@ -49,7 +49,7 @@ interface CascaderOption {
disabled
?:
boolean
;
disabled
?:
boolean
;
}
}
interface
Lo
gging
QueryFieldProps
{
interface
Lo
ki
QueryFieldProps
{
datasource
:
any
;
datasource
:
any
;
error
?:
string
|
JSX
.
Element
;
error
?:
string
|
JSX
.
Element
;
hint
?:
any
;
hint
?:
any
;
...
@@ -60,16 +60,16 @@ interface LoggingQueryFieldProps {
...
@@ -60,16 +60,16 @@ interface LoggingQueryFieldProps {
onQueryChange
?:
(
value
:
DataQuery
,
override
?:
boolean
)
=>
void
;
onQueryChange
?:
(
value
:
DataQuery
,
override
?:
boolean
)
=>
void
;
}
}
interface
Lo
gging
QueryFieldState
{
interface
Lo
ki
QueryFieldState
{
logLabelOptions
:
any
[];
logLabelOptions
:
any
[];
syntaxLoaded
:
boolean
;
syntaxLoaded
:
boolean
;
}
}
class
Lo
ggingQueryField
extends
React
.
PureComponent
<
LoggingQueryFieldProps
,
Logging
QueryFieldState
>
{
class
Lo
kiQueryField
extends
React
.
PureComponent
<
LokiQueryFieldProps
,
Loki
QueryFieldState
>
{
plugins
:
any
[];
plugins
:
any
[];
languageProvider
:
any
;
languageProvider
:
any
;
constructor
(
props
:
Lo
gging
QueryFieldProps
,
context
)
{
constructor
(
props
:
Lo
ki
QueryFieldProps
,
context
)
{
super
(
props
,
context
);
super
(
props
,
context
);
if
(
props
.
datasource
.
languageProvider
)
{
if
(
props
.
datasource
.
languageProvider
)
{
...
@@ -208,8 +208,8 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
...
@@ -208,8 +208,8 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
onTypeahead=
{
this
.
onTypeahead
}
onTypeahead=
{
this
.
onTypeahead
}
onWillApplySuggestion=
{
willApplySuggestion
}
onWillApplySuggestion=
{
willApplySuggestion
}
onValueChanged=
{
this
.
onChangeQuery
}
onValueChanged=
{
this
.
onChangeQuery
}
placeholder=
"Enter a Lo
ggin
g query"
placeholder=
"Enter a Lo
ki Lo
g query"
portalOrigin=
"lo
gging
"
portalOrigin=
"lo
ki
"
syntaxLoaded=
{
syntaxLoaded
}
syntaxLoaded=
{
syntaxLoaded
}
/>
/>
{
error
?
<
div
className=
"prom-query-field-info text-error"
>
{
error
}
</
div
>
:
null
}
{
error
?
<
div
className=
"prom-query-field-info text-error"
>
{
error
}
</
div
>
:
null
}
...
@@ -229,4 +229,4 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
...
@@ -229,4 +229,4 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
}
}
}
}
export
default
Lo
gging
QueryField
;
export
default
Lo
ki
QueryField
;
public/app/plugins/datasource/lo
gging/components/Logging
StartPage.tsx
→
public/app/plugins/datasource/lo
ki/components/Loki
StartPage.tsx
View file @
721e1d75
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
Lo
ggingCheatSheet
from
'./Logging
CheatSheet'
;
import
Lo
kiCheatSheet
from
'./Loki
CheatSheet'
;
interface
Props
{
interface
Props
{
onClickExample
:
()
=>
void
;
onClickExample
:
()
=>
void
;
}
}
export
default
class
Lo
gging
StartPage
extends
PureComponent
<
Props
>
{
export
default
class
Lo
ki
StartPage
extends
PureComponent
<
Props
>
{
render
()
{
render
()
{
return
(
return
(
<
div
className=
"grafana-info-box grafana-info-box--max-lg"
>
<
div
className=
"grafana-info-box grafana-info-box--max-lg"
>
<
Lo
gging
CheatSheet
onClickExample=
{
this
.
props
.
onClickExample
}
/>
<
Lo
ki
CheatSheet
onClickExample=
{
this
.
props
.
onClickExample
}
/>
</
div
>
</
div
>
);
);
}
}
...
...
public/app/plugins/datasource/lo
gging
/datasource.ts
→
public/app/plugins/datasource/lo
ki
/datasource.ts
View file @
721e1d75
...
@@ -27,7 +27,7 @@ function serializeParams(data: any) {
...
@@ -27,7 +27,7 @@ function serializeParams(data: any) {
.
join
(
'&'
);
.
join
(
'&'
);
}
}
export
default
class
Lo
gging
Datasource
{
export
default
class
Lo
ki
Datasource
{
languageProvider
:
LanguageProvider
;
languageProvider
:
LanguageProvider
;
/** @ngInject */
/** @ngInject */
...
@@ -94,7 +94,7 @@ export default class LoggingDatasource {
...
@@ -94,7 +94,7 @@ export default class LoggingDatasource {
}
}
metadataRequest
(
url
)
{
metadataRequest
(
url
)
{
// HACK to get label values for {job=|}, will be replaced when implementing Lo
gging
QueryField
// HACK to get label values for {job=|}, will be replaced when implementing Lo
ki
QueryField
const
apiUrl
=
url
.
replace
(
'v1'
,
'prom'
);
const
apiUrl
=
url
.
replace
(
'v1'
,
'prom'
);
return
this
.
_request
(
apiUrl
,
{
silent
:
true
}).
then
(
res
=>
{
return
this
.
_request
(
apiUrl
,
{
silent
:
true
}).
then
(
res
=>
{
const
data
=
{
data
:
{
data
:
res
.
data
.
values
||
[]
}
};
const
data
=
{
data
:
{
data
:
res
.
data
.
values
||
[]
}
};
...
@@ -136,7 +136,7 @@ export default class LoggingDatasource {
...
@@ -136,7 +136,7 @@ export default class LoggingDatasource {
}
}
return
{
return
{
status
:
'error'
,
status
:
'error'
,
message
:
'Data source connected, but no labels received. Verify that
logging
is configured properly.'
,
message
:
'Data source connected, but no labels received. Verify that
Loki
is configured properly.'
,
};
};
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
...
public/app/plugins/datasource/lo
gging
/img/grafana_icon.svg
→
public/app/plugins/datasource/lo
ki
/img/grafana_icon.svg
View file @
721e1d75
File moved
public/app/plugins/datasource/loki/img/loki_icon.svg
0 → 100644
View file @
721e1d75
This diff is collapsed.
Click to expand it.
public/app/plugins/datasource/lo
gging
/language_provider.test.ts
→
public/app/plugins/datasource/lo
ki
/language_provider.test.ts
View file @
721e1d75
File moved
public/app/plugins/datasource/lo
gging
/language_provider.ts
→
public/app/plugins/datasource/lo
ki
/language_provider.ts
View file @
721e1d75
...
@@ -36,7 +36,7 @@ export function addHistoryMetadata(item: CompletionItem, history: HistoryItem[])
...
@@ -36,7 +36,7 @@ export function addHistoryMetadata(item: CompletionItem, history: HistoryItem[])
};
};
}
}
export
default
class
Lo
gging
LanguageProvider
extends
LanguageProvider
{
export
default
class
Lo
ki
LanguageProvider
extends
LanguageProvider
{
labelKeys
?:
{
[
index
:
string
]:
string
[]
};
// metric -> [labelKey,...]
labelKeys
?:
{
[
index
:
string
]:
string
[]
};
// metric -> [labelKey,...]
labelValues
?:
{
[
index
:
string
]:
{
[
index
:
string
]:
string
[]
}
};
// metric -> labelKey -> [labelValue,...]
labelValues
?:
{
[
index
:
string
]:
{
[
index
:
string
]:
string
[]
}
};
// metric -> labelKey -> [labelValue,...]
logLabelOptions
:
any
[];
logLabelOptions
:
any
[];
...
...
public/app/plugins/datasource/lo
gging
/module.ts
→
public/app/plugins/datasource/lo
ki
/module.ts
View file @
721e1d75
import
Datasource
from
'./datasource'
;
import
Datasource
from
'./datasource'
;
import
Lo
ggingStartPage
from
'./components/Logging
StartPage'
;
import
Lo
kiStartPage
from
'./components/Loki
StartPage'
;
import
Lo
ggingQueryField
from
'./components/Logging
QueryField'
;
import
Lo
kiQueryField
from
'./components/Loki
QueryField'
;
export
class
Lo
gging
ConfigCtrl
{
export
class
Lo
ki
ConfigCtrl
{
static
templateUrl
=
'partials/config.html'
;
static
templateUrl
=
'partials/config.html'
;
}
}
export
{
export
{
Datasource
,
Datasource
,
Lo
gging
ConfigCtrl
as
ConfigCtrl
,
Lo
ki
ConfigCtrl
as
ConfigCtrl
,
Lo
gging
QueryField
as
ExploreQueryField
,
Lo
ki
QueryField
as
ExploreQueryField
,
Lo
gging
StartPage
as
ExploreStartPage
,
Lo
ki
StartPage
as
ExploreStartPage
,
};
};
public/app/plugins/datasource/lo
gging
/partials/config.html
→
public/app/plugins/datasource/lo
ki
/partials/config.html
View file @
721e1d75
File moved
public/app/plugins/datasource/lo
gging
/plugin.json
→
public/app/plugins/datasource/lo
ki
/plugin.json
View file @
721e1d75
{
{
"type"
:
"datasource"
,
"type"
:
"datasource"
,
"name"
:
"
Grafana Logging
"
,
"name"
:
"
Loki
"
,
"id"
:
"lo
gging
"
,
"id"
:
"lo
ki
"
,
"metrics"
:
false
,
"metrics"
:
false
,
"alerting"
:
false
,
"alerting"
:
false
,
"annotations"
:
false
,
"annotations"
:
false
,
"logs"
:
true
,
"logs"
:
true
,
"explore"
:
true
,
"explore"
:
true
,
"info"
:
{
"info"
:
{
"description"
:
"
Grafana
Logging Data Source for Grafana"
,
"description"
:
"
Loki
Logging Data Source for Grafana"
,
"author"
:
{
"author"
:
{
"name"
:
"Grafana Project"
,
"name"
:
"Grafana Project"
,
"url"
:
"https://grafana.com"
"url"
:
"https://grafana.com"
},
},
"logos"
:
{
"logos"
:
{
"small"
:
"img/
grafana
_icon.svg"
,
"small"
:
"img/
loki
_icon.svg"
,
"large"
:
"img/
grafana
_icon.svg"
"large"
:
"img/
loki
_icon.svg"
},
},
"links"
:
[
"links"
:
[
{
{
"name"
:
"
Grafana Logging
"
,
"name"
:
"
Loki
"
,
"url"
:
"https://g
rafana.com/
"
"url"
:
"https://g
ithub.com/grafana/loki
"
}
}
],
],
"version"
:
"5.3.0"
"version"
:
"5.3.0"
...
...
public/app/plugins/datasource/lo
gging
/query_utils.test.ts
→
public/app/plugins/datasource/lo
ki
/query_utils.test.ts
View file @
721e1d75
File moved
public/app/plugins/datasource/lo
gging
/query_utils.ts
→
public/app/plugins/datasource/lo
ki
/query_utils.ts
View file @
721e1d75
File moved
public/app/plugins/datasource/lo
gging
/result_transformer.test.ts
→
public/app/plugins/datasource/lo
ki
/result_transformer.test.ts
View file @
721e1d75
File moved
public/app/plugins/datasource/lo
gging
/result_transformer.ts
→
public/app/plugins/datasource/lo
ki
/result_transformer.ts
View file @
721e1d75
File moved
public/app/plugins/datasource/lo
gging
/syntax.ts
→
public/app/plugins/datasource/lo
ki
/syntax.ts
View file @
721e1d75
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment