UNPKG

18.4 kBTypeScriptView Raw
1import * as coreClient from "@azure/core-client";
2/** System variables for a telemetry item. */
3export interface TelemetryItem {
4 /** 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. */
5 version?: number;
6 /** Type name of telemetry data item. */
7 name: string;
8 /** 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. */
9 time: Date;
10 /** Sampling rate used in application. This telemetry item represents 100 / sampleRate actual telemetry items. */
11 sampleRate?: number;
12 /** Sequence field used to track absolute order of uploaded events. */
13 sequence?: string;
14 /** The instrumentation key of the Application Insights resource. */
15 instrumentationKey?: string;
16 /** Key/value collection of context properties. See ContextTagKeys for information on available properties. */
17 tags?: {
18 [propertyName: string]: string;
19 };
20 /** Telemetry data item. */
21 data?: MonitorBase;
22}
23/** Data struct to contain only C section with custom fields. */
24export interface MonitorBase {
25 /** Name of item (B section) if any. If telemetry data is derived straight from this, this should be null. */
26 baseType?: string;
27 /** The data payload for the telemetry request */
28 baseData?: MonitorDomain;
29}
30/** The abstract common base of all domains. */
31export interface MonitorDomain {
32 /** Describes unknown properties. The value of an unknown property can be of "any" type. */
33 [property: string]: any;
34 /** Schema version */
35 version?: number;
36}
37/** Response containing the status of each telemetry item. */
38export interface TrackResponse {
39 /** The number of items received. */
40 itemsReceived?: number;
41 /** The number of items accepted. */
42 itemsAccepted?: number;
43 /** An array of error detail objects. */
44 errors?: TelemetryErrorDetails[];
45}
46/** The error details */
47export interface TelemetryErrorDetails {
48 /** The index in the original payload of the item. */
49 index?: number;
50 /** The item specific [HTTP Response status code](#Response Status Codes). */
51 statusCode?: number;
52 /** The error message. */
53 message?: string;
54}
55/** Metric data single measurement. */
56export interface MetricDataPoint {
57 /** Namespace of the metric. */
58 namespace?: string;
59 /** Name of the metric. */
60 name: string;
61 /** Metric type. Single measurement or the aggregated value. */
62 dataPointType?: DataPointType;
63 /** Single value for measurement. Sum of individual measurements for the aggregation. */
64 value: number;
65 /** Metric weight of the aggregated metric. Should not be set for a measurement. */
66 count?: number;
67 /** Minimum value of the aggregated metric. Should not be set for a measurement. */
68 min?: number;
69 /** Maximum value of the aggregated metric. Should not be set for a measurement. */
70 max?: number;
71 /** Standard deviation of the aggregated metric. Should not be set for a measurement. */
72 stdDev?: number;
73}
74/** Exception details of the exception in a chain. */
75export interface TelemetryExceptionDetails {
76 /** In case exception is nested (outer exception contains inner one), the id and outerId properties are used to represent the nesting. */
77 id?: number;
78 /** The value of outerId is a reference to an element in ExceptionDetails that represents the outer exception */
79 outerId?: number;
80 /** Exception type name. */
81 typeName?: string;
82 /** Exception message. */
83 message: string;
84 /** Indicates if full exception stack is provided in the exception. The stack may be trimmed, such as in the case of a StackOverflow exception. */
85 hasFullStack?: boolean;
86 /** Text describing the stack. Either stack or parsedStack should have a value. */
87 stack?: string;
88 /** List of stack frames. Either stack or parsedStack should have a value. */
89 parsedStack?: StackFrame[];
90}
91/** Stack frame information. */
92export interface StackFrame {
93 level: number;
94 /** Method name. */
95 method: string;
96 /** Name of the assembly (dll, jar, etc.) containing this function. */
97 assembly?: string;
98 /** File name or URL of the method implementation. */
99 fileName?: string;
100 /** Line number of the code implementation. */
101 line?: number;
102}
103/** Instances of AvailabilityData represent the result of executing an availability test. */
104export declare type AvailabilityData = MonitorDomain & {
105 /** Identifier of a test run. Use it to correlate steps of test run and telemetry generated by the service. */
106 id: string;
107 /** Name of the test that these availability results represent. */
108 name: string;
109 /** Duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days. */
110 duration: string;
111 /** Success flag. */
112 success: boolean;
113 /** Name of the location where the test was run from. */
114 runLocation?: string;
115 /** Diagnostic message for the result. */
116 message?: string;
117 /** Collection of custom properties. */
118 properties?: {
119 [propertyName: string]: string;
120 };
121 /** Collection of custom measurements. */
122 measurements?: {
123 [propertyName: string]: number;
124 };
125};
126/** Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name. */
127export declare type TelemetryEventData = MonitorDomain & {
128 /** Event name. Keep it low cardinality to allow proper grouping and useful metrics. */
129 name: string;
130 /** Collection of custom properties. */
131 properties?: {
132 [propertyName: string]: string;
133 };
134 /** Collection of custom measurements. */
135 measurements?: {
136 [propertyName: string]: number;
137 };
138};
139/** An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application. */
140export declare type TelemetryExceptionData = MonitorDomain & {
141 /** Exception chain - list of inner exceptions. */
142 exceptions: TelemetryExceptionDetails[];
143 /** Severity level. Mostly used to indicate exception severity level when it is reported by logging library. */
144 severityLevel?: SeverityLevel;
145 /** Identifier of where the exception was thrown in code. Used for exceptions grouping. Typically a combination of exception type and a function from the call stack. */
146 problemId?: string;
147 /** Collection of custom properties. */
148 properties?: {
149 [propertyName: string]: string;
150 };
151 /** Collection of custom measurements. */
152 measurements?: {
153 [propertyName: string]: number;
154 };
155};
156/** Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into instances of this type. The message does not have measurements. */
157export declare type MessageData = MonitorDomain & {
158 /** Trace message */
159 message: string;
160 /** Trace severity level. */
161 severityLevel?: SeverityLevel;
162 /** Collection of custom properties. */
163 properties?: {
164 [propertyName: string]: string;
165 };
166 /** Collection of custom measurements. */
167 measurements?: {
168 [propertyName: string]: number;
169 };
170};
171/** An instance of the Metric item is a list of measurements (single data points) and/or aggregations. */
172export declare type MetricsData = MonitorDomain & {
173 /** List of metrics. Only one metric in the list is currently supported by Application Insights storage. If multiple data points were sent only the first one will be used. */
174 metrics: MetricDataPoint[];
175 /** Collection of custom properties. */
176 properties?: {
177 [propertyName: string]: string;
178 };
179};
180/** An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. */
181export declare type PageViewData = MonitorDomain & {
182 /** Identifier of a page view instance. Used for correlation between page view and other telemetry items. */
183 id: string;
184 /** Event name. Keep it low cardinality to allow proper grouping and useful metrics. */
185 name: string;
186 /** Request URL with all query string parameters */
187 url?: string;
188 /** Request duration in format: DD.HH:MM:SS.MMMMMM. For a page view (PageViewData), this is the duration. For a page view with performance information (PageViewPerfData), this is the page load time. Must be less than 1000 days. */
189 duration?: string;
190 /** Fully qualified page URI or URL of the referring page; if unknown, leave blank */
191 referredUri?: string;
192 /** Collection of custom properties. */
193 properties?: {
194 [propertyName: string]: string;
195 };
196 /** Collection of custom measurements. */
197 measurements?: {
198 [propertyName: string]: number;
199 };
200};
201/** An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request. */
202export declare type PageViewPerfData = MonitorDomain & {
203 /** Identifier of a page view instance. Used for correlation between page view and other telemetry items. */
204 id: string;
205 /** Event name. Keep it low cardinality to allow proper grouping and useful metrics. */
206 name: string;
207 /** Request URL with all query string parameters */
208 url?: string;
209 /** Request duration in format: DD.HH:MM:SS.MMMMMM. For a page view (PageViewData), this is the duration. For a page view with performance information (PageViewPerfData), this is the page load time. Must be less than 1000 days. */
210 duration?: string;
211 /** Performance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff */
212 perfTotal?: string;
213 /** Network connection time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff */
214 networkConnect?: string;
215 /** Sent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff */
216 sentRequest?: string;
217 /** Received response time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff */
218 receivedResponse?: string;
219 /** DOM processing time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff */
220 domProcessing?: string;
221 /** Collection of custom properties. */
222 properties?: {
223 [propertyName: string]: string;
224 };
225 /** Collection of custom measurements. */
226 measurements?: {
227 [propertyName: string]: number;
228 };
229};
230/** An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint. */
231export declare type RemoteDependencyData = MonitorDomain & {
232 /** Identifier of a dependency call instance. Used for correlation with the request telemetry item corresponding to this dependency call. */
233 id?: string;
234 /** Name of the command initiated with this dependency call. Low cardinality value. Examples are stored procedure name and URL path template. */
235 name: string;
236 /** Result code of a dependency call. Examples are SQL error code and HTTP status code. */
237 resultCode?: string;
238 /** Command initiated by this dependency call. Examples are SQL statement and HTTP URL with all query parameters. */
239 data?: string;
240 /** Dependency type name. Very low cardinality value for logical grouping of dependencies and interpretation of other fields like commandName and resultCode. Examples are SQL, Azure table, and HTTP. */
241 type?: string;
242 /** Target site of a dependency call. Examples are server name, host address. */
243 target?: string;
244 /** Request duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days. */
245 duration: string;
246 /** Indication of successful or unsuccessful call. */
247 success?: boolean;
248 /** Collection of custom properties. */
249 properties?: {
250 [propertyName: string]: string;
251 };
252 /** Collection of custom measurements. */
253 measurements?: {
254 [propertyName: string]: number;
255 };
256};
257/** An instance of Request represents completion of an external request to the application to do work and contains a summary of that request execution and the results. */
258export declare type RequestData = MonitorDomain & {
259 /** Identifier of a request call instance. Used for correlation between request and other telemetry items. */
260 id: string;
261 /** Name of the request. Represents code path taken to process request. Low cardinality value to allow better grouping of requests. For HTTP requests it represents the HTTP method and URL path template like 'GET /values/{id}'. */
262 name?: string;
263 /** Request duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days. */
264 duration: string;
265 /** Indication of successful or unsuccessful call. */
266 success: boolean;
267 /** Result of a request execution. HTTP status code for HTTP requests. */
268 responseCode: string;
269 /** Source of the request. Examples are the instrumentation key of the caller or the ip address of the caller. */
270 source?: string;
271 /** Request URL with all query string parameters. */
272 url?: string;
273 /** Collection of custom properties. */
274 properties?: {
275 [propertyName: string]: string;
276 };
277 /** Collection of custom measurements. */
278 measurements?: {
279 [propertyName: string]: number;
280 };
281};
282/** Known values of {@link DataPointType} that the service accepts. */
283export declare enum KnownDataPointType {
284 Measurement = "Measurement",
285 Aggregation = "Aggregation"
286}
287/**
288 * Defines values for DataPointType. \
289 * {@link KnownDataPointType} can be used interchangeably with DataPointType,
290 * this enum contains the known values that the service supports.
291 * ### Known values supported by the service
292 * **Measurement** \
293 * **Aggregation**
294 */
295export declare type DataPointType = string;
296/** Known values of {@link SeverityLevel} that the service accepts. */
297export declare enum KnownSeverityLevel {
298 Verbose = "Verbose",
299 Information = "Information",
300 Warning = "Warning",
301 Error = "Error",
302 Critical = "Critical"
303}
304/**
305 * Defines values for SeverityLevel. \
306 * {@link KnownSeverityLevel} can be used interchangeably with SeverityLevel,
307 * this enum contains the known values that the service supports.
308 * ### Known values supported by the service
309 * **Verbose** \
310 * **Information** \
311 * **Warning** \
312 * **Error** \
313 * **Critical**
314 */
315export declare type SeverityLevel = string;
316/** Known values of {@link ContextTagKeys} that the service accepts. */
317export declare enum KnownContextTagKeys {
318 AiApplicationVer = "ai.application.ver",
319 AiDeviceId = "ai.device.id",
320 AiDeviceLocale = "ai.device.locale",
321 AiDeviceModel = "ai.device.model",
322 AiDeviceOemName = "ai.device.oemName",
323 AiDeviceOsVersion = "ai.device.osVersion",
324 AiDeviceType = "ai.device.type",
325 AiLocationIp = "ai.location.ip",
326 AiLocationCountry = "ai.location.country",
327 AiLocationProvince = "ai.location.province",
328 AiLocationCity = "ai.location.city",
329 AiOperationId = "ai.operation.id",
330 AiOperationName = "ai.operation.name",
331 AiOperationParentId = "ai.operation.parentId",
332 AiOperationSyntheticSource = "ai.operation.syntheticSource",
333 AiOperationCorrelationVector = "ai.operation.correlationVector",
334 AiSessionId = "ai.session.id",
335 AiSessionIsFirst = "ai.session.isFirst",
336 AiUserAccountId = "ai.user.accountId",
337 AiUserId = "ai.user.id",
338 AiUserAuthUserId = "ai.user.authUserId",
339 AiCloudRole = "ai.cloud.role",
340 AiCloudRoleVer = "ai.cloud.roleVer",
341 AiCloudRoleInstance = "ai.cloud.roleInstance",
342 AiCloudLocation = "ai.cloud.location",
343 AiInternalSdkVersion = "ai.internal.sdkVersion",
344 AiInternalAgentVersion = "ai.internal.agentVersion",
345 AiInternalNodeName = "ai.internal.nodeName"
346}
347/**
348 * Defines values for ContextTagKeys. \
349 * {@link KnownContextTagKeys} can be used interchangeably with ContextTagKeys,
350 * this enum contains the known values that the service supports.
351 * ### Known values supported by the service
352 * **ai.application.ver** \
353 * **ai.device.id** \
354 * **ai.device.locale** \
355 * **ai.device.model** \
356 * **ai.device.oemName** \
357 * **ai.device.osVersion** \
358 * **ai.device.type** \
359 * **ai.location.ip** \
360 * **ai.location.country** \
361 * **ai.location.province** \
362 * **ai.location.city** \
363 * **ai.operation.id** \
364 * **ai.operation.name** \
365 * **ai.operation.parentId** \
366 * **ai.operation.syntheticSource** \
367 * **ai.operation.correlationVector** \
368 * **ai.session.id** \
369 * **ai.session.isFirst** \
370 * **ai.user.accountId** \
371 * **ai.user.id** \
372 * **ai.user.authUserId** \
373 * **ai.cloud.role** \
374 * **ai.cloud.roleVer** \
375 * **ai.cloud.roleInstance** \
376 * **ai.cloud.location** \
377 * **ai.internal.sdkVersion** \
378 * **ai.internal.agentVersion** \
379 * **ai.internal.nodeName**
380 */
381export declare type ContextTagKeys = string;
382/** Optional parameters. */
383export declare type TrackOptionalParams = coreClient.OperationOptions;
384/** Contains response data for the track operation. */
385export declare type TrackOperationResponse = TrackResponse;
386/** Optional parameters. */
387export interface ApplicationInsightsClientOptionalParams extends coreClient.ServiceClientOptions {
388 /** Breeze endpoint: https://dc.services.visualstudio.com */
389 host?: string;
390 /** Overrides client endpoint. */
391 endpoint?: string;
392}