尊重作者的劳动,转载请注明作者及原文地址 http://www.cnblogs.com/txwsqk/p/6522854.html

参考 https://graphite.readthedocs.io/en/latest/functions.html#function-plugins

/opt/graphite/webapp/graphite/settings.py

# Function plugins
FUNCTION_PLUGINS = ['linkedme.aliasByMap',]
/opt/graphite/webapp/graphite/functions/custom# ls
__init__.py __init__.pyc linkedme.py linkedme.pyc

我添加了一个自定义函数  cat linkedme.py

#coding:utf-8
from graphite.functions.params import Param, ParamTypes def aliasByMap(requestContext, seriesList):
kv = {
'':'你想展示的内容',
}
for series in seriesList:
series.name = kv[series.name]
return seriesList aliasByMap.group = 'Alias'
aliasByMap.params = [
Param('seriesList', ParamTypes.seriesList, required=True),
] SeriesFunctions = {
'aliasByMap': aliasByMap,
}

这样 grafana 中就可以使用了

graphite custom functions的更多相关文章

  1. [翻译] Using Custom Functions in a Report 在报表中使用自己义函数

    Using Custom Functions in a Report  在报表中使用自己义函数   FastReport has a large number of built-in standard ...

  2. [SCSS] Write Custom Functions with the SCSS @function Directive

    Writing SCSS @functions is similar to writing functions in other programming languages; they can acc ...

  3. Underscore 整体架构浅析

    前言 终于,楼主的「Underscore 源码解读系列」underscore-analysis 即将进入尾声,关注下 timeline 会发现楼主最近加快了解读速度.十一月,多事之秋,最近好多事情搞的 ...

  4. 如何设置Vimrc

    .title { text-align: center } .todo { font-family: monospace; color: red } .done { color: green } .t ...

  5. HTML5资料

    1 Canvas教程 <canvas>是一个新的用于通过脚本(通常是JavaScript)绘图的HTML元素.例如,他可以用于绘图.制作图片的组合或者简单的动画(当然并不那么简单).It ...

  6. window下安装jupyter

    1.Install [Anaconda](https://docs.continuum.io/anaconda/install#anaconda-install) 实际上安装了anaconda就已经安 ...

  7. vim operation

    note:  转自 www.quora.com ,很好的网站. 具体链接如下: https://www.quora.com/What-are-some-impressive-demos-of-Vim- ...

  8. taglib 自定义标签

    自定义<%@ taglib prefix="cf" uri="http://training.bmcc.com.cn/tld/functions"%> ...

  9. WordPress 主题开发 - (六) 创建主题函数 待翻译

    We’ve got a file structure in place, now let’s start adding things to them! First, we’re going to ad ...

随机推荐

  1. 494. Target Sum - Unsolved

    https://leetcode.com/problems/target-sum/#/description You are given a list of non-negative integers ...

  2. shell脚本清空redis库缓存

    前提: 现在做的一个业务系统,用了redis做缓存. 系统做了缓存,通常在系统正常使用的过程中,可以节省很多系统资源,特别是数据库资源. 但是,在开发.测试或者系统遇到问题的时候,也有很麻烦的事情. ...

  3. 2018.11.17 codechef PRIMEDST(点分治+fft)

    传送门 fftfftfft一眼题(其实最先想到的是nttnttntt,wawawa了几次之后发现模数不够大果断弃疗写fftfftfft) 我们点分治统计答案的个数. 考虑现在已经统计出了到当前点的所有 ...

  4. springboot深入学习(五)-----spring data、事务

    spring data项目是spring解决数据访问问题的一系列解决方案,包含了大量关系型数据库以及非关系型数据库的访问解决方案. 一.spring data jpa 1.简介 jpa是一套规范,不提 ...

  5. SQL之GROUP BY 语句

    合计函数 (比如 SUM) 常常需要添加 GROUP BY 语句. GROUP BY 语句 GROUP BY 语句用于结合合计函数,根据一个或多个列对结果集进行分组. SQL GROUP BY 语法 ...

  6. 第20章:MongoDB-聚合操作--聚合管道--$unwind

    ①$unwind 在查询数据的时候经常会返回数组信息,但是数组并不方便信息的浏览,所以提供有“$unwind”可以将数组数据变为独立的字符串内容. 将文档中数组类型的字段拆分成多条,每条文档包含数组中 ...

  7. HDU 1517 A Multiplication Game (SG函数找规律)

    题意:两个玩家玩一个游戏,从 p = 1,开始,然后依次轮流选择一个2 - 9的数乘以 p,问你谁先凑够 p >= n. 析:找规律,我先打了一下SG函数的表,然后就找到规律了 我找到的是: 1 ...

  8. 20180705 fragment

    https://www.cnblogs.com/chaowang/p/6180825.html https://blog.csdn.net/xxkalychen/article/details/537 ...

  9. (DP 雷格码)Gray code -- hdu -- 5375

    http://acm.hdu.edu.cn/showproblem.php?pid=5375 Gray code Time Limit: 2000/1000 MS (Java/Others)    M ...

  10. tlink平台数据转发 c# 控制台程序

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.N ...