Skip to content

Commit 0c92da7

Browse files
committed
[Monitor] Add Monitor Exporter TypeSpec
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
1 parent e96c245 commit 0c92da7

File tree

9 files changed

+1704
-781
lines changed

9 files changed

+1704
-781
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import "./main.tsp";
2+
import "@azure-tools/typespec-client-generator-core";
3+
4+
using Azure.ClientGenerator.Core;
5+
using AzureMonitorExporter;
6+
7+
@@clientName(Base, "MonitorBase");
8+
@@clientName(Domain, "EventDomain");
9+
@@clientName(EventData, "TelemetryEventData");
10+
@@clientName(DataPoint, "MetricDataPoint");
11+
@@clientName(ExceptionData, "TelemetryExceptionData");
12+
@@clientName(ExceptionDetails, "TelemetryExceptionDetails");
13+
@@clientName(ErrorDetails, "TelemetryErrorDetails");
14+
@@clientName(TelemetryEnvelope, "TelemetryItem");
15+
16+
@@clientName(TelemetryEnvelope.ver, "version");
17+
@@clientName(TelemetryEnvelope.seq, "sequence");
18+
@@clientName(TelemetryEnvelope.iKey, "instrumentationKey");
19+
20+
@@clientName(Domain.ver, "version");
21+
22+
@@clientName(DataPoint.ns, "namespace");
23+
@@clientName(DataPoint.kind, "dataPointType");
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"operationId": "Track",
3+
"title": "Send telemetry data",
4+
"description": "This is a request sending telemetry data to Azure Monitor.",
5+
"parameters": {
6+
"body": [
7+
{
8+
"ver": 1,
9+
"name": "Microsoft.ApplicationInsights.b4f83947968d4e2f82ad804be07697ae.Event",
10+
"time": "2020-09-22T10:12:53.208-0700",
11+
"sampleRate": 100.0,
12+
"iKey": "c1f83947-938c-5e2a-82ff-804be07647bc",
13+
"tags": {
14+
"ai.internal.sdkVersion": "java:3.0.0-PREVIEW.5",
15+
"ai.internal.nodeName": "MININT-PLOJ2RD",
16+
"ai.operation.id": "f364119ed1ff3bcda0d4ee0896cf785f",
17+
"ai.cloud.roleInstance": "MININT-PLOJ2RD",
18+
"ai.operation.childid": "75706a2ac9456288"
19+
}
20+
},
21+
{
22+
"ver": 1,
23+
"name": "Microsoft.ApplicationInsights.b4f83947968d4e2f82ad804be07697ae.Event",
24+
"time": "2020-09-22T10:12:53.208-0700",
25+
"sampleRate": 100.0,
26+
"iKey": "c1f83947-938c-5e2a-82ff-804be07647bc",
27+
"tags": {
28+
"ai.internal.sdkVersion": "java:3.0.0-PREVIEW.5",
29+
"ai.internal.nodeName": "MININT-PLOJ2RD",
30+
"ai.operation.id": "f364119ed1ff3bcda0d4ee0896cf785f",
31+
"ai.cloud.roleInstance": "MININT-PLOJ2RD",
32+
"ai.operation.childid": "75706a2ac9456288"
33+
}
34+
},
35+
{
36+
"ver": 1,
37+
"name": "Microsoft.ApplicationInsights.b4f83947968d4e2f82ad804be07697ae.Event",
38+
"time": "2020-09-22T10:12:53.208-0700",
39+
"sampleRate": 100.0,
40+
"iKey": "c1f83947-938c-5e2a-82ff-804be07647bc",
41+
"tags": {
42+
"ai.internal.sdkVersion": "java:3.0.0-PREVIEW.5",
43+
"ai.internal.nodeName": "MININT-PLOJ2RD",
44+
"ai.operation.id": "f364119ed1ff3bcda0d4ee0896cf785f",
45+
"ai.cloud.roleInstance": "MININT-PLOJ2RD",
46+
"ai.operation.childid": "75706a2ac9456288"
47+
}
48+
},
49+
{
50+
"ver": 1,
51+
"name": "Microsoft.ApplicationInsights.b4f83947968d4e2f82ad804be07697ae.Event",
52+
"time": "2020-09-22T10:12:53.208-0700",
53+
"sampleRate": 100.0,
54+
"iKey": "c1f83947-938c-5e2a-82ff-804be07647bc",
55+
"tags": {
56+
"ai.internal.sdkVersion": "java:3.0.0-PREVIEW.5",
57+
"ai.internal.nodeName": "MININT-PLOJ2RD",
58+
"ai.operation.id": "f364119ed1ff3bcda0d4ee0896cf785f",
59+
"ai.cloud.roleInstance": "MININT-PLOJ2RD",
60+
"ai.operation.childid": "75706a2ac9456288"
61+
}
62+
},
63+
{
64+
"ver": 1,
65+
"name": "Microsoft.ApplicationInsights.b4f83947968d4e2f82ad804be07697ae.Event",
66+
"time": "2020-09-22T10:12:53.208-0700",
67+
"sampleRate": 100.0,
68+
"iKey": "c1f83947-938c-5e2a-82ff-804be07647bc",
69+
"tags": {
70+
"ai.internal.sdkVersion": "java:3.0.0-PREVIEW.5",
71+
"ai.internal.nodeName": "MININT-PLOJ2RD",
72+
"ai.operation.id": "f364119ed1ff3bcda0d4ee0896cf785f",
73+
"ai.cloud.roleInstance": "MININT-PLOJ2RD",
74+
"ai.operation.childid": "75706a2ac9456288"
75+
}
76+
},
77+
{
78+
"ver": 1,
79+
"name": "Microsoft.ApplicationInsights.b4f83947968d4e2f82ad804be07697ae.Event",
80+
"time": "2020-09-22T10:12:53.208-0700",
81+
"sampleRate": 100.0,
82+
"iKey": "c1f83947-938c-5e2a-82ff-804be07647bc",
83+
"tags": {
84+
"ai.internal.sdkVersion": "java:3.0.0-PREVIEW.5",
85+
"ai.internal.nodeName": "MININT-PLOJ2RD",
86+
"ai.operation.id": "f364119ed1ff3bcda0d4ee0896cf785f",
87+
"ai.cloud.roleInstance": "MININT-PLOJ2RD",
88+
"ai.operation.childid": "75706a2ac9456288"
89+
}
90+
},
91+
{
92+
"ver": 1,
93+
"name": "Microsoft.ApplicationInsights.b4f83947968d4e2f82ad804be07697ae.Event",
94+
"time": "2020-09-22T10:12:53.208-0700",
95+
"sampleRate": 100.0,
96+
"iKey": "c1f83947-938c-5e2a-82ff-804be07647bc",
97+
"tags": {
98+
"ai.internal.sdkVersion": "java:3.0.0-PREVIEW.5",
99+
"ai.internal.nodeName": "MININT-PLOJ2RD",
100+
"ai.operation.id": "f364119ed1ff3bcda0d4ee0896cf785f",
101+
"ai.cloud.roleInstance": "MININT-PLOJ2RD",
102+
"ai.operation.childid": "75706a2ac9456288"
103+
}
104+
}
105+
]
106+
},
107+
"responses": {
108+
"200": {
109+
"headers": {},
110+
"body": {
111+
"itemsReceived": 1,
112+
"itemsAccepted": 1,
113+
"errors": []
114+
}
115+
},
116+
"206": {
117+
"headers": {},
118+
"body": {
119+
"itemsReceived": 1,
120+
"itemsAccepted": 1,
121+
"errors": []
122+
}
123+
}
124+
}
125+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import "@typespec/rest";
2+
import "@typespec/http";
3+
import "./routes.tsp";
4+
5+
using TypeSpec.Http;
6+
using TypeSpec.Versioning;
7+
8+
/**
9+
* OpenTelemetry Exporter for Azure Monitor
10+
*/
11+
#suppress "@azure-tools/typespec-autorest/unsupported-auth" "NoAuth is supported"
12+
@useAuth(NoAuth)
13+
@service(#{ title: "Azure Monitor Exporter" })
14+
@versioned(Versions)
15+
@server(
16+
"{host}/{apiVersion}",
17+
"Azure Monitor Logs Query Service",
18+
{
19+
/** Application Insights' Breeze endpoint. */
20+
host: url = "https://dc.services.visualstudio.com",
21+
22+
/** The service API version. */
23+
apiVersion: Versions,
24+
}
25+
)
26+
namespace AzureMonitorExporter;
27+
28+
enum Versions {
29+
/** The V2.1 API version. */
30+
V2_1: "v2.1",
31+
}

0 commit comments

Comments
 (0)