- name: swap
type: group
fields:
- name: total
type: long
format: bytes
unit: byte
metric_type: gauge
description: |
Total swap memory.
- name: used.bytes
type: long
format: bytes
unit: byte
metric_type: gauge
description: |
Used swap memory.
- name: free
type: long
format: bytes
unit: byte
metric_type: gauge
description: |
Available swap memory.
- name: out.pages
type: long
metric_type: counter
description: count of pages swapped out
- name: in.pages
type: long
metric_type: gauge
description: count of pages swapped in
- name: readahead.pages
type: long
metric_type: counter
description: swap readahead pages
- name: readahead.cached
type: long
description: swap readahead cache hits
- name: used.pct
type: scaled_float
format: percent
unit: percent
metric_type: gauge
description: |
The percentage of used swap memory.
"swap": {
"properties": {
"total": {
"meta": {
"unit": "byte",
"metric_type": "gauge"
},
"type": "long"
},
"readahead": {
"properties": {
"pages": {
"meta": {
"metric_type": "counter"
},
"type": "long"
},
"cached": {
"type": "long"
}
}
},
"in": {
"properties": {
"pages": {
"meta": {
"metric_type": "gauge"
},
"type": "long"
}
}
},
"used": {
"properties": {
"pct": {
"time_series_metric": "gauge",
"meta": {
"unit": "percent",
"metric_type": "gauge"
},
"scaling_factor": 1000,
"type": "scaled_float"
},
"bytes": {
"meta": {
"unit": "byte",
"metric_type": "gauge"
},
"type": "long"
}
}
},
"free": {
"meta": {
"unit": "byte",
"metric_type": "gauge"
},
"type": "long"
},
"out": {
"properties": {
"pages": {
"meta": {
"metric_type": "counter"
},
"type": "long"
}
}
}
}
},
I'm currently running
8.7.0-SNAPSHOTand played around with the TSDB metrics fields. I modified the integration package and added themetric_type: gaugeand counter to various fields but the outcome is not persistent. Looking closer, it looks liketime_series_metricis only applied to fields that are scaled_float but it should apply to a much broader range of fields: https://www.elastic.co/guide/en/elasticsearch/reference/current/tsds.html#time-series-metric Looking at the code, it seems the time_series_metric part is only implemented for scaled_float. This was implemented in #126322Few questions:
Examples
The fields .yml looks as following:
The resulting json template: