@azure/monitor-opentelemetry-exporter 1.0.0-beta.7 → 1.0.0-beta.8
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/dist/index.js +416 -181
- package/dist-esm/src/config.js.map +1 -1
- package/dist-esm/src/export/base.js +172 -0
- package/dist-esm/src/export/base.js.map +1 -0
- package/dist-esm/src/export/metric.js +50 -0
- package/dist-esm/src/export/metric.js.map +1 -0
- package/dist-esm/src/export/trace.js +14 -146
- package/dist-esm/src/export/trace.js.map +1 -1
- package/dist-esm/src/index.js +2 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/platform/nodejs/httpSender.js.map +1 -1
- package/dist-esm/src/platform/nodejs/persist/fileAccessControl.js.map +1 -1
- package/dist-esm/src/platform/nodejs/persist/fileSystemHelpers.js.map +1 -1
- package/dist-esm/src/platform/nodejs/persist/fileSystemPersist.js.map +1 -1
- package/dist-esm/src/utils/constants/applicationinsights.js +1 -1
- package/dist-esm/src/utils/constants/applicationinsights.js.map +1 -1
- package/dist-esm/src/utils/metricUtils.js +53 -0
- package/dist-esm/src/utils/metricUtils.js.map +1 -0
- package/dist-esm/src/utils/resourceUtils.js +35 -0
- package/dist-esm/src/utils/resourceUtils.js.map +1 -0
- package/dist-esm/src/utils/spanUtils.js +112 -43
- package/dist-esm/src/utils/spanUtils.js.map +1 -1
- package/package.json +18 -17
- package/types/monitor-opentelemetry-exporter.d.ts +104 -6
- package/CHANGELOG.md +0 -51
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { AggregationTemporality } from '@opentelemetry/sdk-metrics-base';
|
|
1
2
|
import { ExportResult } from '@opentelemetry/core';
|
|
3
|
+
import { PushMetricExporter } from '@opentelemetry/sdk-metrics-base';
|
|
2
4
|
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
5
|
+
import { ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
|
|
3
6
|
import { SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
4
|
-
import { TokenCredential } from '@azure/core-
|
|
7
|
+
import { TokenCredential } from '@azure/core-auth';
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Provides configuration options for AzureMonitorTraceExporter.
|
|
@@ -25,19 +28,78 @@ export declare interface AzureExporterConfig {
|
|
|
25
28
|
/**
|
|
26
29
|
* Azure Monitor OpenTelemetry Trace Exporter.
|
|
27
30
|
*/
|
|
28
|
-
export declare class
|
|
31
|
+
export declare abstract class AzureMonitorBaseExporter {
|
|
32
|
+
/**
|
|
33
|
+
* Instrumentation key to be used for exported envelopes
|
|
34
|
+
*/
|
|
35
|
+
protected readonly _instrumentationKey: string;
|
|
29
36
|
private readonly _persister;
|
|
30
37
|
private readonly _sender;
|
|
31
38
|
private _numConsecutiveRedirects;
|
|
32
39
|
private _retryTimer;
|
|
40
|
+
/**
|
|
41
|
+
* Exporter internal configuration
|
|
42
|
+
*/
|
|
33
43
|
private readonly _options;
|
|
34
44
|
/**
|
|
35
|
-
* Initializes a new instance of the
|
|
45
|
+
* Initializes a new instance of the AzureMonitorBaseExporter class.
|
|
36
46
|
* @param AzureExporterConfig - Exporter configuration.
|
|
37
47
|
*/
|
|
38
48
|
constructor(options?: AzureExporterConfig);
|
|
49
|
+
/**
|
|
50
|
+
* Persist envelopes to disk
|
|
51
|
+
*/
|
|
39
52
|
private _persist;
|
|
40
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Shutdown exporter
|
|
55
|
+
*/
|
|
56
|
+
protected _shutdown(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Export envelopes
|
|
59
|
+
*/
|
|
60
|
+
protected _exportEnvelopes(envelopes: TelemetryItem[]): Promise<ExportResult>;
|
|
61
|
+
private _sendFirstPersistedFile;
|
|
62
|
+
private _isNetworkError;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Azure Monitor OpenTelemetry Metric Exporter.
|
|
67
|
+
*/
|
|
68
|
+
export declare class AzureMonitorMetricExporter extends AzureMonitorBaseExporter implements PushMetricExporter {
|
|
69
|
+
/**
|
|
70
|
+
* Initializes a new instance of the AzureMonitorMetricExporter class.
|
|
71
|
+
* @param AzureExporterConfig - Exporter configuration.
|
|
72
|
+
*/
|
|
73
|
+
constructor(options?: AzureExporterConfig);
|
|
74
|
+
/**
|
|
75
|
+
* Export OpenTelemetry resource metrics.
|
|
76
|
+
* @param metrics - Resource metrics to export.
|
|
77
|
+
* @param resultCallback - Result callback.
|
|
78
|
+
*/
|
|
79
|
+
export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Shutdown AzureMonitorMetricExporter.
|
|
82
|
+
*/
|
|
83
|
+
shutdown(): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Select aggregation temporality
|
|
86
|
+
*/
|
|
87
|
+
selectAggregationTemporality(): AggregationTemporality;
|
|
88
|
+
/**
|
|
89
|
+
* Force flush
|
|
90
|
+
*/
|
|
91
|
+
forceFlush(): Promise<void>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Azure Monitor OpenTelemetry Trace Exporter.
|
|
96
|
+
*/
|
|
97
|
+
export declare class AzureMonitorTraceExporter extends AzureMonitorBaseExporter implements SpanExporter {
|
|
98
|
+
/**
|
|
99
|
+
* Initializes a new instance of the AzureMonitorTraceExporter class.
|
|
100
|
+
* @param AzureExporterConfig - Exporter configuration.
|
|
101
|
+
*/
|
|
102
|
+
constructor(options?: AzureExporterConfig);
|
|
41
103
|
/**
|
|
42
104
|
* Export OpenTelemetry spans.
|
|
43
105
|
* @param spans - Spans to export.
|
|
@@ -48,8 +110,22 @@ export declare class AzureMonitorTraceExporter implements SpanExporter {
|
|
|
48
110
|
* Shutdown AzureMonitorTraceExporter.
|
|
49
111
|
*/
|
|
50
112
|
shutdown(): Promise<void>;
|
|
51
|
-
|
|
52
|
-
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Data struct to contain only C section with custom fields. */
|
|
116
|
+
export declare interface MonitorBase {
|
|
117
|
+
/** Name of item (B section) if any. If telemetry data is derived straight from this, this should be null. */
|
|
118
|
+
baseType?: string;
|
|
119
|
+
/** The data payload for the telemetry request */
|
|
120
|
+
baseData?: MonitorDomain;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** The abstract common base of all domains. */
|
|
124
|
+
export declare interface MonitorDomain {
|
|
125
|
+
/** Describes unknown properties. The value of an unknown property can be of "any" type. */
|
|
126
|
+
[property: string]: any;
|
|
127
|
+
/** Schema version */
|
|
128
|
+
version: number;
|
|
53
129
|
}
|
|
54
130
|
|
|
55
131
|
/**
|
|
@@ -62,4 +138,26 @@ export declare enum ServiceApiVersion {
|
|
|
62
138
|
V2 = "2020-09-15_Preview"
|
|
63
139
|
}
|
|
64
140
|
|
|
141
|
+
/** System variables for a telemetry item. */
|
|
142
|
+
export declare interface TelemetryItem {
|
|
143
|
+
/** Envelope version. For internal use only. By assigning this the default, it will not be serialized within the payload unless changed to a value other than #1. */
|
|
144
|
+
version?: number;
|
|
145
|
+
/** Type name of telemetry data item. */
|
|
146
|
+
name: string;
|
|
147
|
+
/** Event date time when telemetry item was created. This is the wall clock time on the client when the event was generated. There is no guarantee that the client's time is accurate. This field must be formatted in UTC ISO 8601 format, with a trailing 'Z' character, as described publicly on https://en.wikipedia.org/wiki/ISO_8601#UTC. Note: the number of decimal seconds digits provided are variable (and unspecified). Consumers should handle this, i.e. managed code consumers should not use format 'O' for parsing as it specifies a fixed length. Example: 2009-06-15T13:45:30.0000000Z. */
|
|
148
|
+
time: Date;
|
|
149
|
+
/** Sampling rate used in application. This telemetry item represents 100 / sampleRate actual telemetry items. */
|
|
150
|
+
sampleRate?: number;
|
|
151
|
+
/** Sequence field used to track absolute order of uploaded events. */
|
|
152
|
+
sequence?: string;
|
|
153
|
+
/** The instrumentation key of the Application Insights resource. */
|
|
154
|
+
instrumentationKey?: string;
|
|
155
|
+
/** Key/value collection of context properties. See ContextTagKeys for information on available properties. */
|
|
156
|
+
tags?: {
|
|
157
|
+
[propertyName: string]: string;
|
|
158
|
+
};
|
|
159
|
+
/** Telemetry data item. */
|
|
160
|
+
data?: MonitorBase;
|
|
161
|
+
}
|
|
162
|
+
|
|
65
163
|
export { }
|
package/CHANGELOG.md
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# Release History
|
|
2
|
-
|
|
3
|
-
## 1.0.0-beta.7 (2022-04-05)
|
|
4
|
-
|
|
5
|
-
### Features Added
|
|
6
|
-
|
|
7
|
-
- Added authentication support using @azure/identity TokenCredential.
|
|
8
|
-
- Added file access control in Windows for retriable telemetry.
|
|
9
|
-
|
|
10
|
-
## 1.0.0-beta.6 (2022-02-08)
|
|
11
|
-
|
|
12
|
-
### Other Changes
|
|
13
|
-
|
|
14
|
-
- Updated OpenTelemtry dependencies to their latest available versions.
|
|
15
|
-
|
|
16
|
-
## 1.0.0-beta.5 (2021-10-05)
|
|
17
|
-
|
|
18
|
-
### Bugs Fixed
|
|
19
|
-
|
|
20
|
-
- Fixed issue with SDK version field not being populated correctly.
|
|
21
|
-
|
|
22
|
-
### Other Changes
|
|
23
|
-
|
|
24
|
-
- Updated mapping for Azure Monitor according to latest specs.
|
|
25
|
-
|
|
26
|
-
## 1.0.0-beta.4 (2021-07-07)
|
|
27
|
-
|
|
28
|
-
- Updating OpenTelemetry API to 1.0.0
|
|
29
|
-
- Adding support for temporary and permanent redirect
|
|
30
|
-
- Adding cleanup process for older temp files
|
|
31
|
-
|
|
32
|
-
## 1.0.0-beta.3 (2021-02-10)
|
|
33
|
-
|
|
34
|
-
- Rename package to `@azure/monitor-opentelemetry-exporter`
|
|
35
|
-
- Added serviceApiVersion config
|
|
36
|
-
- Open Telemetry dependency updates
|
|
37
|
-
|
|
38
|
-
## 1.0.0-beta.2 (2021-01-20)
|
|
39
|
-
|
|
40
|
-
- Ship the correct type declaration file
|
|
41
|
-
|
|
42
|
-
## 1.0.0-beta.1 (2021-01-13)
|
|
43
|
-
|
|
44
|
-
- OT Exporter retry when there are network issues
|
|
45
|
-
- OpenTelemetry Exporter using Resources API to get service properties
|
|
46
|
-
- Rename package to `@azure/opentelemetry-exporter-azure-monitor`
|
|
47
|
-
- [BREAKING] Deprecate all configuration options except for `connectionString`
|
|
48
|
-
- [BREAKING] Removed support for `TelemetryProcessor`
|
|
49
|
-
- (internal) Migrate to autorest generated HttpClient and Envelope Interfaces
|
|
50
|
-
- Migrate to Azure SDK for JS repository
|
|
51
|
-
- Adds support for Event Hubs Distributed Tracing [#10575](https://github.com/Azure/azure-sdk-for-js/pull/10575)
|