简体   繁体   English

为 grafana 简单的 json 插件添加端点?

[英]Adding endpoint for grafana simple json plugin?

I'm using the grafana-simple-json-datasource with Python it's working fine, however I want to add a brand new endpoint, but no matter I try, nothing is working.我正在将 grafana-simple-json-datasource 与 Python 一起使用,它运行良好,但是我想添加一个全新的端点,但是无论我怎么尝试,都没有任何效果。

Here are natives endpoints这是本地人端点

/ should return 200 ok. Used for "Test connection" on the datasource config page.
/search used by the find metric options on the query tab in panels.
/query should return metrics based on input.
/annotations should return annotations.
/tag-keys should return tag keys for ad hoc filters.
/tag-values should return tag values for ad hoc filters.

I want to add for example /secondaryQuery which comes after selected /query.我想添加例如 /secondaryQuery 在选择 /query 之后出现。

I tried to duplicate and modify the existing function "metricFindQuery(query)" but it seems that it's not that我试图复制和修改现有函数“metricFindQuery(query)”,但似乎并非如此

The problem was because I was modifying /src directory without building it with npm (and /dist is used instead of /src).问题是因为我正在修改 /src 目录而不使用 npm 构建它(并且使用 /dist 而不是 /src)。 So all my changes were not effective.所以我所有的改变都没有效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM