@@ -967,21 +967,26 @@ func ArchiveActiveOrgs(rt *runtime.Runtime) error {
967
967
968
968
timeTaken := dates .Now ().Sub (start )
969
969
slog .Info ("archiving of active orgs complete" , "time_taken" , timeTaken , "num_orgs" , len (orgs ))
970
- if rt .Config .DeploymentID != "dev" {
971
-
972
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("ArchiveElapsed" ), Value : aws .Float64 (float64 (len (orgs )))})
973
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("OrgsArchived" ), Value : aws .Float64 (float64 (len (orgs )))})
974
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("MsgsRecordsArchived" ), Value : aws .Float64 (float64 (totalMsgsRecordsArchived ))})
975
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("MsgsArchivedsCreated" ), Value : aws .Float64 (float64 (totalMsgsArchivesCreated ))})
976
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("MsgsArchivedsFailed" ), Value : aws .Float64 (float64 (totalMsgsArchivesFailed ))})
977
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("MsgsRollupsCreated" ), Value : aws .Float64 (float64 (totalMsgsRollupsCreated ))})
978
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("MsgsRollupsFailed" ), Value : aws .Float64 (float64 (totalMsgsRollupsFailed ))})
979
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("RunsRecordsArchived" ), Value : aws .Float64 (float64 (totalRunsRecordsArchived ))})
980
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("RunsArchivedsCreated" ), Value : aws .Float64 (float64 (totalRunsArchivesCreated ))})
981
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("RunsArchivedsFailed" ), Value : aws .Float64 (float64 (totalRunsArchivesFailed ))})
982
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("RunsRollupsCreated" ), Value : aws .Float64 (float64 (totalRunsRollupsCreated ))})
983
- rt .CW .Queue (types.MetricDatum {MetricName : aws .String ("RunsRollupsFailed" ), Value : aws .Float64 (float64 (totalRunsRollupsFailed ))})
970
+
971
+ metrics := []types.MetricDatum {
972
+ {MetricName : aws .String ("ArchiveElapsed" ), Value : aws .Float64 (timeTaken .Seconds ()), Unit : types .StandardUnitSeconds },
973
+ {MetricName : aws .String ("OrgsArchived" ), Value : aws .Float64 (float64 (len (orgs ))), Unit : types .StandardUnitCount },
974
+ {MetricName : aws .String ("MsgsRecordsArchived" ), Value : aws .Float64 (float64 (totalMsgsRecordsArchived )), Unit : types .StandardUnitCount },
975
+ {MetricName : aws .String ("MsgsArchivedsCreated" ), Value : aws .Float64 (float64 (totalMsgsArchivesCreated )), Unit : types .StandardUnitCount },
976
+ {MetricName : aws .String ("MsgsArchivedsFailed" ), Value : aws .Float64 (float64 (totalMsgsArchivesFailed )), Unit : types .StandardUnitCount },
977
+ {MetricName : aws .String ("MsgsRollupsCreated" ), Value : aws .Float64 (float64 (totalMsgsRollupsCreated )), Unit : types .StandardUnitCount },
978
+ {MetricName : aws .String ("MsgsRollupsFailed" ), Value : aws .Float64 (float64 (totalMsgsRollupsFailed )), Unit : types .StandardUnitCount },
979
+ {MetricName : aws .String ("RunsRecordsArchived" ), Value : aws .Float64 (float64 (totalRunsRecordsArchived )), Unit : types .StandardUnitCount },
980
+ {MetricName : aws .String ("RunsArchivedsCreated" ), Value : aws .Float64 (float64 (totalRunsArchivesCreated )), Unit : types .StandardUnitCount },
981
+ {MetricName : aws .String ("RunsArchivedsFailed" ), Value : aws .Float64 (float64 (totalRunsArchivesFailed )), Unit : types .StandardUnitCount },
982
+ {MetricName : aws .String ("RunsRollupsCreated" ), Value : aws .Float64 (float64 (totalRunsRollupsCreated )), Unit : types .StandardUnitCount },
983
+ {MetricName : aws .String ("RunsRollupsFailed" ), Value : aws .Float64 (float64 (totalRunsRollupsFailed )), Unit : types .StandardUnitCount },
984
+ }
985
+
986
+ if _ , err := rt .CW .Client .PutMetricData (ctx , rt .CW .Prepare (metrics )); err != nil {
987
+ slog .Error ("error putting metrics" , "error" , err )
984
988
}
989
+
985
990
analytics .Gauge ("archiver.archive_elapsed" , timeTaken .Seconds ())
986
991
analytics .Gauge ("archiver.orgs_archived" , float64 (len (orgs )))
987
992
analytics .Gauge ("archiver.msgs_records_archived" , float64 (totalMsgsRecordsArchived ))
0 commit comments