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
import * as opentsdbPlugin from 'app/plugins/datasource/opentsdb/module';
import * as grafanaPlugin from 'app/plugins/datasource/grafana/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 mysqlPlugin from 'app/plugins/datasource/mysql/module';
import * as postgresPlugin from 'app/plugins/datasource/postgres/module';
......@@ -33,7 +33,7 @@ const builtInPlugins = {
'app/plugins/datasource/opentsdb/module': opentsdbPlugin,
'app/plugins/datasource/grafana/module': grafanaPlugin,
'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/mysql/module': mysqlPlugin,
'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 = [
export default (props: any) => (
<div>
<h2>Logging Cheat Sheet</h2>
<h2>Loki Cheat Sheet</h2>
{CHEAT_SHEET_ITEMS.map(item => (
<div className="cheat-sheet-item" key={item.expression}>
<div className="cheat-sheet-item__title">{item.title}</div>
......
......@@ -49,7 +49,7 @@ interface CascaderOption {
disabled?: boolean;
}
interface LoggingQueryFieldProps {
interface LokiQueryFieldProps {
datasource: any;
error?: string | JSX.Element;
hint?: any;
......@@ -60,16 +60,16 @@ interface LoggingQueryFieldProps {
onQueryChange?: (value: DataQuery, override?: boolean) => void;
}
interface LoggingQueryFieldState {
interface LokiQueryFieldState {
logLabelOptions: any[];
syntaxLoaded: boolean;
}
class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, LoggingQueryFieldState> {
class LokiQueryField extends React.PureComponent<LokiQueryFieldProps, LokiQueryFieldState> {
plugins: any[];
languageProvider: any;
constructor(props: LoggingQueryFieldProps, context) {
constructor(props: LokiQueryFieldProps, context) {
super(props, context);
if (props.datasource.languageProvider) {
......@@ -208,8 +208,8 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
onTypeahead={this.onTypeahead}
onWillApplySuggestion={willApplySuggestion}
onValueChanged={this.onChangeQuery}
placeholder="Enter a Logging query"
portalOrigin="logging"
placeholder="Enter a Loki Log query"
portalOrigin="loki"
syntaxLoaded={syntaxLoaded}
/>
{error ? <div className="prom-query-field-info text-error">{error}</div> : null}
......@@ -229,4 +229,4 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
}
}
export default LoggingQueryField;
export default LokiQueryField;
import React, { PureComponent } from 'react';
import LoggingCheatSheet from './LoggingCheatSheet';
import LokiCheatSheet from './LokiCheatSheet';
interface Props {
onClickExample: () => void;
}
export default class LoggingStartPage extends PureComponent<Props> {
export default class LokiStartPage extends PureComponent<Props> {
render() {
return (
<div className="grafana-info-box grafana-info-box--max-lg">
<LoggingCheatSheet onClickExample={this.props.onClickExample} />
<LokiCheatSheet onClickExample={this.props.onClickExample} />
</div>
);
}
......
......@@ -27,7 +27,7 @@ function serializeParams(data: any) {
.join('&');
}
export default class LoggingDatasource {
export default class LokiDatasource {
languageProvider: LanguageProvider;
/** @ngInject */
......@@ -94,7 +94,7 @@ export default class LoggingDatasource {
}
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');
return this._request(apiUrl, { silent: true }).then(res => {
const data = { data: { data: res.data.values || [] } };
......@@ -136,7 +136,7 @@ export default class LoggingDatasource {
}
return {
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 => {
......
......@@ -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,...]
labelValues?: { [index: string]: { [index: string]: string[] } }; // metric -> labelKey -> [labelValue,...]
logLabelOptions: any[];
......
import Datasource from './datasource';
import LoggingStartPage from './components/LoggingStartPage';
import LoggingQueryField from './components/LoggingQueryField';
import LokiStartPage from './components/LokiStartPage';
import LokiQueryField from './components/LokiQueryField';
export class LoggingConfigCtrl {
export class LokiConfigCtrl {
static templateUrl = 'partials/config.html';
}
export {
Datasource,
LoggingConfigCtrl as ConfigCtrl,
LoggingQueryField as ExploreQueryField,
LoggingStartPage as ExploreStartPage,
LokiConfigCtrl as ConfigCtrl,
LokiQueryField as ExploreQueryField,
LokiStartPage as ExploreStartPage,
};
{
"type": "datasource",
"name": "Grafana Logging",
"id": "logging",
"name": "Loki",
"id": "loki",
"metrics": false,
"alerting": false,
"annotations": false,
"logs": true,
"explore": true,
"info": {
"description": "Grafana Logging Data Source for Grafana",
"description": "Loki Logging Data Source for Grafana",
"author": {
"name": "Grafana Project",
"url": "https://grafana.com"
},
"logos": {
"small": "img/grafana_icon.svg",
"large": "img/grafana_icon.svg"
"small": "img/loki_icon.svg",
"large": "img/loki_icon.svg"
},
"links": [
{
"name": "Grafana Logging",
"url": "https://grafana.com/"
"name": "Loki",
"url": "https://github.com/grafana/loki"
}
],
"version": "5.3.0"
}
}
\ No newline at end of file
}
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