-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metricbeat] Migrate Kubernetes state_node Metricset to use ReporterV…
…2 interface (#10962) This is the first Kubernetes modules which uses the new testing interface too
- Loading branch information
Showing
8 changed files
with
688 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 72 additions & 50 deletions
122
metricbeat/module/kubernetes/state_node/_meta/test/kube-state-metrics.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,88 @@ | ||
[ | ||
{ | ||
"_namespace": "node", | ||
"cpu": { | ||
"allocatable": { | ||
"cores": 3 | ||
"RootFields": null, | ||
"ModuleFields": null, | ||
"MetricSetFields": { | ||
"cpu": { | ||
"allocatable": { | ||
"cores": 3 | ||
}, | ||
"capacity": { | ||
"cores": 4 | ||
} | ||
}, | ||
"capacity": { | ||
"cores": 4 | ||
} | ||
}, | ||
"memory": { | ||
"allocatable": { | ||
"bytes": 3097786880 | ||
"memory": { | ||
"allocatable": { | ||
"bytes": 3097786880 | ||
}, | ||
"capacity": { | ||
"bytes": 4097786880 | ||
} | ||
}, | ||
"capacity": { | ||
"bytes": 4097786880 | ||
} | ||
}, | ||
"name": "minikube-test", | ||
"pod": { | ||
"allocatable": { | ||
"total": 210 | ||
"name": "minikube-test", | ||
"pod": { | ||
"allocatable": { | ||
"total": 210 | ||
}, | ||
"capacity": { | ||
"total": 310 | ||
} | ||
}, | ||
"capacity": { | ||
"total": 310 | ||
"status": { | ||
"ready": "true", | ||
"unschedulable": true | ||
} | ||
}, | ||
"status": { | ||
"ready": "true", | ||
"unschedulable": true | ||
} | ||
"Index": "", | ||
"ID": "", | ||
"Namespace": "kubernetes.node", | ||
"Timestamp": "0001-01-01T00:00:00Z", | ||
"Error": null, | ||
"Host": "", | ||
"Service": "", | ||
"Took": 0 | ||
}, | ||
{ | ||
"_namespace": "node", | ||
"cpu": { | ||
"allocatable": { | ||
"cores": 2 | ||
"RootFields": null, | ||
"ModuleFields": null, | ||
"MetricSetFields": { | ||
"cpu": { | ||
"allocatable": { | ||
"cores": 2 | ||
}, | ||
"capacity": { | ||
"cores": 2 | ||
} | ||
}, | ||
"capacity": { | ||
"cores": 2 | ||
} | ||
}, | ||
"memory": { | ||
"allocatable": { | ||
"bytes": 2097786880 | ||
"memory": { | ||
"allocatable": { | ||
"bytes": 2097786880 | ||
}, | ||
"capacity": { | ||
"bytes": 2097786880 | ||
} | ||
}, | ||
"capacity": { | ||
"bytes": 2097786880 | ||
} | ||
}, | ||
"name": "minikube", | ||
"pod": { | ||
"allocatable": { | ||
"total": 110 | ||
"name": "minikube", | ||
"pod": { | ||
"allocatable": { | ||
"total": 110 | ||
}, | ||
"capacity": { | ||
"total": 110 | ||
} | ||
}, | ||
"capacity": { | ||
"total": 110 | ||
"status": { | ||
"ready": "true", | ||
"unschedulable": false | ||
} | ||
}, | ||
"status": { | ||
"ready": "true", | ||
"unschedulable": false | ||
} | ||
"Index": "", | ||
"ID": "", | ||
"Namespace": "kubernetes.node", | ||
"Timestamp": "0001-01-01T00:00:00Z", | ||
"Error": null, | ||
"Host": "", | ||
"Service": "", | ||
"Took": 0 | ||
} | ||
] |
61 changes: 36 additions & 25 deletions
61
metricbeat/module/kubernetes/state_node/_meta/test/kube-state-metrics.v1.3.0.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,45 @@ | ||
[ | ||
{ | ||
"_namespace": "node", | ||
"cpu": { | ||
"allocatable": { | ||
"cores": 2 | ||
"RootFields": null, | ||
"ModuleFields": null, | ||
"MetricSetFields": { | ||
"cpu": { | ||
"allocatable": { | ||
"cores": 2 | ||
}, | ||
"capacity": { | ||
"cores": 2 | ||
} | ||
}, | ||
"capacity": { | ||
"cores": 2 | ||
} | ||
}, | ||
"memory": { | ||
"allocatable": { | ||
"bytes": 1992347648 | ||
"memory": { | ||
"allocatable": { | ||
"bytes": 1992347648 | ||
}, | ||
"capacity": { | ||
"bytes": 2097205248 | ||
} | ||
}, | ||
"capacity": { | ||
"bytes": 2097205248 | ||
} | ||
}, | ||
"name": "minikube", | ||
"pod": { | ||
"allocatable": { | ||
"total": 110 | ||
"name": "minikube", | ||
"pod": { | ||
"allocatable": { | ||
"total": 110 | ||
}, | ||
"capacity": { | ||
"total": 110 | ||
} | ||
}, | ||
"capacity": { | ||
"total": 110 | ||
"status": { | ||
"ready": "true", | ||
"unschedulable": false | ||
} | ||
}, | ||
"status": { | ||
"ready": "true", | ||
"unschedulable": false | ||
} | ||
"Index": "", | ||
"ID": "", | ||
"Namespace": "kubernetes.node", | ||
"Timestamp": "0001-01-01T00:00:00Z", | ||
"Error": null, | ||
"Host": "", | ||
"Service": "", | ||
"Took": 0 | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
metricbeat/module/kubernetes/state_node/_meta/testdata/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
type: http | ||
url: "/metrics" | ||
suffix: plain |
Oops, something went wrong.