How to use grafana-dash-gen - 10 common examples

To help you get started, we’ve selected a few grafana-dash-gen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber-node / ringpop-common / tools / grafana-dash / gen-dashboard.js View on Github external
new grafana.Target(getTarget("membership.membership-update-faulty"))
                .sumSeries().alias('faulty').color('red')
            /* eslint-enable max-len */
        ]
    }));

    row.addPanel(new grafana.Panels.Graph({
        title: 'Checksum Compute Times',
        span: 4,
        targets: [
            /* eslint-disable max-len */
            new grafana.Target(getTarget("membership.compute-checksum-p95"))
                .averageSeries().alias('p95'),
            new grafana.Target(getTarget("membership.compute-checksum-p99"))
                .averageSeries().alias('p99'),
            new grafana.Target(getTarget("membership.compute-checksum-upper"))
                .averageSeries().alias('upper')
            /* eslint-enable max-len */
        ]
    }));

    return row;
}
github uber-node / ringpop-common / tools / grafana-dash / gen-dashboard.js View on Github external
function createDisseminationRow() {
    var row = new grafana.Row();
    row.state.title = 'DISSEMINATION';
    row.state.showTitle = true;

    row.addPanel(new grafana.Panels.SingleStat({
        title: 'Max Piggyback',
        span: 4,
        targets: [
            /* eslint-disable max-len */
            new grafana.Target(getTarget('dissemination.max-piggyback'))
                .maxSeries().alias('total')
            /* eslint-enable max-len */
        ]
    }));

    return row;
}
github uber-node / ringpop-common / tools / grafana-dash / gen-dashboard.js View on Github external
new grafana.Target(getTarget("membership.membership-update-alive"))
                .sumSeries().alias('alive').color('green'),
            new grafana.Target(getTarget("membership.membership-update-suspect"))
                .sumSeries().alias('suspect').color('yellow'),
            new grafana.Target(getTarget("membership.membership-update-faulty"))
                .sumSeries().alias('faulty').color('red')
            /* eslint-enable max-len */
        ]
    }));

    row.addPanel(new grafana.Panels.Graph({
        title: 'Checksum Compute Times',
        span: 4,
        targets: [
            /* eslint-disable max-len */
            new grafana.Target(getTarget("membership.compute-checksum-p95"))
                .averageSeries().alias('p95'),
            new grafana.Target(getTarget("membership.compute-checksum-p99"))
                .averageSeries().alias('p99'),
            new grafana.Target(getTarget("membership.compute-checksum-upper"))
                .averageSeries().alias('upper')
            /* eslint-enable max-len */
        ]
    }));

    return row;
}
github uber-node / ringpop-common / tools / grafana-dash / gen-dashboard.js View on Github external
function createBootstrapRow() {
    var row = new grafana.Row();
    row.state.title = 'BOOTSTRAP';
    row.state.showTitle = true;

    row.addPanel(new grafana.Panels.Graph({
        title: 'Join Times',
        span: 12,
        targets: [
            /* eslint-disable max-len */
            new grafana.Target(getTarget('bootstrap.join-p95'))
                .percentileOfSeries(50).alias('p95')
            /* eslint-enable max-len */
        ],
        legend: {
            show: false
        }
    }));
github uber-node / ringpop-common / tools / grafana-dash / gen-dashboard.js View on Github external
function createMembershipRow() {
    var row = new grafana.Row();
    row.state.title = 'MEMBERSHIP';
    row.state.showTitle = true;

    row.addPanel(new grafana.Panels.Graph({
        title: 'Full-syncs',
        span: 4,
        targets: [
            /* eslint-disable max-len */
            new grafana.Target(getTarget("membership.full-sync"))
                .sumSeries().alias('total')
            /* eslint-enable max-len */
        ]
    }));

    row.addPanel(lineGraph({
        title: 'Updates',
github uber-node / ringpop-common / tools / grafana-dash / gen-dashboard.js View on Github external
function createDisseminationRow() {
    var row = new grafana.Row();
    row.state.title = 'DISSEMINATION';
    row.state.showTitle = true;

    row.addPanel(new grafana.Panels.SingleStat({
        title: 'Max Piggyback',
        span: 4,
        targets: [
            /* eslint-disable max-len */
            new grafana.Target(getTarget('dissemination.max-piggyback'))
                .maxSeries().alias('total')
            /* eslint-enable max-len */
        ]
    }));

    return row;
}
github uber-node / ringpop-common / tools / grafana-dash / gen-dashboard.js View on Github external
// We don't need to go deeper than 100, prevents circular substitution
    var i = 0;
    while(i < 100 && !doSubsitutePossible(vars)) {
        i++;
    }
}

var templateVariables = config.get('gen-dashboard.variable');
substituteVariables(templateVariables);

function getTarget(path) {
    return strformat(config.get('gen-dashboard.template.' + path),
                     templateVariables);
}

var dashboard = new grafana.Dashboard({
    title: config.get('gen-dashboard.dashboard-title')
});

function lineGraph(opts) {
    var graph = new grafana.Panels.Graph(opts);
    graph.state.fill = 0;

    return graph;
}

function createSystemRow() {
    var row = new grafana.Row();
    row.state.title = 'SYSTEM';
    row.state.showTitle = true;

    row.addPanel(lineGraph({
github magma / magma / nms / app / packages / magmalte / grafana / dashboards / Dashboards.js View on Github external
export function createDashboard(dbdata: GrafanaDBData) {
  const rows = dbdata.rows.map(conf => {
    const row = new Grafana.Row({title: conf.title});
    conf.panels.forEach(panel => row.addPanel(newPanel(panel)));
    return row;
  });
  const db = new Grafana.Dashboard({
    schemaVersion: 6,
    title: dbdata.title,
    templating: dbdata.templates,
    description: dbdata.description,
    rows,
  });
  db.state.editable = false;

  // Necessary to make custom templates display "all" option
  for (const template of db.state?.templating?.list) {
    if (template.type === 'custom' && template.includeAll) {
      template.options.unshift({selected: true, text: 'All', value: '$__all'});
    }
    template.current = template.options[0];
  }
  return db;
github magma / magma / nms / app / fbcnms-packages / fbcnms-platform-server / grafana / dashboards / Dashboards.js View on Github external
export function newPanel(params: PanelParams) {
  const pan = new Grafana.Panels.Graph({
    title: params.title,
    span: 6,
    datasource: 'default',
  });
  // Have to add this after to avoid grafana-dash-gen from forcing the target
  // into a Graphite format
  pan.state.targets = params.targets;
  return pan;
}
github uber-node / ringpop-common / tools / grafana-dash / gen-dashboard.js View on Github external
function createBootstrapRow() {
    var row = new grafana.Row();
    row.state.title = 'BOOTSTRAP';
    row.state.showTitle = true;

    row.addPanel(new grafana.Panels.Graph({
        title: 'Join Times',
        span: 12,
        targets: [
            /* eslint-disable max-len */
            new grafana.Target(getTarget('bootstrap.join-p95'))
                .percentileOfSeries(50).alias('p95')
            /* eslint-enable max-len */
        ],
        legend: {
            show: false
        }
    }));

    return row;
}

grafana-dash-gen

A grafana dashboard generator

MIT
Latest version published 1 year ago

Package Health Score

58 / 100
Full package analysis