From 19617c1ad9775e23ee56749c4a3620a3e6f6d207 Mon Sep 17 00:00:00 2001 From: GuangWong Date: Tue, 11 Dec 2018 17:35:01 +0800 Subject: [PATCH] fix: add hasOwnProperty check --- packages/metrics/src/common/MetricName.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/metrics/src/common/MetricName.ts b/packages/metrics/src/common/MetricName.ts index eee3852b..86463e63 100644 --- a/packages/metrics/src/common/MetricName.ts +++ b/packages/metrics/src/common/MetricName.ts @@ -176,7 +176,9 @@ export class MetricName { let tagsArr = []; for(let key in this.tags) { - tagsArr.push(key + MetricName.TAGS_CONCAT + this.tags[key]); + if(this.tags.hasOwnProperty(key)) { + tagsArr.push(key + MetricName.TAGS_CONCAT + this.tags[key]); + } } tagsArr.sort();