Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Export VM metrics

Hi,

I have a use case where I want to export VM usage metrics to a GCP pub/sub topic and pull them on-premise and do something. While I see GCP provides an Ops Agent which captures the VM usage metrics, I could not find any mention of how to export the data to GCP pub/sub. Could someone help me how this could be achieved? Ideally I need the data at 30 second interval.

Also, in Ops Agent is there a way to add some custom metadata fields to each metric?

Thank You

1 3 540
3 REPLIES 3

Thanks @NES, but isn't the solution you suggested for logs and not metrics? The monitoring documentation only suggests REST and GRPC APIs.

Also, in Ops Agent is there a way to add some custom metadata fields to each metric?

I think this can be useful to understand how metrics can be exported:
 
https://cloud.google.com/architecture/stackdriver-monitoring-metric-export