MPS deployment status dashboard
Categories
(Data Platform and Tools :: General, task, P3)
Tracking
(Not tracked)
People
(Reporter: bugzilla, Assigned: amiyaguchi)
References
Details
Attachments
(1 file, 3 external files)
|
50.98 KB,
image/png
|
Details |
As discussed in the data eng meeting, it's not super easy to recreate history for when various schema builds were running in production right now. Ideally, we would have an accessible log of when builds actually hit production (and, for extra credit, when they should have but fail.)
Comment 1•6 years ago
|
||
I'm open to suggestions on what this log should look like. Currently the closest approximation is just an irc bot that informs me when deploys succeed or fail. I had previously asked :klukas and :relud whether they were interested in a slack version, but at the time they were not. I will probably need to migrate this to slack anyway for my own purposes before irc is decommissioned.
https://github.com/mozilla-services/cloudops-infra/pull/1177/files was supposed to be a similar mechanism (sending an email to telemetry-alerts, but only on failures), but that is presently misconfigured and I believe telemetry-alerts is largely considered "not useful" at this time anyway.
One option might be to maintain stage and prod branches in MPS. The merge commit times could be used indicate the success or failure of a deploy. In the case of multiple failed deploys of the same MPS commit, you would need an alternate mechanism to indicate that with e.g. tagging. Tagging MPS generated-schemas is a similar option.
| Assignee | ||
Comment 2•6 years ago
|
||
We discussed this last month at the all hands -- I think that using a git repository as our source of truth for schema deploys is the right approach for operational visibility. It's simple to pull down to inspect locally (git fetch --all), the history is available via a web interface (e.g. commits/generated-schemas), and Github provides notification options via the events API and through continuous integration.
The schema repository would probably look like the following:
master- development and general day to day workgenerated-schemas- deployed manually or once a day bymozilla/mozilla-schema-generator:latestgenerated-schemas-nonprod- branch with merge commits fromgenerated-schemas, with pass or fail in the commit messagegenerated-schemas-prod- Branch with merge commits fromgenerated-schemas, always with a later timestamp thangenerated-schemas-nonprod. Can always be used as the source of truth for table schemas, as alternative tobq show.
We should make sure to make it hard to modify any of the generated-schemas branches (accidentally deleting them, etc).
Some options for notifications if we use this approach:
- Github push events
- CircleCI notifications that run on specific branches (with links to badges for visibility from the main schema repo page)
Updated•6 years ago
|
| Assignee | ||
Comment 3•6 years ago
|
||
My bid for tackling this in the short term is to scrape the schemas_build_id label from the nonprod and prod telemetry datasets every 15 minutes to build up an indirect event log. It should be straightforward to build a dashboard in STMO that we can point people to.
One idea that was brought up during discussion that could replace this is to dump the information that's powering the #dataops-alert channel into a BigQuery table. We could replace the status dashboard real event data in that case.
Comment 4•6 years ago
|
||
We should fit this into the framework of the forthcoming datasets monitoring proposal instead of making a one-off. As has been pointed out in discussion this week, there are really two pieces to making this event log useful (the log itself and conveying the log in some way to users) and in my opinion the nascent proposal should help cover the latter piece (hopefully not in one-off fashion).
Within that framework, the data source that powers a monitor is effectively what's in comment #2 or :amiyaguchi's short term version. I remain of the opinion that having a perfect event log is not as high priority as fixing underlying issues that cause schemas pipeline failures, and I would consider :amiyaguchi's short term solution sufficient for the purpose of motivating development of our datasets monitoring story.
Aside: if labels were present on tables in STMO, that almost seems like it would be sufficient UI for a person inspecting a table to infer that schemas are out-of-date. At any rate I expect that as the proposal develops STMO will not be the final interface we use for conveying dataset health, but for this one-off (seemingly rather important) case an STMO dashboard may be in order.
Comment 5•6 years ago
|
||
Also worth noting is that an event log already exists for dataset updates by virtue of bigquery audit logs (example). It may be that the production version of this event log is simply an exported log sink of UpdateDataset and UpdateTable operations.
| Assignee | ||
Comment 6•6 years ago
|
||
The the audit logs are missing the value of the schemas_build_id for the dataset, which is more important than a precise timestamp in this case. That label plus some SQL will let us emulate git history logs (e.g. https://github.com/mozilla-services/mozilla-pipeline-schemas/commits/generated-schemas/schemas), where the datasets are the source of truth.
SELECT
DISTINCT SPLIT(schemas_build_id, "_")[OFFSET(0)] AS build_timestamp,
project,
SPLIT(schemas_build_id, "_")[OFFSET(1)] AS commit_hash
FROM
`monitoring-queries.mozilla_pipeline_schemas.build_id_v1`
ORDER BY
build_timestamp
The sandbox project is already set up, so I'll come back to it after a few deploys and see how useful the info is. Having this as a one-off lets us do some other things, like directly linking to the commit via an href to Github. There's an FxA dashboard that's kind of similar in terms of presentation (linked by :mreid: https://philbooth.me/fxa).
Comment 7•6 years ago
|
||
(In reply to Anthony Miyaguchi [:amiyaguchi] from comment #6)
The the audit logs are missing the value of the
schemas_build_idfor the dataset,
The link I provided should definitely have had schemas_build_id in it (it should even be in the summary field i.e. not requiring inspecting the payload). It is possible (likely even) that the data can't be viewed without ops privileges. It's there mostly as a reference point to possibly save myself work in the future.
| Assignee | ||
Comment 8•6 years ago
|
||
I overlooked it, it looks like it's available under protoPayload.metadata.datasetChange.dataset.datasetInfo.labels.schemas_build_id.
| Assignee | ||
Comment 9•6 years ago
|
||
I've put together a set of resources that can be used to track deployment history. It should let us evaluate how we want to present this information.
There is a BigQuery table located in monitoring-queries.mozilla_pipeline_schemas.build_id_v1 with the project and schemas_build_id label taken scraped from prod/nonprod every 15 minutes. There is a view located at monitoring-queries.mozilla_pipeline_schemas.deploys that dedupes and parses the schemas_build_id to get the timestamp of the jenkins deploy and the commit hash from mozilla-pipeline-schemas.
I've put together a prototype of a dashboard here: https://protosaur.dev/mps-deploys.
Comment 10•6 years ago
|
||
how we want to present this information.
I remain of the opinion that without the additional context of probe scraper DAG status it will be difficult to present this information in a way that indicates whether the schemas pipeline is fully operational. Once bug #1666608 is resolved this dashboard should approximately reflect the propagation time of generated-schemas to stage and prod, which is typically only interesting information in the event that the schemas pipeline is having issues (which again, will almost always be apparent from probe-scraper DAG status).
However, schemas pipeline health is not the only potential use of this information and having something like https://philbooth.me/fxa for data seems like an interesting idea. It would require instrumentation beyond what's scoped here, which ignores e.g. schemas propagation to beam and ingestion-sink, but I suspect it would be mostly achievable through custom processing of existing logging.
| Assignee | ||
Comment 11•6 years ago
|
||
| Assignee | ||
Comment 12•6 years ago
|
||
| Assignee | ||
Comment 13•6 years ago
|
||
I added two more scrapers to get all the relevant information to infer the current status of schemas. There is now a commit_log table with commits from master and generated-schemas.
SELECT * FROM `monitoring-queries.mozilla_pipeline_schemas.commit_log`
[
{
"committed_timestamp": "2020-09-25 02:03:46 UTC",
"branch": "generated-schemas",
"hexsha": "55863c2f2c9428bf2a5d29f4c5090daac9e75484",
"committer_name": "Generated Schema Creator",
"committer_email": "dataops+pipeline-schemas@mozilla.com",
"message": "Auto-push from schema generation [ci skip]\n\nc8a1d549\t2020-09-24 09:44:13 -0400\tYak shave extract_crash_annotation_fields for easier usage (#622)\n"
},
{
"committed_timestamp": "2020-09-24 13:44:13 UTC",
"branch": "master",
"hexsha": "c8a1d5495ae5ece64b2861e128464417930c1d4a",
"committer_name": "GitHub",
"committer_email": "noreply@github.com",
"message": "Yak shave extract_crash_annotation_fields for easier usage (#622)\n\n* switch to argparse because it gives better help and error messages\r\n* add print lines so it tells you what it's doing as it goes along\r\n* reformat with black\r\n* add a note about how to run this"
},
...
]
There is also an event log of the probeinfo updates.
SELECT * FROM `monitoring-queries.mozilla_pipeline_schemas.probeinfo_meta`
[
{
"last_update": "2020-09-25 00:55:32.816001 UTC"
}
]
Some questions that could be answered with this information, given a lack of context into the workings of the data eng/ops infrastructure:
- What commits in master are not yet deployed?
- Could a deploy be delayed by the probe-scraper not being updated?
- Was the last deploy caused by the probe-scraper or by a commit to master?
I'd like to see these added to the dashboard in two ways. The first is a table of commits in master that are not yet deployed as per schemas_build_id. The second is a history or recent probeinfo updates.
Comment 14•6 years ago
|
||
One question not answered is "Could a deploy be delayed by an MSG failure?" which goes back to probe scraper DAG status being important for the purposes of discerning schemas pipeline status. You ostensibly have half of it with probe scraper scraping, but I would say MSG status is required to have "all the relevant information to infer the current status of schemas.".
Actually, you could probably answer this question implicitly given the supplied information (by process of elimination), but it would require knowledge of data eng/ops infrastructure beyond the information presented.
| Assignee | ||
Comment 15•6 years ago
|
||
This is true, I should have said some rather than all.
In terms of MSG failures, access to the Airflow state in some form would be nice, otherwise a failure would need to be inferred from the last probeinfo update and the last commit to master. There are a couple of subtle cases that are difficult to account for: the probescraper being updated without new probes or m-p-s being updated without a diff against generated-schemas. I don't think anyone would be looking at the dashboard if there wasn't an expectation of a deploy though.
Comment 16•6 years ago
|
||
In terms of MSG failures, access to the Airflow state in some form would be nice,
This is something we could investigate given that airflow has an API that we are all too aware of now, but probably not in the short term (just like the original request in this bug). Still, I think an MSG failure is a more likely reason for somebody to be looking at this dashboard than a propagation delay between a generated-schemas push and deployment to stage and prod.
I don't think anyone would be looking at the dashboard if there wasn't an expectation of a deploy though.
I think we all agree that we should make generated-schemas authoritative for what the pipeline state "should" be (bug #1666608). It reduces the question of whether the schemas deployment pipeline is up to date to:
- The latest probe-scraper DAG completed without error
- The HEAD of
generated-schemasmatches what's deployed to production
Any reason for which the above two things aren't true (or for which those things are true but shouldn't be) indicates an issue somewhere in the schemas deployment pipeline, and the metadata put together so far goes most of the way to helping identify a cause.
I continue to maintain that the propagation time between generated-schemas commit and deploy to stage and prod (the original subject of this bug) is mostly not interesting to users as answering the question "is the schemas deployment pipeline up to date?", and that having a pristine generated-schemas branch would serve the same purpose as the log requested in this bug.
At any rate, I submit that the very useful prototype work :amiyaguchi is doing here is beyond the scope of the original bug, and that he implemented in comment #3 a scraper that is substantially sufficient for his out-of-scope work as generated-schemas would be if it were pristine. I would also categorize getting airflow DAG state information as out-of-scope but arguably just as important pursuant to the issue of conveying schemas deployment status.
Which is to say: we should rename this bug or otherwise restructure this prototype work since it is not blocked on completion of this bug as originally spec'd.
Comment 17•5 years ago
|
||
I'm renaming this bug per my previous comment and as :amiyaguchi has done all the work here. One thing to note is that the recent string of probe-scraper DAG failures exemplifies some of my comments here (particularly comment #14), as those failures would have been out of scope of the originally requested event log.
Currently the MPS dashboard will show you that the last deploy happened 4 days ago, but it doesn't tell you whether that is because there haven't been any schemas changes or because some component is failing (the latter is true). With the resolution of bug #1667920, the event logging originally described here would enable more accurate propagation delay measurement than :amiyaguchi's existing logic (though high resolution isn't important), and provide an errors log to the MPS dashboard in failure cases, but I continue to maintain that MSG DAG status is more important to propagate to the dashboard than ops deploy time. Only once (2020-10-11 UTC, for bug #1672992) has an MPS deploy been paused due to ops stoppage, and the probe-scraper DAG produced a no-op for that day anyway. In the same way that deploy time is currently measured, ops pipeline errors/stoppage can be inferred from an abnormal propagation time between generated-schemas commit time and production table state; an event log would only provide a higher resolution version of that. MSG DAG status however can't be inferred, because a successful no-op and a failure produce the same result (no change to generated-schemas).
Ideally, the MPS dashboard would inform its users whether schemas are up to date, and that requires more information than it currently has access to. The calculation for "up to date" includes probe-scraper/MSG statuses, generated-schemas commit time, and the originally requested event log. The last piece can be inferred from a propagation delay beyond a couple of hours from the generated-schemas commit time, so I think further efforts here should focus on the other statuses.
| Assignee | ||
Comment 18•5 years ago
|
||
I recently added a new table to the dashboard to show up to date information about the last probe-scraper update. Frank added a deploy timestamp as a probe-scraper artifact that is being ingested every 15 minutes into monitoring-queries.mozilla_pipeline_schemas.probeinfo_status. It will show a partial-outage if the time from last deploy deviates from historical values. There are currently 7 partial outages out of the last 92 runs which align with my recent memory of probe-scraper issues.
Comment 19•5 years ago
|
||
Something still missing from the dashboard is the class of errors associated with MSG failing, https://bugzilla.mozilla.org/show_bug.cgi?id=1609738#c14 for bug #1688633. We were considering this class of errors to be fairly unlikely which jinxed it. The dashboard does show MPS pending commits which in many cases will be sufficient to determine the schemas pipeline is having a partial outage.
:amiyaguchi and I talked about this a bit last week and it would probably be possible to infer an MSG failure from the information already analyzed, but from a technical perspective this would be heuristic.
Comment 20•5 years ago
|
||
This has been a very useful status dashboard over the last few probe-scraper/msg/ops issues, and good enough to be considered complete. Thanks for working on this :amiyaguchi.
Updated•4 years ago
|
Description
•