From 2433e6189fb02a1dec0f85e36489691dbc162ae2 Mon Sep 17 00:00:00 2001 From: Mark Wolff Date: Mon, 14 Sep 2020 12:44:25 -0700 Subject: [PATCH] [Monitor] add autorest config (#11212) * monitor: add autorest config * apply swagger codegen update * update swagger link --- .../.eslintignore | 1 + .../package.json | 1 + .../generated/applicationInsightsClient.ts | 84 ++ .../applicationInsightsClientContext.ts | 42 + .../src/generated/index.ts | 11 + .../src/generated/models/index.ts | 610 +++++++++++ .../src/generated/models/mappers.ts | 978 ++++++++++++++++++ .../src/generated/models/parameters.ts | 57 + .../swagger/README.md | 28 + 9 files changed, 1812 insertions(+) create mode 100644 sdk/monitor/monitor-opentelemetry-exporter/src/generated/applicationInsightsClient.ts create mode 100644 sdk/monitor/monitor-opentelemetry-exporter/src/generated/applicationInsightsClientContext.ts create mode 100644 sdk/monitor/monitor-opentelemetry-exporter/src/generated/index.ts create mode 100644 sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/index.ts create mode 100644 sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/mappers.ts create mode 100644 sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/parameters.ts create mode 100644 sdk/monitor/monitor-opentelemetry-exporter/swagger/README.md diff --git a/sdk/monitor/monitor-opentelemetry-exporter/.eslintignore b/sdk/monitor/monitor-opentelemetry-exporter/.eslintignore index f68a7ee2d45f..1562ebaf8f36 100644 --- a/sdk/monitor/monitor-opentelemetry-exporter/.eslintignore +++ b/sdk/monitor/monitor-opentelemetry-exporter/.eslintignore @@ -11,3 +11,4 @@ browser coverage # don't lint generated files src/Declarations +src/generated diff --git a/sdk/monitor/monitor-opentelemetry-exporter/package.json b/sdk/monitor/monitor-opentelemetry-exporter/package.json index d56f5e523eaf..4eb28cdeec83 100644 --- a/sdk/monitor/monitor-opentelemetry-exporter/package.json +++ b/sdk/monitor/monitor-opentelemetry-exporter/package.json @@ -9,6 +9,7 @@ "types": "types/src/index.d.ts", "scripts": { "clean": "rimraf dist-esm types dist", + "build:autorest": "autorest ./swagger/README.md --typescript --v3", "build:browser": "echo skipped", "build:test": "echo skipped", "build:node": "tsc -p .", diff --git a/sdk/monitor/monitor-opentelemetry-exporter/src/generated/applicationInsightsClient.ts b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/applicationInsightsClient.ts new file mode 100644 index 000000000000..adc482835895 --- /dev/null +++ b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/applicationInsightsClient.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; +import * as Parameters from "./models/parameters"; +import * as Mappers from "./models/mappers"; +import { ApplicationInsightsClientContext } from "./applicationInsightsClientContext"; +import { + ApplicationInsightsClientOptionalParams, + TelemetryItem, + ApplicationInsightsClientTrackResponse +} from "./models"; + +export class ApplicationInsightsClient extends ApplicationInsightsClientContext { + /** + * Initializes a new instance of the ApplicationInsightsClient class. + * @param options The parameter options + */ + constructor(options?: ApplicationInsightsClientOptionalParams) { + super(options); + } + + /** + * This operation generates a model using an entire series, each point is detected with the same model. + * With this method, points before and after a certain point are used to determine whether it is an + * anomaly. The entire detection can give user an overall status of the time series. + * @param body Time series points and period if needed. Advanced model parameters can also be set in + * the request. + * @param options The options parameters. + */ + track( + body: TelemetryItem[], + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); + return this.sendOperationRequest( + { body, options: operationOptions }, + trackOperationSpec + ) as Promise; + } +} +// Operation Specifications + +const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); + +const trackOperationSpec: coreHttp.OperationSpec = { + path: "/track", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.TrackResponse + }, + 206: { + bodyMapper: Mappers.TrackResponse + }, + 400: { + bodyMapper: Mappers.TrackResponse + }, + 402: { + bodyMapper: Mappers.TrackResponse + }, + 429: { + bodyMapper: Mappers.TrackResponse + }, + 500: { + bodyMapper: Mappers.TrackResponse + }, + 503: { + bodyMapper: Mappers.TrackResponse + } + }, + requestBody: Parameters.body, + urlParameters: [Parameters.host], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; diff --git a/sdk/monitor/monitor-opentelemetry-exporter/src/generated/applicationInsightsClientContext.ts b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/applicationInsightsClientContext.ts new file mode 100644 index 000000000000..52dd3db26ec9 --- /dev/null +++ b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/applicationInsightsClientContext.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; +import { ApplicationInsightsClientOptionalParams } from "./models"; + +const packageName = "@azure/monitor-opentelemetry-exporter"; +const packageVersion = "1.0.0"; + +export class ApplicationInsightsClientContext extends coreHttp.ServiceClient { + host: string; + + /** + * Initializes a new instance of the ApplicationInsightsClientContext class. + * @param options The parameter options + */ + constructor(options?: ApplicationInsightsClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + + if (!options.userAgent) { + const defaultUserAgent = coreHttp.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(undefined, options); + + this.requestContentType = "application/json; charset=utf-8"; + + this.baseUri = options.endpoint || "{Host}/v2"; + + // Assigning values to Constant parameters + this.host = options.host || "https://dc.services.visualstudio.com"; + } +} diff --git a/sdk/monitor/monitor-opentelemetry-exporter/src/generated/index.ts b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/index.ts new file mode 100644 index 000000000000..43f28f411fdc --- /dev/null +++ b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./models"; +export { ApplicationInsightsClient } from "./applicationInsightsClient"; +export { ApplicationInsightsClientContext } from "./applicationInsightsClientContext"; diff --git a/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/index.ts b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/index.ts new file mode 100644 index 000000000000..f993f333b3fa --- /dev/null +++ b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/index.ts @@ -0,0 +1,610 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; + +/** + * System variables for a telemetry item. + */ +export interface TelemetryItem { + /** + * 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. + */ + version?: number; + /** + * Type name of telemetry data item. + */ + name: string; + /** + * 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. + */ + time: Date; + /** + * Sampling rate used in application. This telemetry item represents 1 / sampleRate actual telemetry items. + */ + sampleRate?: number; + /** + * Sequence field used to track absolute order of uploaded events. + */ + sequence?: string; + /** + * The instrumentation key of the Application Insights resource. + */ + instrumentationKey?: string; + /** + * Key/value collection of context properties. See ContextTagKeys for information on available properties. + */ + tags?: { [propertyName: string]: string }; + /** + * Telemetry data item. + */ + data?: MonitorBase; +} + +/** + * Data struct to contain only C section with custom fields. + */ +export interface MonitorBase { + /** + * Name of item (B section) if any. If telemetry data is derived straight from this, this should be null. + */ + baseType?: string; + /** + * The data payload for the telemetry request + */ + baseData?: MonitorDomain; +} + +/** + * The abstract common base of all domains. + */ +export interface MonitorDomain { + /** + * Ignored value. + */ + test?: string; +} + +/** + * Response containing the status of each telemetry item. + */ +export interface TrackResponse { + /** + * The number of items received. + */ + itemsReceived?: number; + /** + * The number of items accepted. + */ + itemsAccepted?: number; + /** + * An array of error detail objects. + */ + errors?: TelemetryErrorDetails[]; +} + +/** + * The error details + */ +export interface TelemetryErrorDetails { + /** + * The index in the original payload of the item. + */ + index?: number; + /** + * The item specific [HTTP Response status code](#Response Status Codes). + */ + statusCode?: number; + /** + * The error message. + */ + message?: string; +} + +/** + * Metric data single measurement. + */ +export interface MetricDataPoint { + /** + * Namespace of the metric. + */ + namespace?: string; + /** + * Name of the metric. + */ + name: string; + /** + * Metric type. Single measurement or the aggregated value. + */ + dataPointType?: DataPointType; + /** + * Single value for measurement. Sum of individual measurements for the aggregation. + */ + value: number; + /** + * Metric weight of the aggregated metric. Should not be set for a measurement. + */ + count?: number; + /** + * Minimum value of the aggregated metric. Should not be set for a measurement. + */ + min?: number; + /** + * Maximum value of the aggregated metric. Should not be set for a measurement. + */ + max?: number; + /** + * Standard deviation of the aggregated metric. Should not be set for a measurement. + */ + stdDev?: number; +} + +/** + * Exception details of the exception in a chain. + */ +export interface TelemetryExceptionDetails { + /** + * In case exception is nested (outer exception contains inner one), the id and outerId properties are used to represent the nesting. + */ + id?: number; + /** + * The value of outerId is a reference to an element in ExceptionDetails that represents the outer exception + */ + outerId?: number; + /** + * Exception type name. + */ + typeName?: string; + /** + * Exception message. + */ + message: string; + /** + * Indicates if full exception stack is provided in the exception. The stack may be trimmed, such as in the case of a StackOverflow exception. + */ + hasFullStack?: boolean; + /** + * Text describing the stack. Either stack or parsedStack should have a value. + */ + stack?: string; + /** + * List of stack frames. Either stack or parsedStack should have a value. + */ + parsedStack?: StackFrame[]; +} + +/** + * Stack frame information. + */ +export interface StackFrame { + level: number; + /** + * Method name. + */ + method: string; + /** + * Name of the assembly (dll, jar, etc.) containing this function. + */ + assembly?: string; + /** + * File name or URL of the method implementation. + */ + fileName?: string; + /** + * Line number of the code implementation. + */ + line?: number; +} + +/** + * Instances of AvailabilityData represent the result of executing an availability test. + */ +export type AvailabilityData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * Identifier of a test run. Use it to correlate steps of test run and telemetry generated by the service. + */ + id: string; + /** + * Name of the test that these availability results represent. + */ + name: string; + /** + * Duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days. + */ + duration: string; + /** + * Success flag. + */ + success: boolean; + /** + * Name of the location where the test was run from. + */ + runLocation?: string; + /** + * Diagnostic message for the result. + */ + message?: string; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; + /** + * Collection of custom measurements. + */ + measurements?: { [propertyName: string]: number }; +}; + +/** + * 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. + */ +export type TelemetryEventData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * Event name. Keep it low cardinality to allow proper grouping and useful metrics. + */ + name: string; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; + /** + * Collection of custom measurements. + */ + measurements?: { [propertyName: string]: number }; +}; + +/** + * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application. + */ +export type TelemetryExceptionData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * Exception chain - list of inner exceptions. + */ + exceptions?: TelemetryExceptionDetails[]; + /** + * Severity level. Mostly used to indicate exception severity level when it is reported by logging library. + */ + severityLevel?: SeverityLevel; + /** + * 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. + */ + problemId?: string; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; + /** + * Collection of custom measurements. + */ + measurements?: { [propertyName: string]: number }; +}; + +/** + * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements. + */ +export type MessageData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * Trace message + */ + message: string; + /** + * Trace severity level. + */ + severityLevel?: SeverityLevel; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; + /** + * Collection of custom measurements. + */ + measurements?: { [propertyName: string]: number }; +}; + +/** + * An instance of the Metric item is a list of measurements (single data points) and/or aggregations. + */ +export type MetricsData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * 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. + */ + metrics: MetricDataPoint[]; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; +}; + +/** + * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. + */ +export type PageViewData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * Identifier of a page view instance. Used for correlation between page view and other telemetry items. + */ + id: string; + /** + * Event name. Keep it low cardinality to allow proper grouping and useful metrics. + */ + name: string; + /** + * Request URL with all query string parameters + */ + url?: string; + /** + * 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. + */ + duration?: string; + /** + * Fully qualified page URI or URL of the referring page; if unknown, leave blank + */ + referredUri?: string; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; + /** + * Collection of custom measurements. + */ + measurements?: { [propertyName: string]: number }; +}; + +/** + * 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. + */ +export type PageViewPerfData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * Identifier of a page view instance. Used for correlation between page view and other telemetry items. + */ + id: string; + /** + * Event name. Keep it low cardinality to allow proper grouping and useful metrics. + */ + name: string; + /** + * Request URL with all query string parameters + */ + url?: string; + /** + * 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. + */ + duration?: string; + /** + * Performance total in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff + */ + perfTotal?: string; + /** + * Network connection time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff + */ + networkConnect?: string; + /** + * Sent request time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff + */ + sentRequest?: string; + /** + * Received response time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff + */ + receivedResponse?: string; + /** + * DOM processing time in TimeSpan 'G' (general long) format: d:hh:mm:ss.fffffff + */ + domProcessing?: string; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; + /** + * Collection of custom measurements. + */ + measurements?: { [propertyName: string]: number }; +}; + +/** + * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint. + */ +export type RemoteDependencyData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * Identifier of a dependency call instance. Used for correlation with the request telemetry item corresponding to this dependency call. + */ + id?: string; + /** + * Name of the command initiated with this dependency call. Low cardinality value. Examples are stored procedure name and URL path template. + */ + name: string; + /** + * Result code of a dependency call. Examples are SQL error code and HTTP status code. + */ + resultCode?: string; + /** + * Command initiated by this dependency call. Examples are SQL statement and HTTP URL's with all query parameters. + */ + data?: string; + /** + * 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. + */ + type?: string; + /** + * Target site of a dependency call. Examples are server name, host address. + */ + target?: string; + /** + * Request duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days. + */ + duration: string; + /** + * Indication of successfull or unsuccessfull call. + */ + success?: boolean; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; + /** + * Collection of custom measurements. + */ + measurements?: { [propertyName: string]: number }; +}; + +/** + * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView. + */ +export type RequestData = MonitorDomain & { + /** + * Schema version + */ + version: number; + /** + * Identifier of a request call instance. Used for correlation between request and other telemetry items. + */ + id: string; + /** + * 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}'. + */ + name?: string; + /** + * Request duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days. + */ + duration: string; + /** + * Indication of successfull or unsuccessfull call. + */ + success: boolean; + /** + * Result of a request execution. HTTP status code for HTTP requests. + */ + responseCode: string; + /** + * Source of the request. Examples are the instrumentation key of the caller or the ip address of the caller. + */ + source?: string; + /** + * Request URL with all query string parameters. + */ + url?: string; + /** + * Collection of custom properties. + */ + properties?: { [propertyName: string]: string }; + /** + * Collection of custom measurements. + */ + measurements?: { [propertyName: string]: number }; +}; +/** + * Defines values for DataPointType. + */ +export type DataPointType = "Measurement" | "Aggregation" | string; +/** + * Defines values for SeverityLevel. + */ +export type SeverityLevel = + | "Verbose" + | "Information" + | "Warning" + | "Error" + | "Critical" + | string; +/** + * Defines values for ContextTagKeys. + */ +export type ContextTagKeys = + | "ai.application.ver" + | "ai.device.id" + | "ai.device.locale" + | "ai.device.model" + | "ai.device.oemName" + | "ai.device.osVersion" + | "ai.device.type" + | "ai.location.ip" + | "ai.location.country" + | "ai.location.province" + | "ai.location.city" + | "ai.operation.id" + | "ai.operation.name" + | "ai.operation.parentId" + | "ai.operation.syntheticSource" + | "ai.operation.correlationVector" + | "ai.session.id" + | "ai.session.isFirst" + | "ai.user.accountId" + | "ai.user.id" + | "ai.user.authUserId" + | "ai.cloud.role" + | "ai.cloud.roleVer" + | "ai.cloud.roleInstance" + | "ai.cloud.location" + | "ai.internal.sdkVersion" + | "ai.internal.agentVersion" + | "ai.internal.nodeName" + | string; + +/** + * Contains response data for the track operation. + */ +export type ApplicationInsightsClientTrackResponse = TrackResponse & { + /** + * The underlying HTTP response. + */ + _response: coreHttp.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TrackResponse; + }; +}; + +/** + * Optional parameters. + */ +export interface ApplicationInsightsClientOptionalParams + extends coreHttp.ServiceClientOptions { + /** + * Breeze endpoint: https://dc.services.visualstudio.com + */ + host?: string; + /** + * Overrides client endpoint. + */ + endpoint?: string; +} diff --git a/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/mappers.ts b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/mappers.ts new file mode 100644 index 000000000000..d7e585c7c8ed --- /dev/null +++ b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/mappers.ts @@ -0,0 +1,978 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; + +export const TelemetryItem: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TelemetryItem", + modelProperties: { + version: { + defaultValue: 1, + serializedName: "ver", + type: { + name: "Number" + } + }, + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + time: { + serializedName: "time", + required: true, + type: { + name: "DateTime" + } + }, + sampleRate: { + defaultValue: 100, + serializedName: "sampleRate", + type: { + name: "Number" + } + }, + sequence: { + constraints: { + MaxLength: 64 + }, + serializedName: "seq", + type: { + name: "String" + } + }, + instrumentationKey: { + serializedName: "iKey", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + data: { + serializedName: "data", + type: { + name: "Composite", + className: "MonitorBase" + } + } + } + } +}; + +export const MonitorBase: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorBase", + modelProperties: { + baseType: { + serializedName: "baseType", + type: { + name: "String" + } + }, + baseData: { + serializedName: "baseData", + type: { + name: "Composite", + className: "MonitorDomain" + } + } + } + } +}; + +export const MonitorDomain: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "MonitorDomain", + modelProperties: { + test: { + serializedName: "test", + type: { + name: "String" + } + } + } + } +}; + +export const TrackResponse: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TrackResponse", + modelProperties: { + itemsReceived: { + serializedName: "itemsReceived", + type: { + name: "Number" + } + }, + itemsAccepted: { + serializedName: "itemsAccepted", + type: { + name: "Number" + } + }, + errors: { + serializedName: "errors", + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "TelemetryErrorDetails" } + } + } + } + } + } +}; + +export const TelemetryErrorDetails: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TelemetryErrorDetails", + modelProperties: { + index: { + serializedName: "index", + type: { + name: "Number" + } + }, + statusCode: { + serializedName: "statusCode", + type: { + name: "Number" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const MetricDataPoint: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "MetricDataPoint", + modelProperties: { + namespace: { + constraints: { + MaxLength: 256 + }, + serializedName: "ns", + type: { + name: "String" + } + }, + name: { + constraints: { + MaxLength: 1024 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + dataPointType: { + serializedName: "kind", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Number" + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + min: { + serializedName: "min", + type: { + name: "Number" + } + }, + max: { + serializedName: "max", + type: { + name: "Number" + } + }, + stdDev: { + serializedName: "stdDev", + type: { + name: "Number" + } + } + } + } +}; + +export const TelemetryExceptionDetails: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TelemetryExceptionDetails", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "Number" + } + }, + outerId: { + serializedName: "outerId", + type: { + name: "Number" + } + }, + typeName: { + constraints: { + MaxLength: 1024 + }, + serializedName: "typeName", + type: { + name: "String" + } + }, + message: { + constraints: { + MaxLength: 32768 + }, + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + hasFullStack: { + defaultValue: true, + serializedName: "hasFullStack", + type: { + name: "Boolean" + } + }, + stack: { + constraints: { + MaxLength: 32768 + }, + serializedName: "stack", + type: { + name: "String" + } + }, + parsedStack: { + serializedName: "parsedStack", + type: { + name: "Sequence", + element: { type: { name: "Composite", className: "StackFrame" } } + } + } + } + } +}; + +export const StackFrame: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "StackFrame", + modelProperties: { + level: { + serializedName: "level", + required: true, + type: { + name: "Number" + } + }, + method: { + constraints: { + MaxLength: 1024 + }, + serializedName: "method", + required: true, + type: { + name: "String" + } + }, + assembly: { + constraints: { + MaxLength: 1024 + }, + serializedName: "assembly", + type: { + name: "String" + } + }, + fileName: { + constraints: { + MaxLength: 1024 + }, + serializedName: "fileName", + type: { + name: "String" + } + }, + line: { + serializedName: "line", + type: { + name: "Number" + } + } + } + } +}; + +export const AvailabilityData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "AvailabilityData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + id: { + constraints: { + MaxLength: 512 + }, + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + name: { + constraints: { + MaxLength: 1024 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + duration: { + serializedName: "duration", + required: true, + type: { + name: "String" + } + }, + success: { + serializedName: "success", + required: true, + type: { + name: "Boolean" + } + }, + runLocation: { + constraints: { + MaxLength: 1024 + }, + serializedName: "runLocation", + type: { + name: "String" + } + }, + message: { + constraints: { + MaxLength: 8192 + }, + serializedName: "message", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + }, + measurements: { + serializedName: "measurements", + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } + } + } + } +}; + +export const TelemetryEventData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TelemetryEventData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + name: { + constraints: { + MaxLength: 512 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + }, + measurements: { + serializedName: "measurements", + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } + } + } + } +}; + +export const TelemetryExceptionData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TelemetryExceptionData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + exceptions: { + serializedName: "exceptions", + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "TelemetryExceptionDetails" } + } + } + }, + severityLevel: { + serializedName: "severityLevel", + type: { + name: "String" + } + }, + problemId: { + constraints: { + MaxLength: 1024 + }, + serializedName: "problemId", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + }, + measurements: { + serializedName: "measurements", + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } + } + } + } +}; + +export const MessageData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "MessageData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + message: { + constraints: { + MaxLength: 32768 + }, + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + severityLevel: { + serializedName: "severityLevel", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + }, + measurements: { + serializedName: "measurements", + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } + } + } + } +}; + +export const MetricsData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "MetricsData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + metrics: { + serializedName: "metrics", + required: true, + type: { + name: "Sequence", + element: { type: { name: "Composite", className: "MetricDataPoint" } } + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + } + } + } +}; + +export const PageViewData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "PageViewData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + id: { + constraints: { + MaxLength: 512 + }, + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + name: { + constraints: { + MaxLength: 1024 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + url: { + constraints: { + MaxLength: 2048 + }, + serializedName: "url", + type: { + name: "String" + } + }, + duration: { + serializedName: "duration", + type: { + name: "String" + } + }, + referredUri: { + constraints: { + MaxLength: 2048 + }, + serializedName: "referredUri", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + }, + measurements: { + serializedName: "measurements", + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } + } + } + } +}; + +export const PageViewPerfData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "PageViewPerfData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + id: { + constraints: { + MaxLength: 512 + }, + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + name: { + constraints: { + MaxLength: 1024 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + url: { + constraints: { + MaxLength: 2048 + }, + serializedName: "url", + type: { + name: "String" + } + }, + duration: { + serializedName: "duration", + type: { + name: "String" + } + }, + perfTotal: { + serializedName: "perfTotal", + type: { + name: "String" + } + }, + networkConnect: { + serializedName: "networkConnect", + type: { + name: "String" + } + }, + sentRequest: { + serializedName: "sentRequest", + type: { + name: "String" + } + }, + receivedResponse: { + serializedName: "receivedResponse", + type: { + name: "String" + } + }, + domProcessing: { + serializedName: "domProcessing", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + }, + measurements: { + serializedName: "measurements", + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } + } + } + } +}; + +export const RemoteDependencyData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteDependencyData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + id: { + constraints: { + MaxLength: 512 + }, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + constraints: { + MaxLength: 1024 + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + resultCode: { + constraints: { + MaxLength: 1024 + }, + serializedName: "resultCode", + type: { + name: "String" + } + }, + data: { + constraints: { + MaxLength: 8192 + }, + serializedName: "data", + type: { + name: "String" + } + }, + type: { + constraints: { + MaxLength: 1024 + }, + serializedName: "type", + type: { + name: "String" + } + }, + target: { + constraints: { + MaxLength: 1024 + }, + serializedName: "target", + type: { + name: "String" + } + }, + duration: { + serializedName: "duration", + required: true, + type: { + name: "String" + } + }, + success: { + defaultValue: true, + serializedName: "success", + type: { + name: "Boolean" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + }, + measurements: { + serializedName: "measurements", + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } + } + } + } +}; + +export const RequestData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RequestData", + modelProperties: { + ...MonitorDomain.type.modelProperties, + version: { + defaultValue: 2, + serializedName: "ver", + required: true, + type: { + name: "Number" + } + }, + id: { + constraints: { + MaxLength: 512 + }, + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + name: { + constraints: { + MaxLength: 1024 + }, + serializedName: "name", + type: { + name: "String" + } + }, + duration: { + serializedName: "duration", + required: true, + type: { + name: "String" + } + }, + success: { + defaultValue: true, + serializedName: "success", + required: true, + type: { + name: "Boolean" + } + }, + responseCode: { + constraints: { + MaxLength: 1024 + }, + serializedName: "responseCode", + required: true, + type: { + name: "String" + } + }, + source: { + constraints: { + MaxLength: 1024 + }, + serializedName: "source", + type: { + name: "String" + } + }, + url: { + constraints: { + MaxLength: 2048 + }, + serializedName: "url", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" }, constraints: { MaxLength: 8192 } } + } + }, + measurements: { + serializedName: "measurements", + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } + } + } + } +}; diff --git a/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/parameters.ts b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/parameters.ts new file mode 100644 index 000000000000..dfb01d44ef4b --- /dev/null +++ b/sdk/monitor/monitor-opentelemetry-exporter/src/generated/models/parameters.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { OperationParameter, OperationURLParameter } from "@azure/core-http"; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + type: { + name: "Sequence", + element: { type: { name: "Composite", className: "TelemetryItem" } } + } + } +}; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const host: OperationURLParameter = { + parameterPath: "host", + mapper: { + serializedName: "Host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; diff --git a/sdk/monitor/monitor-opentelemetry-exporter/swagger/README.md b/sdk/monitor/monitor-opentelemetry-exporter/swagger/README.md new file mode 100644 index 000000000000..aa548ba771e4 --- /dev/null +++ b/sdk/monitor/monitor-opentelemetry-exporter/swagger/README.md @@ -0,0 +1,28 @@ +# Azure Monitor Generated OpenTelemetry Exporter Client + +> see https://aka.ms/autorest + +## Instructions + +From `swagger/`: + +```zsh +rm -rf ../src/generated +autorest --typescript --v3 +``` + +## Configuration + +```yaml +package-name: "@azure/monitor-opentelemetry-exporter" +title: ApplicationInsightsClient +description: Application Insights Client +generate-metadata: false +license-header: MICROSOFT_MIT_NO_VERSION +output-folder: ../ +source-code-folder-path: ./src/generated +input-file: https://github.com/srnagar/swagger/blob/master/application-insights.json +add-credentials: false +use-extension: + "@autorest/typescript": "6.0.0-dev.20200826.1" +```