File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/sentry/runner/commands Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11import sys
2+ import time
23from typing import Any
34
45import click
@@ -120,6 +121,7 @@ def configoptions(
120121 from sentry import options
121122
122123 ctx .obj ["dry_run" ] = dry_run
124+ ctx .obj ["timestamp" ] = timestamp
123125
124126 with open (file ) if file is not None else sys .stdin as stream :
125127 options_to_update = safe_load (stream )
@@ -216,6 +218,13 @@ def patch(ctx: click.Context) -> None:
216218 tags = {"status" : status },
217219 sample_rate = 1.0 ,
218220 )
221+ if ctx .obj ["timestamp" ] is not None :
222+ metrics .distribution (
223+ key = "options_automator.latency_seconds" ,
224+ value = time .time () - ctx .obj ["timestamp" ],
225+ tags = {"status" : status },
226+ sample_rate = 1.0 ,
227+ )
219228 exit (ret_val )
220229
221230
@@ -311,5 +320,12 @@ def sync(ctx: click.Context) -> None:
311320 tags = {"status" : status },
312321 sample_rate = 1.0 ,
313322 )
323+ if ctx .obj ["timestamp" ] is not None :
324+ metrics .distribution (
325+ key = "options_automator.latency_seconds" ,
326+ value = time .time () - ctx .obj ["timestamp" ],
327+ tags = {"status" : status },
328+ sample_rate = 1.0 ,
329+ )
314330
315331 exit (ret_val )
You can’t perform that action at this time.
0 commit comments