Express export logs range in milliseconds
The export-logs task expects the time range in milliseconds rather than
seconds.
Change-Id: Id26ffc41b3e35ad41ffe094cb412378d152d2e97
diff --git a/operations/Operations.md b/operations/Operations.md
index 35d96e0..c9129f6 100644
--- a/operations/Operations.md
+++ b/operations/Operations.md
@@ -15,15 +15,15 @@
make \
[AWS_REGION=<region>] \
[AWS_PREFIX=<prefix>] \
- [EXPORT_FROM_SECONDS=<epoch_secs>] \
+ [EXPORT_FROM_MILLIS=<epoch_millis>] \
[S3_EXPORT_LOGS_BUCKET_NAME=<bucket>] \
export-logs
```
*`AWS_REGION`: Optional. Defaults to the value set in your [common.env](../common.env)
*`AWS_PREFIX`: Optional. Defaults to the value set in your [common.env](../common.env)
-*`EXPORT_FROM_SECONDS`. Optional. The start time of the range for the request,
- expressed as the number of seconds after Jan 1, 1970 00:00:00 UTC.
+*`EXPORT_FROM_MILLIS`. Optional. The start time of the range for the request,
+ expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
*`S3_EXPORT_LOGS_BUCKET_NAME`: Optional. Defaults to `$(AWS_PREFIX)-s3-export-logs`
Note: this command assumes that the bucket already exists and that is configured
@@ -36,7 +36,7 @@
make \
[AWS_REGION=<region>] \
[AWS_PREFIX=<prefix>] \
- [EXPORT_FROM_SECONDS=<epoch_secs>] \
+ [EXPORT_FROM_MILLIS=<epoch_millis>] \
[S3_EXPORT_LOGS_BUCKET_NAME=<bucket>] \
setup-bucket-and-export-logs
```
diff --git a/operations/export-logs/Makefile b/operations/export-logs/Makefile
index d7abdb5..164d24e 100644
--- a/operations/export-logs/Makefile
+++ b/operations/export-logs/Makefile
@@ -1,6 +1,6 @@
now = $(shell date +%s)
destination-prefix-name = gerrit-export-logs-ts-$(now)
-EXPORT_FROM_SECONDS ?= 0000000000
+EXPORT_FROM_MILLIS ?= 0000000000000
create-s3-export-logs-bucket:
$(eval CREATE_S3_EXPORT_PARAMS_LOGS_PARAMS := --bucket $(S3_EXPORT_LOGS_BUCKET_NAME))
@@ -29,10 +29,10 @@
$(eval TASK_ID := $(shell $(AWS) logs create-export-task --task-name $(DESTINATION_PREFIX) \
--log-group-name $(CLUSTER_STACK_NAME) \
--destination $(S3_EXPORT_LOGS_BUCKET_NAME) \
- --from $(EXPORT_FROM_SECONDS)000 --to $(now)000 \
+ --from $(EXPORT_FROM_MILLIS) --to $(now)000 \
--destination-prefix $(DESTINATION_PREFIX) | jq -r '.taskId'))
- @echo "Launched export task id $(TASK_ID) from $(EXPORT_FROM_SECONDS)000 to $(now)000"
+ @echo "Launched export task id $(TASK_ID) from $(EXPORT_FROM_MILLIS) to $(now)000"
wait_for_export:
while [[ $$(aws logs describe-export-tasks --task-id "$(TASK_ID)" | jq -r '.exportTasks[0].status.code') =~ RUNNING|PENDING|PENDING_CANCEL ]]; do \