Closed Glennvd closed 6 years ago
@alexander-fenster do you know who we could ping about this?
@Glennvd in your code, the metric
variable seems either omitted or undefined:
metric: {
type: metric, // <-- here
},
According to the doc, the metric type should be a string. Are you sure your code sets that correctly? It could've explained the error within timeSeries[0]
.
These were filled in correct, this is a console.log of my payload (with some information redacted)
{
name: "projects/XXX"
timeSeries: [
0: {
metric: {
type: "custom.googleapis.com/XXX/YYY"
}
points: [
0: {
interval: {
endTime: {
seconds: 1515054690
}
}
value: {
doubleValue: 0.001
}
}
]
resource: {
labels: {
cluster_name: "XXX"
container_name: "XXX"
instance_id: "163211280624099561"
namespace_id: "<k8s namespace name>"
pod_id: "7ed88526-eca8-11e7-b0f9-42010a8400af"
project_id: "XXX"
zone: "europe-west1-d"
}
type: "gke_container"
}
}
]
}
The only value I'm doubting is that my namespace_id could be wrong, but according to the docs that isn't even mandatory (and I get the same error when I don't include it)
Thanks for the payload. The error is coming from the server, and "An internal error occurred" that is returned is not really helpful. Investigating, will update the issue when I get more information.
Hey @alexander-fenster, any info on this? Should we connect @Glennvd with a better support channel, e.g. message board, support email, etc.?
Any update on this?
Issue has been resolved through stackdriver support. Was a bug with certain project configurations.
Environment details
Steps to reproduce
I've started from the go sample at https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/custom-metrics-stackdriver-adapter and combined that with the nodejs sample from the readme.md. This leads me to the following script.
If i run this inside my GKE cluster, I receive the following error:
If I take the printed values, fill them in in the go example I mentioned earlier. It executes correctly. So this looks like a nodejs client bug? The only other differences are minor, like the language specific way to get the current timestamp etc.