@opentelemetry/exporter-zipkin 0.26.0 → 1.1.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.
Files changed (52) hide show
  1. package/README.md +0 -6
  2. package/build/src/index.js.map +1 -1
  3. package/build/src/platform/browser/index.js.map +1 -1
  4. package/build/src/platform/browser/util.js +2 -2
  5. package/build/src/platform/browser/util.js.map +1 -1
  6. package/build/src/platform/index.js.map +1 -1
  7. package/build/src/platform/node/index.js.map +1 -1
  8. package/build/src/platform/node/util.js.map +1 -1
  9. package/build/src/transform.d.ts +4 -4
  10. package/build/src/transform.js +14 -12
  11. package/build/src/transform.js.map +1 -1
  12. package/build/src/types.js.map +1 -1
  13. package/build/src/utils.js.map +1 -1
  14. package/build/src/version.d.ts +1 -1
  15. package/build/src/version.js +1 -1
  16. package/build/src/version.js.map +1 -1
  17. package/build/src/zipkin.js +6 -6
  18. package/build/src/zipkin.js.map +1 -1
  19. package/package.json +27 -22
  20. package/build/esm/index.d.ts +0 -4
  21. package/build/esm/index.js +0 -18
  22. package/build/esm/index.js.map +0 -1
  23. package/build/esm/platform/browser/index.d.ts +0 -2
  24. package/build/esm/platform/browser/index.js +0 -17
  25. package/build/esm/platform/browser/index.js.map +0 -1
  26. package/build/esm/platform/browser/util.d.ts +0 -9
  27. package/build/esm/platform/browser/util.js +0 -114
  28. package/build/esm/platform/browser/util.js.map +0 -1
  29. package/build/esm/platform/index.d.ts +0 -2
  30. package/build/esm/platform/index.js +0 -17
  31. package/build/esm/platform/index.js.map +0 -1
  32. package/build/esm/platform/node/index.d.ts +0 -2
  33. package/build/esm/platform/node/index.js +0 -17
  34. package/build/esm/platform/node/index.js.map +0 -1
  35. package/build/esm/platform/node/util.d.ts +0 -9
  36. package/build/esm/platform/node/util.js +0 -87
  37. package/build/esm/platform/node/util.js.map +0 -1
  38. package/build/esm/transform.d.ts +0 -18
  39. package/build/esm/transform.js +0 -74
  40. package/build/esm/transform.js.map +0 -1
  41. package/build/esm/types.d.ts +0 -158
  42. package/build/esm/types.js +0 -45
  43. package/build/esm/types.js.map +0 -1
  44. package/build/esm/utils.d.ts +0 -3
  45. package/build/esm/utils.js +0 -6
  46. package/build/esm/utils.js.map +0 -1
  47. package/build/esm/version.d.ts +0 -2
  48. package/build/esm/version.js +0 -18
  49. package/build/esm/version.js.map +0 -1
  50. package/build/esm/zipkin.d.ts +0 -38
  51. package/build/esm/zipkin.js +0 -120
  52. package/build/esm/zipkin.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/platform/browser/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,OAAgC;IAC1E,IAAI,UAAkC,CAAC;IACvC,IAAM,SAAS,GAAG,OAAO,SAAS,CAAC,UAAU,KAAK,UAAU,IAAI,CAAC,OAAO,CAAC;IACzE,IAAI,OAAO,EAAE;QACX,UAAU,cACR,MAAM,EAAE,kBAAkB,EAC1B,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACX,CAAC;KACH;IAED;;OAEG;IACH,OAAO,SAAS,IAAI,CAClB,WAA+B,EAC/B,IAAoC;QAEpC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;SACjD;QACD,IAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAC5C,IAAI,SAAS,EAAE;YACb,cAAc,CAAC,OAAO,EAAE,IAAI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ExE,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE;gBACzC,OAAO,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;aACjD;iBAAM;gBACL,OAAO,IAAI,CAAC;oBACV,IAAI,EAAE,gBAAgB,CAAC,MAAM;oBAC7B,KAAK,EAAE,IAAI,KAAK,CACd,6CAA2C,GAAG,CAAC,MAAQ,CACxD;iBACF,CAAC,CAAC;aACJ;SACF;IACH,CAAC,CAAC;IAEF,GAAG,CAAC,OAAO,GAAG,UAAA,GAAG;QACf,kBAAkB,CAAC,IAAI,KAAK,CAAC,2BAAyB,GAAK,CAAC,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF,kCAAkC;IAClC,IAAI,CAAC,KAAK,CAAC,6BAA2B,IAAM,CAAC,CAAC;IAC9C,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './node';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,17 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export * from './node';
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,QAAQ,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './util';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,17 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export * from './util';
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,QAAQ,CAAC"}
@@ -1,9 +0,0 @@
1
- import * as zipkinTypes from '../../types';
2
- /**
3
- * Prepares send function that will send spans to the remote Zipkin service.
4
- * @param urlStr - url to send spans
5
- * @param headers - headers
6
- * send
7
- */
8
- export declare function prepareSend(urlStr: string, headers?: Record<string, string>): zipkinTypes.SendFn;
9
- //# sourceMappingURL=util.d.ts.map
@@ -1,87 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- var __assign = (this && this.__assign) || function () {
17
- __assign = Object.assign || function(t) {
18
- for (var s, i = 1, n = arguments.length; i < n; i++) {
19
- s = arguments[i];
20
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
- t[p] = s[p];
22
- }
23
- return t;
24
- };
25
- return __assign.apply(this, arguments);
26
- };
27
- import { diag } from '@opentelemetry/api';
28
- import { ExportResultCode } from '@opentelemetry/core';
29
- import * as http from 'http';
30
- import * as https from 'https';
31
- import * as url from 'url';
32
- /**
33
- * Prepares send function that will send spans to the remote Zipkin service.
34
- * @param urlStr - url to send spans
35
- * @param headers - headers
36
- * send
37
- */
38
- export function prepareSend(urlStr, headers) {
39
- var urlOpts = url.parse(urlStr);
40
- var reqOpts = Object.assign({
41
- method: 'POST',
42
- headers: __assign({ 'Content-Type': 'application/json' }, headers),
43
- }, urlOpts);
44
- /**
45
- * Send spans to the remote Zipkin service.
46
- */
47
- return function send(zipkinSpans, done) {
48
- if (zipkinSpans.length === 0) {
49
- diag.debug('Zipkin send with empty spans');
50
- return done({ code: ExportResultCode.SUCCESS });
51
- }
52
- var request = (reqOpts.protocol === 'http:' ? http : https).request;
53
- var req = request(reqOpts, function (res) {
54
- var rawData = '';
55
- res.on('data', function (chunk) {
56
- rawData += chunk;
57
- });
58
- res.on('end', function () {
59
- var statusCode = res.statusCode || 0;
60
- diag.debug("Zipkin response status code: " + statusCode + ", body: " + rawData);
61
- // Consider 2xx and 3xx as success.
62
- if (statusCode < 400) {
63
- return done({ code: ExportResultCode.SUCCESS });
64
- // Consider 4xx as failed non-retriable.
65
- }
66
- else {
67
- return done({
68
- code: ExportResultCode.FAILED,
69
- error: new Error("Got unexpected status code from zipkin: " + statusCode),
70
- });
71
- }
72
- });
73
- });
74
- req.on('error', function (error) {
75
- return done({
76
- code: ExportResultCode.FAILED,
77
- error: error,
78
- });
79
- });
80
- // Issue request to remote service
81
- var payload = JSON.stringify(zipkinSpans);
82
- diag.debug("Zipkin request payload: " + payload);
83
- req.write(payload, 'utf8');
84
- req.end();
85
- };
86
- }
87
- //# sourceMappingURL=util.js.map
@@ -1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YACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE;gBACZ,IAAM,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,CAAC,CAAC;gBACvC,IAAI,CAAC,KAAK,CAAC,kCAAgC,UAAU,gBAAW,OAAS,CAAC,CAAC;gBAE3E,mCAAmC;gBACnC,IAAI,UAAU,GAAG,GAAG,EAAE;oBACpB,OAAO,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;oBAChD,wCAAwC;iBACzC;qBAAM;oBACL,OAAO,IAAI,CAAC;wBACV,IAAI,EAAE,gBAAgB,CAAC,MAAM;wBAC7B,KAAK,EAAE,IAAI,KAAK,CACd,6CAA2C,UAAY,CACxD;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,UAAA,KAAK;YACnB,OAAO,IAAI,CAAC;gBACV,IAAI,EAAE,gBAAgB,CAAC,MAAM;gBAC7B,KAAK,OAAA;aACN,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,kCAAkC;QAClC,IAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK,CAAC,6BAA2B,OAAS,CAAC,CAAC;QACjD,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3B,GAAG,CAAC,GAAG,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC"}
@@ -1,18 +0,0 @@
1
- import * as api from '@opentelemetry/api';
2
- import { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
3
- import * as zipkinTypes from './types';
4
- import { Resource } from '@opentelemetry/resources';
5
- export declare const defaultStatusCodeTagName = "ot.status_code";
6
- export declare const defaultStatusDescriptionTagName = "ot.status_description";
7
- /**
8
- * Translate OpenTelemetry ReadableSpan to ZipkinSpan format
9
- * @param span Span to be translated
10
- */
11
- export declare function toZipkinSpan(span: ReadableSpan, serviceName: string, statusCodeTagName: string, statusDescriptionTagName: string): zipkinTypes.Span;
12
- /** Converts OpenTelemetry SpanAttributes and SpanStatus to Zipkin Tags format. */
13
- export declare function _toZipkinTags(attributes: api.SpanAttributes, status: api.SpanStatus, statusCodeTagName: string, statusDescriptionTagName: string, resource: Resource): zipkinTypes.Tags;
14
- /**
15
- * Converts OpenTelemetry Events to Zipkin Annotations format.
16
- */
17
- export declare function _toZipkinAnnotations(events: TimedEvent[]): zipkinTypes.Annotation[];
18
- //# sourceMappingURL=transform.d.ts.map
@@ -1,74 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- var _a;
17
- import * as api from '@opentelemetry/api';
18
- import { hrTimeToMicroseconds } from '@opentelemetry/core';
19
- import * as zipkinTypes from './types';
20
- var ZIPKIN_SPAN_KIND_MAPPING = (_a = {},
21
- _a[api.SpanKind.CLIENT] = zipkinTypes.SpanKind.CLIENT,
22
- _a[api.SpanKind.SERVER] = zipkinTypes.SpanKind.SERVER,
23
- _a[api.SpanKind.CONSUMER] = zipkinTypes.SpanKind.CONSUMER,
24
- _a[api.SpanKind.PRODUCER] = zipkinTypes.SpanKind.PRODUCER,
25
- // When absent, the span is local.
26
- _a[api.SpanKind.INTERNAL] = undefined,
27
- _a);
28
- export var defaultStatusCodeTagName = 'ot.status_code';
29
- export var defaultStatusDescriptionTagName = 'ot.status_description';
30
- /**
31
- * Translate OpenTelemetry ReadableSpan to ZipkinSpan format
32
- * @param span Span to be translated
33
- */
34
- export function toZipkinSpan(span, serviceName, statusCodeTagName, statusDescriptionTagName) {
35
- var zipkinSpan = {
36
- traceId: span.spanContext().traceId,
37
- parentId: span.parentSpanId,
38
- name: span.name,
39
- id: span.spanContext().spanId,
40
- kind: ZIPKIN_SPAN_KIND_MAPPING[span.kind],
41
- timestamp: hrTimeToMicroseconds(span.startTime),
42
- duration: hrTimeToMicroseconds(span.duration),
43
- localEndpoint: { serviceName: serviceName },
44
- tags: _toZipkinTags(span.attributes, span.status, statusCodeTagName, statusDescriptionTagName, span.resource),
45
- annotations: span.events.length
46
- ? _toZipkinAnnotations(span.events)
47
- : undefined,
48
- };
49
- return zipkinSpan;
50
- }
51
- /** Converts OpenTelemetry SpanAttributes and SpanStatus to Zipkin Tags format. */
52
- export function _toZipkinTags(attributes, status, statusCodeTagName, statusDescriptionTagName, resource) {
53
- var tags = {};
54
- for (var _i = 0, _a = Object.keys(attributes); _i < _a.length; _i++) {
55
- var key = _a[_i];
56
- tags[key] = String(attributes[key]);
57
- }
58
- tags[statusCodeTagName] = String(api.SpanStatusCode[status.code]);
59
- if (status.message) {
60
- tags[statusDescriptionTagName] = status.message;
61
- }
62
- Object.keys(resource.attributes).forEach(function (name) { return (tags[name] = String(resource.attributes[name])); });
63
- return tags;
64
- }
65
- /**
66
- * Converts OpenTelemetry Events to Zipkin Annotations format.
67
- */
68
- export function _toZipkinAnnotations(events) {
69
- return events.map(function (event) { return ({
70
- timestamp: hrTimeToMicroseconds(event.time),
71
- value: event.name,
72
- }); });
73
- }
74
- //# sourceMappingURL=transform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../src/transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAEH,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,W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CAAC,CAAC;AACN,CAAC"}
@@ -1,158 +0,0 @@
1
- import { ExportResult } from '@opentelemetry/core';
2
- /**
3
- * Exporter config
4
- */
5
- export interface ExporterConfig {
6
- headers?: Record<string, string>;
7
- serviceName?: string;
8
- url?: string;
9
- statusCodeTagName?: string;
10
- statusDescriptionTagName?: string;
11
- getExportRequestHeaders?: () => Record<string, string> | undefined;
12
- }
13
- /**
14
- * Zipkin Span
15
- * @see https://github.com/openzipkin/zipkin-api/blob/master/zipkin2-api.yaml
16
- */
17
- export interface Span {
18
- /**
19
- * Trace identifier, set on all spans within it.
20
- */
21
- traceId: string;
22
- /**
23
- * The logical operation this span represents in lowercase (e.g. rpc method).
24
- * Leave absent if unknown.
25
- */
26
- name: string;
27
- /**
28
- * The parent span ID or absent if this the root span in a trace.
29
- */
30
- parentId?: string;
31
- /**
32
- * Unique 64bit identifier for this operation within the trace.
33
- */
34
- id: string;
35
- /**
36
- * When present, kind clarifies timestamp, duration and remoteEndpoint.
37
- * When absent, the span is local or incomplete.
38
- */
39
- kind?: SpanKind;
40
- /**
41
- * Epoch microseconds of the start of this span, possibly absent if
42
- * incomplete.
43
- */
44
- timestamp: number;
45
- /**
46
- * Duration in microseconds of the critical path, if known.
47
- */
48
- duration: number;
49
- /**
50
- * True is a request to store this span even if it overrides sampling policy.
51
- * This is true when the `X-B3-Flags` header has a value of 1.
52
- */
53
- debug?: boolean;
54
- /**
55
- * True if we are contributing to a span started by another tracer (ex on a
56
- * different host).
57
- */
58
- shared?: boolean;
59
- /**
60
- * The host that recorded this span, primarily for query by service name.
61
- */
62
- localEndpoint: Endpoint;
63
- /**
64
- * Associates events that explain latency with the time they happened.
65
- */
66
- annotations?: Annotation[];
67
- /**
68
- * Tags give your span context for search, viewing and analysis.
69
- */
70
- tags: Tags;
71
- }
72
- /**
73
- * Associates an event that explains latency with a timestamp.
74
- * Unlike log statements, annotations are often codes. Ex. "ws" for WireSend
75
- * Zipkin v1 core annotations such as "cs" and "sr" have been replaced with
76
- * Span.Kind, which interprets timestamp and duration.
77
- */
78
- export interface Annotation {
79
- /**
80
- * Epoch microseconds of this event.
81
- * For example, 1502787600000000 corresponds to 2017-08-15 09:00 UTC
82
- */
83
- timestamp: number;
84
- /**
85
- * Usually a short tag indicating an event, like "error"
86
- * While possible to add larger data, such as garbage collection details, low
87
- * cardinality event names both keep the size of spans down and also are easy
88
- * to search against.
89
- */
90
- value: string;
91
- }
92
- /**
93
- * The network context of a node in the service graph.
94
- */
95
- export interface Endpoint {
96
- /**
97
- * Lower-case label of this node in the service graph, such as "favstar".
98
- * Leave absent if unknown.
99
- * This is a primary label for trace lookup and aggregation, so it should be
100
- * intuitive and consistent. Many use a name from service discovery.
101
- */
102
- serviceName?: string;
103
- /**
104
- * The text representation of the primary IPv4 address associated with this
105
- * connection. Ex. 192.168.99.100 Absent if unknown.
106
- */
107
- ipv4?: string;
108
- /**
109
- * The text representation of the primary IPv6 address associated with a
110
- * connection. Ex. 2001:db8::c001 Absent if unknown.
111
- * Prefer using the ipv4 field for mapped addresses.
112
- */
113
- port?: number;
114
- }
115
- /**
116
- * Adds context to a span, for search, viewing and analysis.
117
- * For example, a key "your_app.version" would let you lookup traces by version.
118
- * A tag "sql.query" isn't searchable, but it can help in debugging when viewing
119
- * a trace.
120
- */
121
- export interface Tags {
122
- [tagKey: string]: unknown;
123
- }
124
- /**
125
- * When present, kind clarifies timestamp, duration and remoteEndpoint. When
126
- * absent, the span is local or incomplete. Unlike client and server, there
127
- * is no direct critical path latency relationship between producer and
128
- * consumer spans.
129
- * `CLIENT`
130
- * timestamp is the moment a request was sent to the server.
131
- * duration is the delay until a response or an error was received.
132
- * remoteEndpoint is the server.
133
- * `SERVER`
134
- * timestamp is the moment a client request was received.
135
- * duration is the delay until a response was sent or an error.
136
- * remoteEndpoint is the client.
137
- * `PRODUCER`
138
- * timestamp is the moment a message was sent to a destination.
139
- * duration is the delay sending the message, such as batching.
140
- * remoteEndpoint is the broker.
141
- * `CONSUMER`
142
- * timestamp is the moment a message was received from an origin.
143
- * duration is the delay consuming the message, such as from backlog.
144
- * remoteEndpoint - Represents the broker. Leave serviceName absent if unknown.
145
- */
146
- export declare enum SpanKind {
147
- CLIENT = "CLIENT",
148
- SERVER = "SERVER",
149
- CONSUMER = "CONSUMER",
150
- PRODUCER = "PRODUCER"
151
- }
152
- /**
153
- * interface for function that will send zipkin spans
154
- */
155
- export declare type SendFunction = (zipkinSpans: Span[], done: (result: ExportResult) => void) => void;
156
- export declare type GetHeaders = () => Record<string, string> | undefined;
157
- export declare type SendFn = (zipkinSpans: Span[], done: (result: ExportResult) => void) => void;
158
- //# sourceMappingURL=types.d.ts.map
@@ -1,45 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * When present, kind clarifies timestamp, duration and remoteEndpoint. When
18
- * absent, the span is local or incomplete. Unlike client and server, there
19
- * is no direct critical path latency relationship between producer and
20
- * consumer spans.
21
- * `CLIENT`
22
- * timestamp is the moment a request was sent to the server.
23
- * duration is the delay until a response or an error was received.
24
- * remoteEndpoint is the server.
25
- * `SERVER`
26
- * timestamp is the moment a client request was received.
27
- * duration is the delay until a response was sent or an error.
28
- * remoteEndpoint is the client.
29
- * `PRODUCER`
30
- * timestamp is the moment a message was sent to a destination.
31
- * duration is the delay sending the message, such as batching.
32
- * remoteEndpoint is the broker.
33
- * `CONSUMER`
34
- * timestamp is the moment a message was received from an origin.
35
- * duration is the delay consuming the message, such as from backlog.
36
- * remoteEndpoint - Represents the broker. Leave serviceName absent if unknown.
37
- */
38
- export var SpanKind;
39
- (function (SpanKind) {
40
- SpanKind["CLIENT"] = "CLIENT";
41
- SpanKind["SERVER"] = "SERVER";
42
- SpanKind["CONSUMER"] = "CONSUMER";
43
- SpanKind["PRODUCER"] = "PRODUCER";
44
- })(SpanKind || (SpanKind = {}));
45
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAyIH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;IACjB,iCAAqB,CAAA;IACrB,iCAAqB,CAAA;AACvB,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB"}
@@ -1,3 +0,0 @@
1
- import { GetHeaders } from './types';
2
- export declare function prepareGetHeaders(getExportRequestHeaders: GetHeaders): () => Record<string, string> | undefined;
3
- //# sourceMappingURL=utils.d.ts.map
@@ -1,6 +0,0 @@
1
- export function prepareGetHeaders(getExportRequestHeaders) {
2
- return function () {
3
- return getExportRequestHeaders();
4
- };
5
- }
6
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAiBA,MAAM,UAAU,iBAAiB,CAC/B,uBAAmC;IAEnC,OAAO;QACL,OAAO,uBAAuB,EAAE,CAAC;IACnC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const VERSION = "0.26.0";
2
- //# sourceMappingURL=version.d.ts.map
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- // this is autogenerated file, see scripts/version-update.js
17
- export var VERSION = '0.26.0';
18
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC"}
@@ -1,38 +0,0 @@
1
- import { ExportResult } from '@opentelemetry/core';
2
- import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
3
- import * as zipkinTypes from './types';
4
- /**
5
- * Zipkin Exporter
6
- */
7
- export declare class ZipkinExporter implements SpanExporter {
8
- private readonly DEFAULT_SERVICE_NAME;
9
- private readonly _statusCodeTagName;
10
- private readonly _statusDescriptionTagName;
11
- private _urlStr;
12
- private _send;
13
- private _getHeaders;
14
- private _serviceName?;
15
- private _isShutdown;
16
- private _sendingPromises;
17
- constructor(config?: zipkinTypes.ExporterConfig);
18
- /**
19
- * Export spans.
20
- */
21
- export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void;
22
- /**
23
- * Shutdown exporter. Noop operation in this exporter.
24
- */
25
- shutdown(): Promise<void>;
26
- /**
27
- * if user defines getExportRequestHeaders in config then this will be called
28
- * everytime before send, otherwise it will be replaced with noop in
29
- * constructor
30
- * @default noop
31
- */
32
- private _beforeSend;
33
- /**
34
- * Transform spans and sends to Zipkin service.
35
- */
36
- private _sendSpans;
37
- }
38
- //# sourceMappingURL=zipkin.d.ts.map