-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant retrieve Custom Metrics #77
Comments
Thanks for a detailed report, could you also show the logs of the |
Here you go . Looks like some sort out of range error
|
Then the question is if this query At least it would not be so hard to test this with all the data you provided :) |
I tested it like this and it is not valid at least with the json defined: package main
import (
"encoding/json"
"fmt"
"github.com/oliveagle/jsonpath"
)
const v = `{
"name" : "system.load.average.1m",
"description" : "The sum of the number of runnable entities queued to available processors and the number of runnable entities running on the available processors averaged over a period of time",
"baseUnit" : null,
"measurements" : [ {
"statistic" : "VALUE",
"value" : 0.0439453125
} ],
"availableTags" : [ ]
}`
func main() {
var json_data interface{}
json.Unmarshal([]byte(v), &json_data)
res, err := jsonpath.JsonPathLookup(json_data, "$.measurements[:1].value")
fmt.Println(err)
fmt.Println(res)
} Output is:
Using something like |
However this does not work with the kube-metrics-adapter because we expect a single value to be the result rather than a list. I think you need to do: |
You are correct. It should be $.measurements[0].value. Custom autoscaling now works
Sample output
|
Expected Behavior
Custom metrics exposed by spring boot actuator metric is read
Actual Behavior
Unable to get metrics
Steps to Reproduce the Problem
I know that I can get into a pod and retrieve metrics from the service endpoint so I'm not sure where things are going wrong
eg
Specifications
K8s 1.15
The text was updated successfully, but these errors were encountered: