statsd better approach

This commit is contained in:
2022-09-17 06:59:41 -07:00
parent 98f21bf3df
commit 4bcb2b7c53
4 changed files with 11 additions and 11 deletions

View File

@@ -5,13 +5,14 @@
[mount.core :as mount]
[auto-ap.datomic :refer [conn]]
[clojure.tools.logging :as log]
[auto-ap.background.metrics :refer [metrics-setup]]
[unilog.context :as lc]))
(defn -main [& _]
(lc/with-context {:background-job "square-loading-new"}
(mount/start (mount/only #{#'conn}))
(mount/start (mount/only #{#'conn #'metrics-setup}))
((heartbeat square/upsert-all "square-loading"))
(mount/stop (mount/only #{#'conn}))
(mount/stop (mount/only #{#'conn #'metrics-setup}))
(log/info "Stopping Square loading")
(System/exit 0)))

View File

@@ -356,8 +356,7 @@ resource "aws_cloudwatch_event_target" "square_import_job_target" {
{
"name": "integreat-app",
"environment": [{"name": "INTEGREAT_JOB", "value": "square-import-job"},
{"name": "DD_SERVICE", "value": "square-import-job"},
{"name": "DD_CONTAINER_ENV_AS_TAGS", "value":"{\"INTEGREAT_JOB\":\"task_family\"}"}]
{"name": "DD_CONTAINER_ENV_AS_TAGS", "value":"{\"INTEGREAT_JOB\":\"background_job\"}"}]
}
]
}

View File

@@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.2.7",
"serial": 121,
"serial": 123,
"lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51",
"outputs": {
"aws_access_key_id": {
@@ -153,7 +153,7 @@
"event_bus_name": "default",
"http_target": [],
"id": "square-import-job-schedule-square-import-job",
"input": "{\n \"containerOverrides\": [\n {\n \"name\": \"integreat-app\",\n \"environment\": [{\"name\": \"INTEGREAT_JOB\", \"value\": \"square-import-job\"},\n {\"name\": \"DD_SERVICE\", \"value\": \"square-import-job\"},\n {\"name\": \"DD_CONTAINER_ENV_AS_TAGS\", \"value\":\"{\\\"INTEGREAT_JOB\\\":\\\"task_family\\\"}\"}] \n }\n ]\n}\n",
"input": "{\n \"containerOverrides\": [\n {\n \"name\": \"integreat-app\",\n \"environment\": [{\"name\": \"INTEGREAT_JOB\", \"value\": \"square-import-job\"},\n {\"name\": \"DD_CONTAINER_ENV_AS_TAGS\", \"value\":\"{\\\"INTEGREAT_JOB\\\":\\\"background_job\\\"}\"}]\n }\n ]\n}\n",
"input_path": "",
"input_transformer": [],
"kinesis_target": [],
@@ -255,7 +255,7 @@
],
"tags": {},
"tags_all": {},
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_prod:354",
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_prod:355",
"timeouts": {
"delete": null
},
@@ -334,7 +334,7 @@
],
"tags": {},
"tags_all": {},
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_background-worker_prod:332",
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_background-worker_prod:333",
"timeouts": {
"delete": null
},

View File

@@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.2.7",
"serial": 118,
"serial": 121,
"lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51",
"outputs": {
"aws_access_key_id": {
@@ -101,7 +101,7 @@
"name": "square-import-job-schedule",
"name_prefix": "",
"role_arn": "",
"schedule_expression": "rate(5 minutes)",
"schedule_expression": "rate(4 hours)",
"tags": {},
"tags_all": {}
},
@@ -153,7 +153,7 @@
"event_bus_name": "default",
"http_target": [],
"id": "square-import-job-schedule-square-import-job",
"input": "{\n \"containerOverrides\": [\n {\n \"name\": \"integreat-app\",\n \"environment\": [{\"name\": \"INTEGREAT_JOB\", \"value\": \"hello-world\"},\n {\"name\": \"DD_SERVICE\", \"value\": \"hello-world\"},\n {\"name\": \"DD_CONTAINER_ENV_AS_TAGS\", \"value\":\"{\\\"INTEGREAT_JOB\\\":\\\"service\\\"}\"}] \n }\n ]\n}\n",
"input": "{\n \"containerOverrides\": [\n {\n \"name\": \"integreat-app\",\n \"environment\": [{\"name\": \"INTEGREAT_JOB\", \"value\": \"square-import-job\"},\n {\"name\": \"DD_SERVICE\", \"value\": \"square-import-job\"},\n {\"name\": \"DD_CONTAINER_ENV_AS_TAGS\", \"value\":\"{\\\"INTEGREAT_JOB\\\":\\\"task_family\\\"}\"}] \n }\n ]\n}\n",
"input_path": "",
"input_transformer": [],
"kinesis_target": [],