试图通过 Instana REST API 接收信息。看起来像这样:
https://[URL]/api/application-monitoring/metrics/applications?'Content-Type: application/json' -d '{"timeFrame": {"windowSize": [SIZE], "to": [SIZE]}, "metrics": [{"metric": "calls", "aggregation": "SUM"}, {"metric": "errors", "aggregation": "MEAN"}, {"metric": "latency", "aggregation": "MEAN"}, {"metric": "latency", "aggregation": "MIN"}, {"metric": "latency", "aggregation": "MAX"}], "nameFilter":"[NAME]"}'
找回那个错误:
{
"code": 405,
"message": "HTTP 405 Method Not Allowed"
}
匹配的 Curl 脚本(我不能使用)看起来像这样并且可以工作:
curl -H 'Authorization: apiToken <APITOKEN>' -H 'Content-Type: application/json' -d '{"timeFrame": {"windowSize": [SIZE], "to": [SIZE]}, "metrics": [{"metric": "calls", "aggregation": "SUM"}, {"metric": "errors", "aggregation": "MEAN"}, {"metric": "latency", "aggregation": "MEAN"}, {"metric": "latency", "aggregation": "MIN"}, {"metric": "latency", "aggregation": "MAX"}], "nameFilter":[NAME]}' [URL]
任何想法?