尊重作者的劳动,转载请注明作者及原文地址 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. swift - 导航设置总结加深记忆

    一.创建导航     let VC=ViewController()    let navigationC = UINavigationController(rootViewController: V ...

  2. Java 208 道面试题:Java 基础模块答案

    目前市面上的面试题存在两大问题:第一,题目太旧好久没有更新了,还都停留在 2010 年之前的状态:第二,近几年 JDK 更新和发布都很快,Java 的用法也变了不少,加上 Java 技术栈也加入了很多 ...

  3. XMind使用教程

    使用XMind,可以轻松创建.管理及控制思维导图.1. 启动XMind,选择一个空白模板或模板创建:2. 单击中心主题,输入文字即可对中心主题重命名:3. 使用键盘Enter键创建主要/同级主题,使用 ...

  4. python模块:pickle

    """Create portable serialized representations of Python objects. See module copyreg f ...

  5. idea设置字体大小

    第一次玩儿idea,也是个新手小白,甚是惭愧,也是一步步慢慢摸索,下面我们按照步骤一步步操作 就可以了. 1.首先,先设置代码的字体大小: 2.设置周围菜单栏的字体大小: 3.设置控制台的字体大小:

  6. git服务器使用

    服务器版本:CentOS6.3 root用户密码:123456 服务器地址:192.168.1.125 搭建Git服务器参考:搭建Git服务器 使用git服务器首先要克隆仓库,即添加一个远程仓库,参考 ...

  7. DS8800后端的光纤通道交换式互连方式

    DS8800 使用SAS 硬盘.使用了FC 到SAS 转换,光纤通道交换技术被用于DS8800 后端. FC 技术是普遍用于在一个光纤通道仲裁环路(Fibre Channel Arbitrated L ...

  8. Java Applet在IE中浏览

    1. IE --> 工具 --> Internet选项 --> 取消“将Java1.6.0.4加入Internet”选择项. 2. 开始 --> 控制面板 --> Jav ...

  9. Java理论学时第三节。课后作业。

    如果一个类中既有初始化块,又有构造方法,同时还设定了字段的初始值,谁说了算? 运行结果. 根据我的总结,它们三个的优先级是:构造方法 > 字段初始值 > 初始化块. 当多个类之间有继承关系 ...

  10. _编程语言_C++_宏定义#define 和 常量const 的区别

    C++中有两种定义常量的方式:#define预处理和const关键字 #define 预处理指令 #include <iostream> using namespace std; #def ...