Search code examples
stackdrivergoogle-cloud-stackdrivermicrometer

Custom metrics confusion


I added https://micrometer.io to our staging server in google cloud. The metric does not show up in "Cloud Run Revision" resource types. It is only visible if I select "Global" as seen here...

enter image description here

The instructions were very simple and very clear (MUCH UNLIKE opencensus which has a way overdesigned api). In fact, unlike opencensus, it worked out of the box except for it is not recording into "Cloud Run Revision".

I can't even choose the service_name in the filter so once I deploy to production, the metric will be recording BOTH prod and staging which is not what we want.

  1. How do I debug micrometer further
  2. If anyone knows offhand as well what the issue might be, that would be great as well? (though I don't mind learning micrometer and debugging it a bit more).

Solution

  • For now the only available monitored-resource types in your custom metrics are:

    • aws_ec2_instance: Amazon EC2 instance.
    • dataflow_job: Dataflow job.
    • gce_instance: Compute Engine instance.
    • gke_container: GKE container instance.
    • generic_node: User-specified computing node.
    • generic_task: User-defined task.
    • global: Use this resource when no other resource type is suitable. For most use cases, generic_node or generic_task are better choices than global.
    • k8s_cluster: Kubernetes cluster.
    • k8s_container: Kubernetes container.
    • k8s_node: Kubernetes node.
    • k8s_pod: Kubernetes pod.

    So, global is the correct monitored-resource type in this case, since there is not a Cloud Run monitored-resource type yet.

    To identify better the metrics, you can create metric descriptors, either Auto-creation or manually