2018-10-30 10:14:01 -05:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
const CHEAT_SHEET_ITEMS = [
|
|
|
|
{
|
|
|
|
title: 'Logs From a Job',
|
|
|
|
expression: '{job="default/prometheus"}',
|
|
|
|
label: 'Returns all log lines emitted by instances of this job.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Search For Text',
|
|
|
|
expression: '{app="cassandra"} Maximum memory usage',
|
|
|
|
label: 'Returns all log lines for the selector and highlights the given text in the results.',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export default (props: any) => (
|
|
|
|
<div>
|
2018-12-05 16:13:57 -06:00
|
|
|
<h2>Loki Cheat Sheet</h2>
|
2018-10-30 10:14:01 -05:00
|
|
|
{CHEAT_SHEET_ITEMS.map(item => (
|
|
|
|
<div className="cheat-sheet-item" key={item.expression}>
|
|
|
|
<div className="cheat-sheet-item__title">{item.title}</div>
|
2018-11-21 07:45:57 -06:00
|
|
|
<div
|
|
|
|
className="cheat-sheet-item__expression"
|
|
|
|
onClick={e => props.onClickExample({ refId: '1', expr: item.expression })}
|
|
|
|
>
|
2018-10-30 10:14:01 -05:00
|
|
|
<code>{item.expression}</code>
|
|
|
|
</div>
|
|
|
|
<div className="cheat-sheet-item__label">{item.label}</div>
|
|
|
|
</div>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
);
|