From 96f27070bed3cd223e3b9eb27c6ec84db5f50d17 Mon Sep 17 00:00:00 2001 From: Nigel Deakin Date: Tue, 5 Dec 2017 18:26:28 +0000 Subject: [PATCH] More metrics (#561) * Add new spans to agent.submit * Add new spans to agent.submit * Add new spans to agent.submit * Add new spans to agent.submit --- api/agent/agent.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/agent/agent.go b/api/agent/agent.go index 7881552ae..e96e29c8d 100644 --- a/api/agent/agent.go +++ b/api/agent/agent.go @@ -196,8 +196,15 @@ func (a *agent) Submit(callI Call) error { call := callI.(*call) ctx := call.req.Context() + // start spans in the correct order so each span is given, and inherits, the correct baggage + span_global, ctx := opentracing.StartSpanFromContext(ctx, "agent_submit_global") + defer span_global.Finish() + + span_app, ctx := opentracing.StartSpanFromContext(ctx, "agent_submit_app") + span_app.SetBaggageItem("fn_appname", callI.Model().AppName) + defer span_app.Finish() + span, ctx := opentracing.StartSpanFromContext(ctx, "agent_submit") - span.SetBaggageItem("fn_appname", callI.Model().AppName) span.SetBaggageItem("fn_path", callI.Model().Path) defer span.Finish()