How to properly use Custom Metrics for an HPA on Google Cloud

Cluster information:

Kubernetes version:
Cloud being used: Google

Hello, hopefully my question is in the right forum and please forgive my newbie self. I am currently using Kubernetes in Google and I have a server which is sending data to stackdriver. I currently have an HPA that is set to scale on CPU utilization, however, I would like to add an additional custom metric for scaling.

In GCP cloud monitoring, I can pull the data I am looking to using with the MQL (see exp 2 below). What I am trying to do is to use this data as a metric in an HPA for scaling. Initially, I have tried adding the following to the hpa yaml file (see exp 1 below) - but it does not work. Anyone have experience or have a place to point me in the right direction? I have read through a lot of documentation on google’s website, but nothing quite directs me to how to use it.

Thank you.

exp 1:

  - type: External
        type: AverageValue
        averageValue: 100

exp 2:

fetch global
| metric ''
| filter (metric.application == 'app')
| group_by 1m, [value_count_aggregate: aggregate(value.count)]
| every 1m