LoggingCheatSheet.tsx 969 B

1234567891011121314151617181920212223242526272829303132
  1. import React from 'react';
  2. const CHEAT_SHEET_ITEMS = [
  3. {
  4. title: 'Logs From a Job',
  5. expression: '{job="default/prometheus"}',
  6. label: 'Returns all log lines emitted by instances of this job.',
  7. },
  8. {
  9. title: 'Search For Text',
  10. expression: '{app="cassandra"} Maximum memory usage',
  11. label: 'Returns all log lines for the selector and highlights the given text in the results.',
  12. },
  13. ];
  14. export default (props: any) => (
  15. <div>
  16. <h1>Logging Cheat Sheet</h1>
  17. {CHEAT_SHEET_ITEMS.map(item => (
  18. <div className="cheat-sheet-item" key={item.expression}>
  19. <div className="cheat-sheet-item__title">{item.title}</div>
  20. <div
  21. className="cheat-sheet-item__expression"
  22. onClick={e => props.onClickExample({ refId: '1', expr: item.expression })}
  23. >
  24. <code>{item.expression}</code>
  25. </div>
  26. <div className="cheat-sheet-item__label">{item.label}</div>
  27. </div>
  28. ))}
  29. </div>
  30. );