Stackdriver MonitoringとStackdriver Loggingは異なります。 Pub/Subのメトリックは、Stackdriver Monitoringの一部として収集されます。 logging.googleapis.com APIはStackdriver Loggingの一部で、ログの検索、分析、および監視に使用されます。
send_message_operation_count
メトリックにアクセスするには、timeSeries.listメソッドを使用することをお勧めします。 filter
をmetric.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は次のようになり