Skip to content

Instantly share code, notes, and snippets.

View ivanahuckova's full-sized avatar

Ivana Huckova ivanahuckova

View GitHub Profile
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",

Prometheus backend migrations manual tests

These tests are related to this Epic: grafana/grafana#37784

Prerequisites

  • Create new prometheus prometheus-demo data sources that points to http://demo.robustperception.io:9090, choose server(default) access
  • Each tests starts with plain Explore or Dashboard state
  • Select prometheus-demo data source

Explore

const express = require('express');
const cors = require('cors');
const faker = require('faker');
const app = express();
const data = [];
for (let i = 0; i < 200000; i++) {
let firstName = faker.name.firstName();
import { TestScheduler } from 'rxjs/testing';
import { map, concatWith, take, delay } from 'rxjs/operators';
import { from, of, catchError, interval } from 'rxjs';
describe('Marble testing', () => {
let testScheduler;
beforeEach(() => {
testScheduler = new TestScheduler((actual, expected) => {
expect(actual).toEqual(expected);

Elasticsearch

Elasticsearch API that we use in Grafana

/_msearch POST

Multi search API. Executes several searches with a single API request.

Query parameters that we add:

import { of } from 'rxjs';
import { map, toArray, mergeMap, delay, catchError } from 'rxjs/operators';
describe('subscribe & assert testing in RxJS', () => {
it('should compare each emitted value', () => {
const source$ = of(1,2,3)
const final$ = source$.pipe(map(value => value * 10))
// array with expected values
const expected = [10, 20, 30]
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@ivanahuckova
ivanahuckova / logsAPIs.md
Last active August 2, 2023 13:58
logs APIs

aliases:

  • ../../../plugins/add-support-for-log-queries/ description: Add features to log queries in Explore. keywords:
  • grafana
  • plugins
  • plugin
  • queries
  • explore queries