summaryrefslogtreecommitdiffstats
path: root/web/api
diff options
context:
space:
mode:
authorChris Akritidis <43294513+cakrit@users.noreply.github.com>2019-03-04 18:36:08 +0100
committerGitHub <noreply@github.com>2019-03-04 18:36:08 +0100
commit56ac9f514566d0cbfa6125a28c96b759d4de1ff9 (patch)
tree7f3edf42398b9dfb7e18aad3f39aec90d93ea8bd /web/api
parent0a2145ad7aa7890170f8b445db5c07143e99578b (diff)
Support legacy Prometheus metric names for source average (#5531)
* Support older prometheus metric unit naming and allow removal of units from metrics * Update swagger * Added bats tests, improved efficiency of checking units
Diffstat (limited to 'web/api')
-rw-r--r--web/api/exporters/allmetrics.c3
-rw-r--r--web/api/netdata-swagger.json24
-rw-r--r--web/api/netdata-swagger.yaml14
3 files changed, 40 insertions, 1 deletions
diff --git a/web/api/exporters/allmetrics.c b/web/api/exporters/allmetrics.c
index 91bb0f921e..88ff78e7e4 100644
--- a/web/api/exporters/allmetrics.c
+++ b/web/api/exporters/allmetrics.c
@@ -11,7 +11,8 @@ struct prometheus_output_options {
{ "names", PROMETHEUS_OUTPUT_NAMES },
{ "timestamps", PROMETHEUS_OUTPUT_TIMESTAMPS },
{ "variables", PROMETHEUS_OUTPUT_VARIABLES },
-
+ { "oldunits", PROMETHEUS_OUTPUT_OLDUNITS },
+ { "hideunits", PROMETHEUS_OUTPUT_HIDEUNITS },
// terminator
{ NULL, PROMETHEUS_OUTPUT_NONE },
};
diff --git a/web/api/netdata-swagger.json b/web/api/netdata-swagger.json
index ac84b754d6..99ed95209f 100644
--- a/web/api/netdata-swagger.json
+++ b/web/api/netdata-swagger.json
@@ -507,6 +507,30 @@
"default": "yes"
},
{
+ "name": "oldunits",
+ "in": "query",
+ "description": "When enabled, netdata will show metric names for the default source=average as they appeared before 1.12, by using the legacy unit naming conventions",
+ "required": false,
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ],
+ "default": "yes"
+ },
+ {
+ "name": "hideunits",
+ "in": "query",
+ "description": "When enabled, netdata will not include the units in the metric names, for the default source=average.",
+ "required": false,
+ "type": "string",
+ "enum": [
+ "yes",
+ "no"
+ ],
+ "default": "yes"
+ },
+ {
"name": "server",
"in": "query",
"description": "Set a distinct name of the client querying prometheus metrics. Netdata will use the client IP if this is not set.",
diff --git a/web/api/netdata-swagger.yaml b/web/api/netdata-swagger.yaml
index bf62fb95af..e5689e3927 100644
--- a/web/api/netdata-swagger.yaml
+++ b/web/api/netdata-swagger.yaml
@@ -333,6 +333,20 @@ paths:
type: string
enum: [ 'yes', 'no' ]
default: 'yes'
+ - name: oldunits
+ in: query
+ description: 'When enabled, netdata will show metric names for the default source=average as they appeared before 1.12, by using the legacy unit naming conventions'
+ required: false
+ type: string
+ enum: [ 'yes', 'no' ]
+ default: 'yes'
+ - name: hideunits
+ in: query
+ description: 'When enabled, netdata will not include the units in the metric names, for the default source=average.'
+ required: false
+ type: string
+ enum: [ 'yes', 'no' ]
+ default: 'yes'
- name: server
in: query
description: 'Set a distinct name of the client querying prometheus metrics. Netdata will use the client IP if this is not set.'