From 1ce8a899cf2af1790787e48dad36769fe3af7b0d Mon Sep 17 00:00:00 2001 From: Jackson Weber <47067795+JacksonWeber@users.noreply.github.com> Date: Mon, 3 Jul 2023 04:34:35 -0700 Subject: [PATCH] Update the Prometheus Exporter to by Default not Append Timestamp (#3961) --- CHANGELOG.md | 1 + .../src/PrometheusExporter.ts | 2 +- .../src/PrometheusSerializer.ts | 2 +- .../test/PrometheusExporter.test.ts | 68 ++++----- .../test/PrometheusSerializer.test.ts | 141 +++++++++--------- 5 files changed, 106 insertions(+), 108 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 865601c10d..7de3dc1f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :bug: (Bug Fix) +* fix(opentelemetry-exporter-prometheus): Update default PrometheusExporter to not append a timestamp to match the text based exposition format [#3961](https://github.com/open-telemetry/opentelemetry-js/pull/3961) @JacksonWeber * fix(sdk-metrics): Update default Histogram's boundary to match OTEL's spec [#3893](https://github.com/open-telemetry/opentelemetry-js/pull/3893/) @chigia001 * fix(sdk-metrics): preserve startTime for cumulative ExponentialHistograms [#3934](https://github.com/open-telemetry/opentelemetry-js/pull/3934/) @aabmass diff --git a/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusExporter.ts b/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusExporter.ts index 2a7cb5fb43..8f84c5134c 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusExporter.ts +++ b/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusExporter.ts @@ -33,7 +33,7 @@ export class PrometheusExporter extends MetricReader { port: 9464, endpoint: '/metrics', prefix: '', - appendTimestamp: true, + appendTimestamp: false, }; private readonly _host?: string; diff --git a/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts b/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts index 75b29bb61b..7dc424a2b7 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts +++ b/experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts @@ -176,7 +176,7 @@ export class PrometheusSerializer { private _prefix: string | undefined; private _appendTimestamp: boolean; - constructor(prefix?: string, appendTimestamp = true) { + constructor(prefix?: string, appendTimestamp = false) { if (prefix) { this._prefix = prefix + '_'; } diff --git a/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts b/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts index 292ad3db1e..b4c6f0ade0 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts +++ b/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts @@ -21,12 +21,12 @@ import * as sinon from 'sinon'; import * as http from 'http'; import { PrometheusExporter } from '../src'; import { - mockedHrTimeMs, mockHrTime, sdkLanguage, sdkName, sdkVersion, serviceName, + mockedHrTimeMs, } from './util'; import { SinonStubbedInstance } from 'sinon'; @@ -290,7 +290,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP counter_total a test description', '# TYPE counter_total counter', - `counter_total{key1="attributeValue1"} 10 ${mockedHrTimeMs}`, + 'counter_total{key1="attributeValue1"} 10', '', ]); }); @@ -320,7 +320,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP metric_observable_gauge a test description', '# TYPE metric_observable_gauge gauge', - `metric_observable_gauge{pid="123",core="1"} 0.999 ${mockedHrTimeMs}`, + 'metric_observable_gauge{pid="123",core="1"} 0.999', '', ]); }); @@ -340,8 +340,8 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP counter_total a test description', '# TYPE counter_total counter', - `counter_total{counterKey1="attributeValue1"} 10 ${mockedHrTimeMs}`, - `counter_total{counterKey1="attributeValue2"} 20 ${mockedHrTimeMs}`, + 'counter_total{counterKey1="attributeValue1"} 10', + 'counter_total{counterKey1="attributeValue2"} 20', '', ]); }); @@ -389,7 +389,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP counter_total description missing', '# TYPE counter_total counter', - `counter_total{key1="attributeValue1"} 10 ${mockedHrTimeMs}`, + 'counter_total{key1="attributeValue1"} 10', '', ]); }); @@ -406,7 +406,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP counter_bad_name_total description missing', '# TYPE counter_bad_name_total counter', - `counter_bad_name_total{key1="attributeValue1"} 10 ${mockedHrTimeMs}`, + 'counter_bad_name_total{key1="attributeValue1"} 10', '', ]); }); @@ -424,7 +424,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP counter a test description', '# TYPE counter gauge', - `counter{key1="attributeValue1"} 20 ${mockedHrTimeMs}`, + 'counter{key1="attributeValue1"} 20', '', ]); }); @@ -453,7 +453,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP metric_observable_counter a test description', '# TYPE metric_observable_counter counter', - `metric_observable_counter{key1="attributeValue1"} 20 ${mockedHrTimeMs}`, + 'metric_observable_counter{key1="attributeValue1"} 20', '', ]); }); @@ -484,7 +484,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP metric_observable_up_down_counter a test description', '# TYPE metric_observable_up_down_counter gauge', - `metric_observable_up_down_counter{key1="attributeValue1"} 20 ${mockedHrTimeMs}`, + 'metric_observable_up_down_counter{key1="attributeValue1"} 20', '', ]); }); @@ -503,24 +503,24 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP test_histogram a test description', '# TYPE test_histogram histogram', - `test_histogram_count{key1="attributeValue1"} 1 ${mockedHrTimeMs}`, - `test_histogram_sum{key1="attributeValue1"} 20 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="0"} 0 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="5"} 0 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="10"} 0 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="25"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="50"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="75"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="100"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="250"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="500"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="750"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="1000"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="2500"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="5000"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="7500"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="10000"} 1 ${mockedHrTimeMs}`, - `test_histogram_bucket{key1="attributeValue1",le="+Inf"} 1 ${mockedHrTimeMs}`, + 'test_histogram_count{key1="attributeValue1"} 1', + 'test_histogram_sum{key1="attributeValue1"} 20', + 'test_histogram_bucket{key1="attributeValue1",le="0"} 0', + 'test_histogram_bucket{key1="attributeValue1",le="5"} 0', + 'test_histogram_bucket{key1="attributeValue1",le="10"} 0', + 'test_histogram_bucket{key1="attributeValue1",le="25"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="50"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="75"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="100"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="250"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="500"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="750"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="1000"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="2500"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="5000"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="7500"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="10000"} 1', + 'test_histogram_bucket{key1="attributeValue1",le="+Inf"} 1', '', ]); }); @@ -562,7 +562,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP test_prefix_counter_total description missing', '# TYPE test_prefix_counter_total counter', - `test_prefix_counter_total{key1="attributeValue1"} 10 ${mockedHrTimeMs}`, + 'test_prefix_counter_total{key1="attributeValue1"} 10', '', ]); @@ -591,7 +591,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP counter_total description missing', '# TYPE counter_total counter', - `counter_total{key1="attributeValue1"} 10 ${mockedHrTimeMs}`, + 'counter_total{key1="attributeValue1"} 10', '', ]); @@ -620,7 +620,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP counter_total description missing', '# TYPE counter_total counter', - `counter_total{key1="attributeValue1"} 10 ${mockedHrTimeMs}`, + 'counter_total{key1="attributeValue1"} 10', '', ]); @@ -632,10 +632,10 @@ describe('PrometheusExporter', () => { ); }); - it('should export a metric without timestamp', done => { + it('should export a metric with timestamp', done => { exporter = new PrometheusExporter( { - appendTimestamp: false, + appendTimestamp: true, }, async () => { setup(exporter); @@ -649,7 +649,7 @@ describe('PrometheusExporter', () => { ...serializedDefaultResourceLines, '# HELP counter_total description missing', '# TYPE counter_total counter', - 'counter_total{key1="attributeValue1"} 10', + `counter_total{key1="attributeValue1"} 10 ${mockedHrTimeMs}`, '', ]); diff --git a/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusSerializer.test.ts b/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusSerializer.test.ts index 5495ca0a8b..1a39aae003 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusSerializer.test.ts +++ b/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusSerializer.test.ts @@ -118,17 +118,17 @@ describe('PrometheusSerializer', () => { it('should serialize metrics with singular data type', async () => { const serializer = new PrometheusSerializer(); const result = await testSerializer(serializer); + assert.strictEqual(result, 'test_total{foo1="bar1",foo2="bar2"} 1\n'); + }); + + it('should serialize metrics with singular data type with timestamp', async () => { + const serializer = new PrometheusSerializer(undefined, true); + const result = await testSerializer(serializer); assert.strictEqual( result, `test_total{foo1="bar1",foo2="bar2"} 1 ${mockedHrTimeMs}\n` ); }); - - it('should serialize metrics with singular data type without timestamp', async () => { - const serializer = new PrometheusSerializer(undefined, false); - const result = await testSerializer(serializer); - assert.strictEqual(result, 'test_total{foo1="bar1",foo2="bar2"} 1\n'); - }); }); describe('Histogram', () => { @@ -168,20 +168,6 @@ describe('PrometheusSerializer', () => { it('should serialize metrics with histogram data type', async () => { const serializer = new PrometheusSerializer(); const result = await testSerializer(serializer); - assert.strictEqual( - result, - `test_count{foo1="bar1",foo2="bar2"} 1 ${mockedHrTimeMs}\n` + - `test_sum{foo1="bar1",foo2="bar2"} 5 ${mockedHrTimeMs}\n` + - `test_bucket{foo1="bar1",foo2="bar2",le="1"} 0 ${mockedHrTimeMs}\n` + - `test_bucket{foo1="bar1",foo2="bar2",le="10"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{foo1="bar1",foo2="bar2",le="100"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{foo1="bar1",foo2="bar2",le="+Inf"} 1 ${mockedHrTimeMs}\n` - ); - }); - - it('serialize metric record with sum aggregator without timestamp', async () => { - const serializer = new PrometheusSerializer(undefined, false); - const result = await testSerializer(serializer); assert.strictEqual( result, 'test_count{foo1="bar1",foo2="bar2"} 1\n' + @@ -192,6 +178,20 @@ describe('PrometheusSerializer', () => { 'test_bucket{foo1="bar1",foo2="bar2",le="+Inf"} 1\n' ); }); + + it('serialize metric record with sum aggregator with timestamp', async () => { + const serializer = new PrometheusSerializer(undefined, true); + const result = await testSerializer(serializer); + assert.strictEqual( + result, + `test_count{foo1="bar1",foo2="bar2"} 1 ${mockedHrTimeMs}\n` + + `test_sum{foo1="bar1",foo2="bar2"} 5 ${mockedHrTimeMs}\n` + + `test_bucket{foo1="bar1",foo2="bar2",le="1"} 0 ${mockedHrTimeMs}\n` + + `test_bucket{foo1="bar1",foo2="bar2",le="10"} 1 ${mockedHrTimeMs}\n` + + `test_bucket{foo1="bar1",foo2="bar2",le="100"} 1 ${mockedHrTimeMs}\n` + + `test_bucket{foo1="bar1",foo2="bar2",le="+Inf"} 1 ${mockedHrTimeMs}\n` + ); + }); }); }); @@ -233,20 +233,20 @@ describe('PrometheusSerializer', () => { result, '# HELP test_total foobar\n' + '# TYPE test_total counter\n' + - `test_total{val="1"} 1 ${mockedHrTimeMs}\n` + - `test_total{val="2"} 1 ${mockedHrTimeMs}\n` + 'test_total{val="1"} 1\n' + + 'test_total{val="2"} 1\n' ); }); - it('should serialize metric record without timestamp', async () => { - const serializer = new PrometheusSerializer(undefined, false); + it('should serialize metric record with timestamp', async () => { + const serializer = new PrometheusSerializer(undefined, true); const result = await testSerializer(serializer); assert.strictEqual( result, '# HELP test_total foobar\n' + '# TYPE test_total counter\n' + - 'test_total{val="1"} 1\n' + - 'test_total{val="2"} 1\n' + `test_total{val="1"} 1 ${mockedHrTimeMs}\n` + + `test_total{val="2"} 1 ${mockedHrTimeMs}\n` ); }); }); @@ -287,20 +287,20 @@ describe('PrometheusSerializer', () => { result, '# HELP test_total foobar\n' + '# TYPE test_total gauge\n' + - `test_total{val="1"} 1 ${mockedHrTimeMs}\n` + - `test_total{val="2"} 1 ${mockedHrTimeMs}\n` + 'test_total{val="1"} 1\n' + + 'test_total{val="2"} 1\n' ); }); - it('serialize metric record without timestamp', async () => { - const serializer = new PrometheusSerializer(undefined, false); + it('serialize metric record with timestamp', async () => { + const serializer = new PrometheusSerializer(undefined, true); const result = await testSerializer(serializer); assert.strictEqual( result, '# HELP test_total foobar\n' + '# TYPE test_total gauge\n' + - 'test_total{val="1"} 1\n' + - 'test_total{val="2"} 1\n' + `test_total{val="1"} 1 ${mockedHrTimeMs}\n` + + `test_total{val="2"} 1 ${mockedHrTimeMs}\n` ); }); }); @@ -341,20 +341,20 @@ describe('PrometheusSerializer', () => { result, '# HELP test_total foobar\n' + '# TYPE test_total gauge\n' + - `test_total{val="1"} 1 ${mockedHrTimeMs}\n` + - `test_total{val="2"} 1 ${mockedHrTimeMs}\n` + 'test_total{val="1"} 1\n' + + 'test_total{val="2"} 1\n' ); }); - it('serialize metric record without timestamp', async () => { - const serializer = new PrometheusSerializer(undefined, false); + it('serialize metric record with timestamp', async () => { + const serializer = new PrometheusSerializer(undefined, true); const result = await testSerializer(serializer); assert.strictEqual( result, '# HELP test_total foobar\n' + '# TYPE test_total gauge\n' + - 'test_total{val="1"} 1\n' + - 'test_total{val="2"} 1\n' + `test_total{val="1"} 1 ${mockedHrTimeMs}\n` + + `test_total{val="2"} 1 ${mockedHrTimeMs}\n` ); }); }); @@ -399,18 +399,18 @@ describe('PrometheusSerializer', () => { result, '# HELP test foobar\n' + '# TYPE test histogram\n' + - `test_count{val="1"} 3 ${mockedHrTimeMs}\n` + - `test_sum{val="1"} 175 ${mockedHrTimeMs}\n` + - `test_bucket{val="1",le="1"} 0 ${mockedHrTimeMs}\n` + - `test_bucket{val="1",le="10"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{val="1",le="100"} 2 ${mockedHrTimeMs}\n` + - `test_bucket{val="1",le="+Inf"} 3 ${mockedHrTimeMs}\n` + - `test_count{val="2"} 1 ${mockedHrTimeMs}\n` + - `test_sum{val="2"} 5 ${mockedHrTimeMs}\n` + - `test_bucket{val="2",le="1"} 0 ${mockedHrTimeMs}\n` + - `test_bucket{val="2",le="10"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{val="2",le="100"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{val="2",le="+Inf"} 1 ${mockedHrTimeMs}\n` + 'test_count{val="1"} 3\n' + + 'test_sum{val="1"} 175\n' + + 'test_bucket{val="1",le="1"} 0\n' + + 'test_bucket{val="1",le="10"} 1\n' + + 'test_bucket{val="1",le="100"} 2\n' + + 'test_bucket{val="1",le="+Inf"} 3\n' + + 'test_count{val="2"} 1\n' + + 'test_sum{val="2"} 5\n' + + 'test_bucket{val="2",le="1"} 0\n' + + 'test_bucket{val="2",le="10"} 1\n' + + 'test_bucket{val="2",le="100"} 1\n' + + 'test_bucket{val="2",le="+Inf"} 1\n' ); }); @@ -448,16 +448,16 @@ describe('PrometheusSerializer', () => { result, '# HELP test foobar\n' + '# TYPE test histogram\n' + - `test_count{val="1"} 3 ${mockedHrTimeMs}\n` + - `test_bucket{val="1",le="1"} 0 ${mockedHrTimeMs}\n` + - `test_bucket{val="1",le="10"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{val="1",le="100"} 2 ${mockedHrTimeMs}\n` + - `test_bucket{val="1",le="+Inf"} 3 ${mockedHrTimeMs}\n` + - `test_count{val="2"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{val="2",le="1"} 0 ${mockedHrTimeMs}\n` + - `test_bucket{val="2",le="10"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{val="2",le="100"} 1 ${mockedHrTimeMs}\n` + - `test_bucket{val="2",le="+Inf"} 1 ${mockedHrTimeMs}\n` + 'test_count{val="1"} 3\n' + + 'test_bucket{val="1",le="1"} 0\n' + + 'test_bucket{val="1",le="10"} 1\n' + + 'test_bucket{val="1",le="100"} 2\n' + + 'test_bucket{val="1",le="+Inf"} 3\n' + + 'test_count{val="2"} 1\n' + + 'test_bucket{val="2",le="1"} 0\n' + + 'test_bucket{val="2",le="10"} 1\n' + + 'test_bucket{val="2",le="100"} 1\n' + + 'test_bucket{val="2",le="+Inf"} 1\n' ); }); }); @@ -518,7 +518,7 @@ describe('PrometheusSerializer', () => { '# HELP test_total description missing\n' + `# UNIT test_total ${unitOfMetric}\n` + '# TYPE test_total counter\n' + - `test_total 1 ${mockedHrTimeMs}\n` + 'test_total 1\n' ); }); @@ -533,7 +533,7 @@ describe('PrometheusSerializer', () => { serializedDefaultResource + '# HELP test_total description missing\n' + '# TYPE test_total counter\n' + - `test_total 1 ${mockedHrTimeMs}\n` + 'test_total 1\n' ); }); @@ -541,14 +541,14 @@ describe('PrometheusSerializer', () => { const serializer = new PrometheusSerializer(); const result = await getCounterResult('test', serializer); - assert.strictEqual(result, `test_total 1 ${mockedHrTimeMs}\n`); + assert.strictEqual(result, 'test_total 1\n'); }); it('should not rename metric of type counter when name contains _total suffix', async () => { const serializer = new PrometheusSerializer(); const result = await getCounterResult('test_total', serializer); - assert.strictEqual(result, `test_total 1 ${mockedHrTimeMs}\n`); + assert.strictEqual(result, 'test_total 1\n'); }); }); @@ -594,7 +594,7 @@ describe('PrometheusSerializer', () => { counter.add(1); }); - assert.strictEqual(result, `test_total 1 ${mockedHrTimeMs}\n`); + assert.strictEqual(result, 'test_total 1\n'); }); it('should serialize non-string attribute values in JSON representations', async () => { @@ -615,7 +615,7 @@ describe('PrometheusSerializer', () => { assert.strictEqual( result, - `test_total{true="true",false="false",array="[1,null,null,2]",object="{}",Infinity="null",NaN="null",null="null",undefined=""} 1 ${mockedHrTimeMs}\n` + 'test_total{true="true",false="false",array="[1,null,null,2]",object="{}",Infinity="null",NaN="null",null="null",undefined=""} 1\n' ); }); @@ -634,7 +634,7 @@ describe('PrometheusSerializer', () => { assert.strictEqual( result, - `test{foo1="bar1",foo2="bar2"} ${esac[1]} ${mockedHrTimeMs}\n` + `test{foo1="bar1",foo2="bar2"} ${esac[1]}\n` ); } }); @@ -662,7 +662,7 @@ describe('PrometheusSerializer', () => { 'backslashN="\u005c\u005c\u006e",' + 'backslashDoubleQuote="\u005c\u005c\u005c\u0022",' + 'backslashLineFeed="\u005c\u005c\u005c\u006e"' + - `} 1 ${mockedHrTimeMs}\n` + '} 1\n' ); }); @@ -678,10 +678,7 @@ describe('PrometheusSerializer', () => { } as unknown as MetricAttributes); }); - assert.strictEqual( - result, - `test_total{account_id="123456"} 1 ${mockedHrTimeMs}\n` - ); + assert.strictEqual(result, 'test_total{account_id="123456"} 1\n'); }); });