Commit 721e1d75 by Daniel Lee

renames Grafana Logging ds to Loki

parent 3c330c8e
...@@ -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 loggingPlugin from 'app/plugins/datasource/logging/module'; import * as lokiPlugin 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/logging/module': loggingPlugin, 'app/plugins/datasource/loki/module': lokiPlugin,
'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,
......
# 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
# Loki Datasource - Native Plugin
This is a **built in** datasource that allows you to connect to the Loki logging service.
...@@ -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>Logging Cheat Sheet</h2> <h2>Loki 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>
......
...@@ -49,7 +49,7 @@ interface CascaderOption { ...@@ -49,7 +49,7 @@ interface CascaderOption {
disabled?: boolean; disabled?: boolean;
} }
interface LoggingQueryFieldProps { interface LokiQueryFieldProps {
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 LoggingQueryFieldState { interface LokiQueryFieldState {
logLabelOptions: any[]; logLabelOptions: any[];
syntaxLoaded: boolean; syntaxLoaded: boolean;
} }
class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, LoggingQueryFieldState> { class LokiQueryField extends React.PureComponent<LokiQueryFieldProps, LokiQueryFieldState> {
plugins: any[]; plugins: any[];
languageProvider: any; languageProvider: any;
constructor(props: LoggingQueryFieldProps, context) { constructor(props: LokiQueryFieldProps, 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 Logging query" placeholder="Enter a Loki Log query"
portalOrigin="logging" portalOrigin="loki"
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 LoggingQueryField; export default LokiQueryField;
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import LoggingCheatSheet from './LoggingCheatSheet'; import LokiCheatSheet from './LokiCheatSheet';
interface Props { interface Props {
onClickExample: () => void; onClickExample: () => void;
} }
export default class LoggingStartPage extends PureComponent<Props> { export default class LokiStartPage 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">
<LoggingCheatSheet onClickExample={this.props.onClickExample} /> <LokiCheatSheet onClickExample={this.props.onClickExample} />
</div> </div>
); );
} }
......
...@@ -27,7 +27,7 @@ function serializeParams(data: any) { ...@@ -27,7 +27,7 @@ function serializeParams(data: any) {
.join('&'); .join('&');
} }
export default class LoggingDatasource { export default class LokiDatasource {
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 LoggingQueryField // HACK to get label values for {job=|}, will be replaced when implementing LokiQueryField
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 => {
......
...@@ -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 LoggingLanguageProvider extends LanguageProvider { export default class LokiLanguageProvider 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[];
......
import Datasource from './datasource'; import Datasource from './datasource';
import LoggingStartPage from './components/LoggingStartPage'; import LokiStartPage from './components/LokiStartPage';
import LoggingQueryField from './components/LoggingQueryField'; import LokiQueryField from './components/LokiQueryField';
export class LoggingConfigCtrl { export class LokiConfigCtrl {
static templateUrl = 'partials/config.html'; static templateUrl = 'partials/config.html';
} }
export { export {
Datasource, Datasource,
LoggingConfigCtrl as ConfigCtrl, LokiConfigCtrl as ConfigCtrl,
LoggingQueryField as ExploreQueryField, LokiQueryField as ExploreQueryField,
LoggingStartPage as ExploreStartPage, LokiStartPage as ExploreStartPage,
}; };
{ {
"type": "datasource", "type": "datasource",
"name": "Grafana Logging", "name": "Loki",
"id": "logging", "id": "loki",
"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://grafana.com/" "url": "https://github.com/grafana/loki"
} }
], ],
"version": "5.3.0" "version": "5.3.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment