@redthreadlabs/tracelog 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +26 -0
- package/README.md +126 -0
- package/index.d.ts +464 -0
- package/index.js +11 -0
- package/lib/InflightEventSet.js +53 -0
- package/lib/activation-method.js +97 -0
- package/lib/agent.js +1226 -0
- package/lib/apm-client/apm-client.js +107 -0
- package/lib/apm-client/channel-writer.js +334 -0
- package/lib/apm-client/jsonl-file-client.js +241 -0
- package/lib/apm-client/ndjson.js +20 -0
- package/lib/apm-client/noop-apm-client.js +79 -0
- package/lib/apm-client/s3-uploader.js +308 -0
- package/lib/apm-client/truncate.js +507 -0
- package/lib/async-hooks-polyfill.js +58 -0
- package/lib/cloud-metadata/aws.js +175 -0
- package/lib/cloud-metadata/azure.js +123 -0
- package/lib/cloud-metadata/callback-coordination.js +159 -0
- package/lib/cloud-metadata/gcp.js +133 -0
- package/lib/cloud-metadata/index.js +175 -0
- package/lib/config/config.js +431 -0
- package/lib/config/normalizers.js +649 -0
- package/lib/config/schema.js +946 -0
- package/lib/constants.js +35 -0
- package/lib/errors.js +303 -0
- package/lib/filters/sanitize-field-names.js +69 -0
- package/lib/http-request.js +249 -0
- package/lib/instrumentation/context.js +56 -0
- package/lib/instrumentation/dropped-spans-stats.js +112 -0
- package/lib/instrumentation/elasticsearch-shared.js +63 -0
- package/lib/instrumentation/express-utils.js +91 -0
- package/lib/instrumentation/generic-span.js +322 -0
- package/lib/instrumentation/http-shared.js +424 -0
- package/lib/instrumentation/ids.js +39 -0
- package/lib/instrumentation/index.js +1078 -0
- package/lib/instrumentation/modules/@apollo/server.js +39 -0
- package/lib/instrumentation/modules/@aws-sdk/client-dynamodb.js +143 -0
- package/lib/instrumentation/modules/@aws-sdk/client-s3.js +230 -0
- package/lib/instrumentation/modules/@aws-sdk/client-sns.js +197 -0
- package/lib/instrumentation/modules/@aws-sdk/client-sqs.js +336 -0
- package/lib/instrumentation/modules/@elastic/elasticsearch.js +343 -0
- package/lib/instrumentation/modules/@hapi/hapi.js +221 -0
- package/lib/instrumentation/modules/@redis/client/dist/lib/client/commands-queue.js +178 -0
- package/lib/instrumentation/modules/@redis/client/dist/lib/client/index.js +49 -0
- package/lib/instrumentation/modules/@smithy/smithy-client.js +198 -0
- package/lib/instrumentation/modules/apollo-server-core.js +49 -0
- package/lib/instrumentation/modules/aws-sdk/dynamodb.js +155 -0
- package/lib/instrumentation/modules/aws-sdk/s3.js +184 -0
- package/lib/instrumentation/modules/aws-sdk/sns.js +232 -0
- package/lib/instrumentation/modules/aws-sdk/sqs.js +361 -0
- package/lib/instrumentation/modules/aws-sdk.js +76 -0
- package/lib/instrumentation/modules/bluebird.js +93 -0
- package/lib/instrumentation/modules/cassandra-driver.js +280 -0
- package/lib/instrumentation/modules/elasticsearch.js +200 -0
- package/lib/instrumentation/modules/express-graphql.js +66 -0
- package/lib/instrumentation/modules/express-queue.js +28 -0
- package/lib/instrumentation/modules/express.js +162 -0
- package/lib/instrumentation/modules/fastify.js +179 -0
- package/lib/instrumentation/modules/finalhandler.js +41 -0
- package/lib/instrumentation/modules/generic-pool.js +85 -0
- package/lib/instrumentation/modules/graphql.js +256 -0
- package/lib/instrumentation/modules/handlebars.js +33 -0
- package/lib/instrumentation/modules/http.js +112 -0
- package/lib/instrumentation/modules/http2.js +320 -0
- package/lib/instrumentation/modules/https.js +68 -0
- package/lib/instrumentation/modules/ioredis.js +94 -0
- package/lib/instrumentation/modules/jade.js +29 -0
- package/lib/instrumentation/modules/kafkajs.js +476 -0
- package/lib/instrumentation/modules/knex.js +91 -0
- package/lib/instrumentation/modules/koa-router.js +74 -0
- package/lib/instrumentation/modules/koa.js +15 -0
- package/lib/instrumentation/modules/memcached.js +100 -0
- package/lib/instrumentation/modules/mimic-response.js +45 -0
- package/lib/instrumentation/modules/mongodb/lib/cmap/connection_pool.js +40 -0
- package/lib/instrumentation/modules/mongodb-core.js +206 -0
- package/lib/instrumentation/modules/mongodb.js +259 -0
- package/lib/instrumentation/modules/mysql.js +200 -0
- package/lib/instrumentation/modules/mysql2.js +140 -0
- package/lib/instrumentation/modules/pg.js +148 -0
- package/lib/instrumentation/modules/pug.js +29 -0
- package/lib/instrumentation/modules/redis.js +176 -0
- package/lib/instrumentation/modules/restify.js +52 -0
- package/lib/instrumentation/modules/tedious.js +159 -0
- package/lib/instrumentation/modules/undici.js +270 -0
- package/lib/instrumentation/modules/ws.js +59 -0
- package/lib/instrumentation/noop-transaction.js +81 -0
- package/lib/instrumentation/run-context/AbstractRunContextManager.js +215 -0
- package/lib/instrumentation/run-context/AsyncHooksRunContextManager.js +106 -0
- package/lib/instrumentation/run-context/AsyncLocalStorageRunContextManager.js +73 -0
- package/lib/instrumentation/run-context/BasicRunContextManager.js +82 -0
- package/lib/instrumentation/run-context/RunContext.js +151 -0
- package/lib/instrumentation/run-context/index.js +23 -0
- package/lib/instrumentation/shimmer.js +123 -0
- package/lib/instrumentation/span-compression.js +239 -0
- package/lib/instrumentation/span.js +621 -0
- package/lib/instrumentation/template-shared.js +43 -0
- package/lib/instrumentation/timer.js +84 -0
- package/lib/instrumentation/transaction.js +571 -0
- package/lib/load-source-map.js +100 -0
- package/lib/logging.js +212 -0
- package/lib/metrics/index.js +92 -0
- package/lib/metrics/platforms/generic/index.js +40 -0
- package/lib/metrics/platforms/generic/process-cpu.js +22 -0
- package/lib/metrics/platforms/generic/process-top.js +157 -0
- package/lib/metrics/platforms/generic/stats.js +34 -0
- package/lib/metrics/platforms/generic/system-cpu.js +51 -0
- package/lib/metrics/platforms/linux/index.js +19 -0
- package/lib/metrics/platforms/linux/stats.js +213 -0
- package/lib/metrics/queue.js +90 -0
- package/lib/metrics/registry.js +52 -0
- package/lib/metrics/reporter.js +119 -0
- package/lib/metrics/runtime.js +77 -0
- package/lib/middleware/connect.js +16 -0
- package/lib/parsers.js +225 -0
- package/lib/propwrap.js +147 -0
- package/lib/stacktraces.js +537 -0
- package/lib/symbols.js +15 -0
- package/lib/tracecontext/index.js +115 -0
- package/lib/tracecontext/traceparent.js +185 -0
- package/lib/tracecontext/tracestate.js +388 -0
- package/lib/wildcard-matcher.js +52 -0
- package/loader.mjs +7 -0
- package/package.json +98 -0
- package/start.d.ts +8 -0
- package/start.js +29 -0
- package/types/aws-lambda.d.ts +98 -0
- package/types/connect.d.ts +23 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and other contributors where applicable.
|
|
3
|
+
* Licensed under the BSD 2-Clause License; you may not use this file except in
|
|
4
|
+
* compliance with the BSD 2-Clause License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This file is extracted from the 'shimmer' project copyright by Forrest L
|
|
11
|
+
* Norvell. It have been modified slightly to be used in the current context.
|
|
12
|
+
*
|
|
13
|
+
* https://github.com/othiym23/shimmer
|
|
14
|
+
*
|
|
15
|
+
* Original file:
|
|
16
|
+
*
|
|
17
|
+
* https://github.com/othiym23/shimmer/blob/master/index.js
|
|
18
|
+
*
|
|
19
|
+
* License:
|
|
20
|
+
*
|
|
21
|
+
* BSD-2-Clause, http://opensource.org/licenses/BSD-2-Clause
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
var symbols = require('../symbols');
|
|
25
|
+
|
|
26
|
+
var isWrappedSym = Symbol('elasticAPMIsWrapped');
|
|
27
|
+
|
|
28
|
+
exports.wrap = wrap;
|
|
29
|
+
exports.massWrap = massWrap;
|
|
30
|
+
exports.unwrap = unwrap;
|
|
31
|
+
|
|
32
|
+
// Do not load agent until used to avoid circular dependency issues.
|
|
33
|
+
var _agent;
|
|
34
|
+
function logger() {
|
|
35
|
+
if (!_agent) _agent = require('../../');
|
|
36
|
+
return _agent.logger;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isFunction(funktion) {
|
|
40
|
+
return typeof funktion === 'function';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function wrap(nodule, name, wrapper) {
|
|
44
|
+
if (!nodule || !nodule[name]) {
|
|
45
|
+
logger().debug('no original function %s to wrap', name);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!wrapper) {
|
|
50
|
+
logger().debug({ stack: new Error().stack }, 'no wrapper function');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!isFunction(nodule[name]) || !isFunction(wrapper)) {
|
|
55
|
+
logger().debug('original object and wrapper must be functions');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (nodule[name][isWrappedSym]) {
|
|
60
|
+
logger().debug('function %s already wrapped', name);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var desc = Object.getOwnPropertyDescriptor(nodule, name);
|
|
65
|
+
if (desc && !desc.writable) {
|
|
66
|
+
logger().debug('function %s is not writable', name);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var original = nodule[name];
|
|
71
|
+
var wrapped = wrapper(original, name);
|
|
72
|
+
|
|
73
|
+
wrapped[isWrappedSym] = true;
|
|
74
|
+
wrapped[symbols.unwrap] = function elasticAPMUnwrap() {
|
|
75
|
+
if (nodule[name] === wrapped) {
|
|
76
|
+
nodule[name] = original;
|
|
77
|
+
wrapped[isWrappedSym] = false;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
nodule[name] = wrapped;
|
|
82
|
+
|
|
83
|
+
return wrapped;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function massWrap(nodules, names, wrapper) {
|
|
87
|
+
if (!nodules) {
|
|
88
|
+
logger().debug(
|
|
89
|
+
{ stack: new Error().stack },
|
|
90
|
+
'must provide one or more modules to patch',
|
|
91
|
+
);
|
|
92
|
+
return;
|
|
93
|
+
} else if (!Array.isArray(nodules)) {
|
|
94
|
+
nodules = [nodules];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!(names && Array.isArray(names))) {
|
|
98
|
+
logger().debug('must provide one or more functions to wrap on modules');
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
for (const nodule of nodules) {
|
|
103
|
+
for (const name of names) {
|
|
104
|
+
wrap(nodule, name, wrapper);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function unwrap(nodule, name) {
|
|
110
|
+
if (!nodule || !nodule[name]) {
|
|
111
|
+
logger().debug({ stack: new Error().stack }, 'no function to unwrap');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!nodule[name][symbols.unwrap]) {
|
|
116
|
+
logger().debug(
|
|
117
|
+
'no original to unwrap to -- has %s already been unwrapped?',
|
|
118
|
+
name,
|
|
119
|
+
);
|
|
120
|
+
} else {
|
|
121
|
+
return nodule[name][symbols.unwrap]();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and other contributors where applicable.
|
|
3
|
+
* Licensed under the BSD 2-Clause License; you may not use this file except in
|
|
4
|
+
* compliance with the BSD 2-Clause License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
const STRATEGY_EXACT_MATCH = 'exact_match';
|
|
9
|
+
const STRATEGY_SAME_KIND = 'same_kind';
|
|
10
|
+
|
|
11
|
+
class SpanCompression {
|
|
12
|
+
constructor(agent) {
|
|
13
|
+
this._bufferedSpan = null;
|
|
14
|
+
this._agent = agent;
|
|
15
|
+
this.timestamp = null;
|
|
16
|
+
this.duration = 0;
|
|
17
|
+
this.composite = {
|
|
18
|
+
count: 0,
|
|
19
|
+
sum: 0,
|
|
20
|
+
compression_strategy: null,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
setBufferedSpan(span) {
|
|
25
|
+
this._bufferedSpan = span;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getBufferedSpan() {
|
|
29
|
+
return this._bufferedSpan;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Compares two spans and returns which compression strategy to use
|
|
33
|
+
// or returns false if the second span can't be compressed into the
|
|
34
|
+
// first.
|
|
35
|
+
//
|
|
36
|
+
// @param Span compositeSpan
|
|
37
|
+
// @param Span toCompressSpan
|
|
38
|
+
// @returns boolean|String
|
|
39
|
+
_getCompressionStrategy(compositeSpan, toCompressSpan) {
|
|
40
|
+
if (
|
|
41
|
+
!this._isEnabled() ||
|
|
42
|
+
!compositeSpan._serviceTarget ||
|
|
43
|
+
!toCompressSpan._serviceTarget
|
|
44
|
+
) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const isSameKind = this.isSameKind(compositeSpan, toCompressSpan);
|
|
49
|
+
|
|
50
|
+
if (!isSameKind) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let strategy = STRATEGY_SAME_KIND;
|
|
55
|
+
if (compositeSpan.name === toCompressSpan.name) {
|
|
56
|
+
strategy = STRATEGY_EXACT_MATCH;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return strategy;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
isSameKind(compositeSpan, toCompressSpan) {
|
|
63
|
+
return (
|
|
64
|
+
compositeSpan.type === toCompressSpan.type &&
|
|
65
|
+
compositeSpan.subtype === toCompressSpan.subtype &&
|
|
66
|
+
compositeSpan._serviceTarget.type ===
|
|
67
|
+
toCompressSpan._serviceTarget.type &&
|
|
68
|
+
compositeSpan._serviceTarget.name === toCompressSpan._serviceTarget.name
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Sets initial composite values or confirms strategy matches
|
|
73
|
+
//
|
|
74
|
+
// Returns true if spanToCompress can be compressed into compositeSpan,
|
|
75
|
+
// returns false otherwise.
|
|
76
|
+
//
|
|
77
|
+
// @param Span compositeSpan
|
|
78
|
+
// @param Span spanToCompress
|
|
79
|
+
// @returns boolean
|
|
80
|
+
_initCompressionStrategy(compositeSpan, spanToCompress) {
|
|
81
|
+
if (!this.composite.compression_strategy) {
|
|
82
|
+
// If no strategy is set, check if strategizable or not. If so,
|
|
83
|
+
// set initial values. If not, bail.
|
|
84
|
+
this.composite.compression_strategy = this._getCompressionStrategy(
|
|
85
|
+
compositeSpan,
|
|
86
|
+
spanToCompress,
|
|
87
|
+
);
|
|
88
|
+
if (!this.composite.compression_strategy) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// set initial composite context values
|
|
93
|
+
this.timestamp = compositeSpan.timestamp;
|
|
94
|
+
this.composite.count = 1;
|
|
95
|
+
this.composite.sum = compositeSpan._duration;
|
|
96
|
+
} else {
|
|
97
|
+
// if so, compare with the compression strat and bail if mismatch
|
|
98
|
+
const strat = this._getCompressionStrategy(compositeSpan, spanToCompress);
|
|
99
|
+
if (strat !== this.composite.compression_strategy) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Attempts to compression the second span into the first
|
|
108
|
+
//
|
|
109
|
+
// @param Span compositeSpan
|
|
110
|
+
// @param Span spanToCompress
|
|
111
|
+
// @return boolean
|
|
112
|
+
tryToCompress(compositeSpan, spanToCompress) {
|
|
113
|
+
if (!this._isEnabled()) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// sets initial compression strategy value. returns
|
|
118
|
+
// false if not compression eligable
|
|
119
|
+
if (!this._initCompressionStrategy(compositeSpan, spanToCompress)) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const isAlreadyComposite = this.isComposite();
|
|
124
|
+
const canBeCompressed = isAlreadyComposite
|
|
125
|
+
? this.tryToCompressComposite(compositeSpan, spanToCompress)
|
|
126
|
+
: this.tryToCompressRegular(compositeSpan, spanToCompress);
|
|
127
|
+
|
|
128
|
+
if (!canBeCompressed) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (!isAlreadyComposite) {
|
|
133
|
+
this.composite.count = 1;
|
|
134
|
+
this.composite.sum = compositeSpan._duration;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
this.composite.count++;
|
|
138
|
+
this.composite.sum += spanToCompress._duration;
|
|
139
|
+
this.duration =
|
|
140
|
+
(spanToCompress._endTimestamp - compositeSpan.timestamp) / 1000;
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
tryToCompressRegular(compositeSpan, spanToCompress) {
|
|
145
|
+
if (!this.isSameKind(compositeSpan, spanToCompress)) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (compositeSpan.name === spanToCompress.name) {
|
|
150
|
+
if (
|
|
151
|
+
this.duration <=
|
|
152
|
+
this._agent._conf.spanCompressionExactMatchMaxDuration * 1000 &&
|
|
153
|
+
spanToCompress._duration <=
|
|
154
|
+
this._agent._conf.spanCompressionExactMatchMaxDuration * 1000
|
|
155
|
+
) {
|
|
156
|
+
this.composite.compression_strategy = STRATEGY_EXACT_MATCH;
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (
|
|
163
|
+
this.duration <=
|
|
164
|
+
this._agent._conf.spanCompressionSameKindMaxDuration * 1000 &&
|
|
165
|
+
spanToCompress._duration <=
|
|
166
|
+
this._agent._conf.spanCompressionSameKindMaxDuration * 1000
|
|
167
|
+
) {
|
|
168
|
+
this.composite.compression_strategy = STRATEGY_SAME_KIND;
|
|
169
|
+
compositeSpan.name = this._spanNameFromCompositeSpan(compositeSpan);
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
tryToCompressComposite(compositeSpan, spanToCompress) {
|
|
177
|
+
switch (this.composite.compression_strategy) {
|
|
178
|
+
case STRATEGY_EXACT_MATCH:
|
|
179
|
+
return (
|
|
180
|
+
this.isSameKind(compositeSpan, spanToCompress) &&
|
|
181
|
+
compositeSpan.name === spanToCompress.name &&
|
|
182
|
+
spanToCompress._duration <=
|
|
183
|
+
this._agent._conf.spanCompressionExactMatchMaxDuration * 1000
|
|
184
|
+
);
|
|
185
|
+
case STRATEGY_SAME_KIND:
|
|
186
|
+
return (
|
|
187
|
+
this.isSameKind(compositeSpan, spanToCompress) &&
|
|
188
|
+
spanToCompress._duration <=
|
|
189
|
+
this._agent._conf.spanCompressionSameKindMaxDuration * 1000
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
_spanNameFromCompositeSpan(compositeSpan) {
|
|
195
|
+
const prefix = 'Calls to ';
|
|
196
|
+
const serviceTarget = compositeSpan._serviceTarget;
|
|
197
|
+
if (!serviceTarget.type) {
|
|
198
|
+
if (!serviceTarget.name) {
|
|
199
|
+
return prefix + 'unknown';
|
|
200
|
+
} else {
|
|
201
|
+
return prefix + serviceTarget.name;
|
|
202
|
+
}
|
|
203
|
+
} else if (!serviceTarget.name) {
|
|
204
|
+
return prefix + serviceTarget.type;
|
|
205
|
+
} else {
|
|
206
|
+
return prefix + serviceTarget.type + '/' + serviceTarget.name;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
_isEnabled() {
|
|
211
|
+
return this._agent._conf.spanCompressionEnabled;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
isCompositeSameKind() {
|
|
215
|
+
return this.composite.compression_strategy === STRATEGY_SAME_KIND;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
isComposite() {
|
|
219
|
+
return this.composite.count > 1;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Encodes/Serializes composite span properties
|
|
223
|
+
// @return Object
|
|
224
|
+
encode() {
|
|
225
|
+
return {
|
|
226
|
+
compression_strategy: this.composite.compression_strategy,
|
|
227
|
+
count: this.composite.count,
|
|
228
|
+
sum: this.composite.sum,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
module.exports = {
|
|
234
|
+
SpanCompression,
|
|
235
|
+
constants: {
|
|
236
|
+
STRATEGY_EXACT_MATCH,
|
|
237
|
+
STRATEGY_SAME_KIND,
|
|
238
|
+
},
|
|
239
|
+
};
|