From e9c92ec161b4069e4f47a88f6a37f8ce84b3ea87 Mon Sep 17 00:00:00 2001 From: Jin Wang Date: Tue, 19 Oct 2021 10:45:26 +0100 Subject: [PATCH] metrics: ss: skip tagging if no ss streamtypename --- lib/secure-streams/secure-streams.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c index 4f56bcdc5..53cdce00a 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -863,11 +863,12 @@ _lws_ss_client_connect(lws_ss_handle_t *h, int is_retry, void *conn_if_sspc_onw) #if defined(LWS_WITH_SYS_METRICS) /* possibly already hanging connect retry... */ - if (!h->cal_txn.mt) { + if (!h->cal_txn.mt) lws_metrics_caliper_bind(h->cal_txn, h->context->mth_ss_conn); - } - lws_metrics_tag_add(&h->cal_txn.mtags_owner, "ss", h->policy->streamtype); + if (h->policy->streamtype) + lws_metrics_tag_add(&h->cal_txn.mtags_owner, "ss", + h->policy->streamtype); #endif h->txn_ok = 0;