File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 64
64
LimitSize int
65
65
66
66
// OperationNameFunc composes operation name based on context. Can be used to override default naming
67
- OperationNameFunc func (ctx echo.Context ) string
67
+ OperationNameFunc func (c echo.Context ) string
68
68
}
69
69
)
70
70
@@ -255,9 +255,9 @@ func generateToken() string {
255
255
return fmt .Sprintf ("%x" , b )
256
256
}
257
257
258
- func defaultOperationName (ctx echo.Context ) string {
259
- req := ctx .Request ()
260
- return "HTTP " + req .Method + " URL: " + ctx .Path ()
258
+ func defaultOperationName (c echo.Context ) string {
259
+ req := c .Request ()
260
+ return "HTTP " + req .Method + " URL: " + c .Path ()
261
261
}
262
262
263
263
// TraceFunction wraps funtion with opentracing span adding tags for the function name and caller details
Original file line number Diff line number Diff line change @@ -354,21 +354,21 @@ func TestTraceWithCustomOperationName(t *testing.T) {
354
354
e .Use (TraceWithConfig (TraceConfig {
355
355
Tracer : tracer ,
356
356
ComponentName : "EchoTracer" ,
357
- OperationNameFunc : func (ctx echo.Context ) string {
357
+ OperationNameFunc : func (c echo.Context ) string {
358
358
// This is an example of operation name customization
359
359
// In most cases default formatting is more than enough
360
- req := ctx .Request ()
360
+ req := c .Request ()
361
361
opName := "HTTP " + req .Method
362
362
363
- path := ctx .Path ()
364
- paramNames := ctx .ParamNames ()
363
+ path := c .Path ()
364
+ paramNames := c .ParamNames ()
365
365
366
366
for _ , name := range paramNames {
367
367
from := ":" + name
368
368
to := "{" + name + "}"
369
369
path = strings .ReplaceAll (path , from , to )
370
370
}
371
-
371
+
372
372
return opName + " " + path
373
373
},
374
374
}))
You can’t perform that action at this time.
0 commit comments