Would it be possible to allow specifying custom dimensions for CloudWatch metrics?
According to the current documentation - Monitoring Ions | Datomic -, only name
, value
and units
are supported.
We would like to add a customer reference dimension to our metrics too.
Currently we are using the AWS API directly - via the Cognitect AWS API Clojure lib -, but it means we have to get the Datomic system name and the CloudFormation stack name of the compute group ourselves (and we are not sure what’s the official way to obtain those).
Here is a rough example of what we are doing now:
(defn xxx-count! [customer-id]
(let [system-name (:datomic/system-name (ion/get-env))
stack (:deployment-group (ion/get-app-info))]
(req!
{:api :monitoring,
:op :PutMetricData,
:Namespace "DatomicCloud",
:MetricData [{:Unit "Count",
:MetricName "<OurCustomMetricName>",
:Value "1",
:Dimensions [{:Name "customer-ref"
:Value (util/customer-id->ref customer-id)}
{:Name "system" :Value system-name}
{:Name "stack" :Value stack}]}]})
and this is what i would wish for (again, just roughly):
(cast/metric
{:name :OurCustomMetricName
:value 1
:units :count
:extra-dimensions {:customer-ref (util/customer-id->ref customer-id)}})
I’m not sure if the order of the dimensions matter.
If we could get the stack name and the datomic system name easily (both locally and remotely, which means the stack name should be probably the ion app name from the ion-config.edn
), then i wouldn’t miss this feature so much from the cast/metrics
function.