Skip to content

Commit

Permalink
add resolved ref information into launch events
Browse files Browse the repository at this point in the history
  • Loading branch information
bitnik committed Jun 16, 2020
1 parent 3cb82fa commit 42002ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions binderhub/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down Expand Up @@ -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
})
Expand Down
6 changes: 5 additions & 1 deletion binderhub/event-schemas/launch.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -22,6 +22,10 @@
"type": "string",
"description": "Provider specification for the repo being launched. Usually, <reponame>/<commit-specification>"
},
"ref": {
"type": "string",
"description": "Resolved reference to the repo when it is being launched"
},
"status": {
"enum": ["success", "failure"],
"description": "Success/Failure of the launch"
Expand Down
5 changes: 3 additions & 2 deletions doc/eventlogging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ This event is emitted whenever a new repo is launched.

Schemas:

- `version 1 <https://github.com/jupyterhub/binderhub/blob/ba15091b0940174c1001aefd2c89b96daa8005cb/binderhub/event-schemas/launch.json>`_
- `version 1 <https://github.com/jupyterhub/binderhub/blob/3da0f0c07eeea1b4517e5c7d1ec4a3166b3ca11c/binderhub/event-schemas/launch.json>`_
- `version 2 <https://github.com/jupyterhub/binderhub/blob/5cc0f496cac98d6c9b7d645e6fb236fd1e5277f4/binderhub/event-schemas/launch.json>`_
- `version 3 <https://github.com/jupyterhub/binderhub/blob/master/binderhub/event-schemas/launch.json>`_
- `version 3 <https://github.com/jupyterhub/binderhub/blob/3bfee95f7c53d16604ea29f46b7e7c5aa1b49a63/binderhub/event-schemas/launch.json>`_
- `version 4 <https://github.com/jupyterhub/binderhub/blob/master/binderhub/event-schemas/launch.json>`_

0 comments on commit 42002ed

Please sign in to comment.