I was successfully able to configure newrelic for my cloudsql for postgresql instance. Also, I could see the instance monitoring into newrelic dashboard. However, when I'm running below query on the db instance, I'm getting below error:
SELECT
instanceId,
maxCpu,
maxMemoryUtilization,
maxTransactionsCount,
maxDiskUtilization
FROM (
SELECT
max(database.cpu.Utilization) AS maxCpu,
max(gcp.cloudsql.database.memory.utilization) AS maxMemoryUtilization,
max(gcp.cloudsql.database.postgresql.transaction_count) AS maxTransactionsCount,
max(gcp.cloudsql.database.disk.utilization) AS maxDiskUtilization
FROM Metric
FACET entity.name AS 'instanceId'
LIMIT MAX
) WHERE instanceId like '%my-db-instance%'
LIMIT MAX
SINCE 2 weeks ago
ERROR: syntax error at or near "entity" LINE 14: FACET entity.name AS 'instanceId'
Not sure, why I'm still getting error after successful configuration. Any suggestion will be appreciated.
You can't use the clause "AS" with the clause "FACET".
Change from:
To: