Closed Bug 1137839 Opened 9 years ago Closed 9 years ago

[alerts] add "alert happened on" timestamp

Categories

(Input Graveyard :: Backend, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: willkg)

Details

(Whiteboard: u=analyzer c=alerts p=2 s=input.2015q1)

We're currently conflating the "created" time (when the Alert record was created) with the "alert happened on" time in the Alerts system and API. This creates several problems: we can't backfill alerts, the emitter needs to post the alert as soon as the event has happened--it can't wait for some period of time later--and we don't account for timezone offsets

This bug covers:

1. adding another required timestamp field to the model

2. figuring out what format the API should require for that field which accounts for timezones

3. establishing how this field will work

4. documenting all that with Python examples
Grabbing this to work on on Monday.
Assignee: nobody → willkg
Status: NEW → ASSIGNED
I had a dream where my future self said to name the new field "start" and while I was doing this, to also add an "end" field to allow for alerts that talk about some happenstance over a period of time. My future self said the fate of humanity depends on this!
In PR: https://github.com/mozilla/fjord/pull/506

We're using iso8601 which is pretty standard.

* JavaScript: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
* Python: https://docs.python.org/2/library/datetime.html#datetime.datetime.isoformat

I didn't add Python examples to the documentation. I'll just send those to Cheng in an email.
Whiteboard: u=analyzer c=alerts p= s=input.2015q1 → u=analyzer c=alerts p=2 s=input.2015q1
Landed in https://github.com/mozilla/fjord/commit/7a604979867adb46ee72c95225bebb9df0b751a0

Pushed this to prod just now.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.