2017-02-18 5 views
0

APIからメトリックpubsubを取得する方法を知りたい。 (私はこの話題Google PubSub - Counting messages in topicを見ましたが、それは同じ問題ではありません)。Stackdriver外のpubsubからメトリックを取得する方法

Logging APIからそれらを取得しようとすると、404エラーが返されます。

権利がないか、権利が不足していますか?お時間を

Client error: `GET https://logging.googleapis.com/v2/projects/my-project/metrics/pubsub.googleapis.com/topic/send_message_operation_count` resulted in a `404 Not Found`

ありがとう!

答えて

0

Stackdriver MonitoringStackdriver Loggingは異なります。 Pub/Subのメトリックは、Stackdriver Monitoringの一部として収集されます。 logging.googleapis.com APIはStackdriver Loggingの一部で、ログの検索、分析、および監視に使用されます。

send_message_operation_countメトリックにアクセスするには、timeSeries.listメソッドを使用することをお勧めします。 filtermetric.type = "pubsub.googleapis.com/topic/send_message_operation_count"に設定し、データを入力する区間の先頭にinterval.startTimeと設定します(例:2017-02-24T21:01:23.00Z)。interval.endTimeを、データの入力間隔の末尾に設定します(例:2017-02-24T22:01:23.00Z)。返されるデータとその方法を変更するために設定できるその他のプロパティがあります。特定のトピックのデータを返す場合は、AND resource.label.topic_id = "<topic name>"をフィルタに追加します。

https://monitoring.googleapis.com/v3/projects/my-project/timeSeries?interval.endTime=2017-02-24T22%3A01%3A23.00Z&filter=metric.type%20%3D%20%22pubsub.googleapis.com%2Ftopic%2Fsend_message_operation_count%22%20AND%20resource.label.topic_id%20%3D%20%22my-topic%22&interval.startTime=2017-02-23T21%3A01%3A23.00Z

(必要な権限情報なし)完全なリクエストURLは次のようになり

関連する問題