From 42002eddda3f54b1c9beab924edc11ff021e895f Mon Sep 17 00:00:00 2001 From: Kenan Erdogan Date: Tue, 16 Jun 2020 13:01:51 +0200 Subject: [PATCH] add resolved ref information into launch events --- binderhub/builder.py | 6 ++++-- binderhub/event-schemas/launch.json | 6 +++++- doc/eventlogging.rst | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/binderhub/builder.py b/binderhub/builder.py index b0e9acf4f..baf68b382 100644 --- a/binderhub/builder.py +++ b/binderhub/builder.py @@ -322,9 +322,10 @@ async def get(self, provider_prefix, _unescaped_spec): }) with LAUNCHES_INPROGRESS.track_inprogress(): await self.launch(kube, provider) - self.event_log.emit('binderhub.jupyter.org/launch', 3, { + self.event_log.emit('binderhub.jupyter.org/launch', 4, { 'provider': provider.name, 'spec': spec, + 'ref': ref, 'status': 'success', 'origin': self.settings['normalized_origin'] if self.settings['normalized_origin'] else self.request.host }) @@ -428,9 +429,10 @@ async def get(self, provider_prefix, _unescaped_spec): BUILD_COUNT.labels(status='success', **self.repo_metric_labels).inc() with LAUNCHES_INPROGRESS.track_inprogress(): await self.launch(kube, provider) - self.event_log.emit('binderhub.jupyter.org/launch', 3, { + self.event_log.emit('binderhub.jupyter.org/launch', 4, { 'provider': provider.name, 'spec': spec, + 'ref': ref, 'status': 'success', 'origin': self.settings['normalized_origin'] if self.settings['normalized_origin'] else self.request.host }) diff --git a/binderhub/event-schemas/launch.json b/binderhub/event-schemas/launch.json index 662d03680..25f59a12e 100755 --- a/binderhub/event-schemas/launch.json +++ b/binderhub/event-schemas/launch.json @@ -1,6 +1,6 @@ { "$id": "binderhub.jupyter.org/launch", - "version": 3, + "version": 4, "title": "BinderHub Launch Events", "description": "BinderHub emits this event whenever a new repo is launched", "type": "object", @@ -22,6 +22,10 @@ "type": "string", "description": "Provider specification for the repo being launched. Usually, /" }, + "ref": { + "type": "string", + "description": "Resolved reference to the repo when it is being launched" + }, "status": { "enum": ["success", "failure"], "description": "Success/Failure of the launch" diff --git a/doc/eventlogging.rst b/doc/eventlogging.rst index d37cbbf2e..231ed7603 100644 --- a/doc/eventlogging.rst +++ b/doc/eventlogging.rst @@ -52,6 +52,7 @@ This event is emitted whenever a new repo is launched. Schemas: -- `version 1 `_ +- `version 1 `_ - `version 2 `_ -- `version 3 `_ +- `version 3 `_ +- `version 4 `_