Skip to content

Commit 7521ed4

Browse files
author
Sergey Kanzhelev
committed
public endpoint schema
1 parent 91942fe commit 7521ed4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1846
-1
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,14 @@ Ankh.NoLoad
6868

6969
# Ignore NuGet packages.
7070
/NuGet.Packages/*
71+
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
72+
!packages/*/build/
73+
74+
# MSTest test Results
75+
[Tt]est[Rr]esult*/
76+
[Bb]uild[Ll]og.*
7177

7278
# Ignore certain directories
73-
/TestResults/*
7479
/Samples/AzureEmailService/AzureEmailService/bin/*
7580
/Samples/AzureEmailService/AzureEmailService/MvcWebRoleContent/*
7681
/Samples/AzureEmailService/AzureEmailService/obj/*
File renamed without changes.
File renamed without changes.

EndpointSpecs/Schemas/Bond/Base.bond

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
namespace AI
3+
4+
[Description("Data struct to contain only C section with custom fields.")]
5+
struct Base
6+
{
7+
[Name("ItemTypeName")]
8+
[Description("Name of item (B section) if any. If telemetry data is derived straight from this, this should be null.")]
9+
10: string baseType;
10+
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
2+
namespace AI
3+
4+
[ContextContract("Emit")]
5+
[PseudoType("JSMap")]
6+
struct ContextTagKeys
7+
{
8+
[Description("Application version. Information in the application context fields is always about the application that is sending the telemetry.")]
9+
[MaxStringLength("1024")]
10+
10: string ApplicationVersion = "ai.application.ver";
11+
12+
[Description("Unique client device id. Computer name in most cases.")]
13+
[MaxStringLength("1024")]
14+
100: string DeviceId = "ai.device.id";
15+
16+
[Description("Device locale using <language>-<REGION> pattern, following RFC 5646. Example 'en-US'.")]
17+
[MaxStringLength("64")]
18+
115: string DeviceLocale = "ai.device.locale";
19+
20+
[Description("Model of the device end user of the application using. Used for client scenarios. If empty, derived from user agent.")]
21+
[MaxStringLength("256")]
22+
120: string DeviceModel = "ai.device.model";
23+
24+
[MaxStringLength("256")]
25+
130: string DeviceOEMName = "ai.device.oemName";
26+
27+
[Description("Operation system name and version of the device end user of the application using. If empty derived from user agent. Example 'Windows 10 Pro 10.0.10586.0'")]
28+
[MaxStringLength("256")]
29+
140: string DeviceOSVersion = "ai.device.osVersion";
30+
31+
[Description("Type of the device end user of the application is using. Used primarily to distinguish JavaScript telemetry from server side telemetry. Examples: 'PC', 'Phone', 'Browser'. 'PC' is a default value.")]
32+
[MaxStringLength("64")]
33+
160: string DeviceType = "ai.device.type";
34+
35+
[Description("The IPv4 IP address of the client device. IPv6 is not currently supported. Information in the location context fields is always about the end user. When telemetry is sent from a service, the location context is about the user that initiated the operation in the service.")]
36+
[MaxStringLength("45")]
37+
200: string LocationIp = "ai.location.ip";
38+
39+
[Description("A unique identifier for the operation instance. The operation.id is created by either a request or a page view. All other telemetry sets this to the value for the containing request or page view. Operation.id is used for finding all the telemetry items for a specific operation instance.")]
40+
[MaxStringLength("128")]
41+
300: string OperationId = "ai.operation.id";
42+
43+
[Description("The name (group) of the operation. The operation.name is created by either a request or a page view. All other telemetry items set this to the value for the containing request or page view. Operation.name is used for finding all the telemetry items for a group of operations (i.e. 'GET Home/Index').")]
44+
[MaxStringLength("1024")]
45+
305: string OperationName = "ai.operation.name";
46+
47+
[Description("The unique identifier of the telemetry item's immediate parent.")]
48+
[MaxStringLength("128")]
49+
310: string OperationParentId = "ai.operation.parentId";
50+
51+
[Description("Name of synthetic source. Some telemetry from the application may represent a synthetic traffic. It may be web crawler indexing the web site, site availability tests or traces from diagnostic libraries like Application Insights SDK itself.")]
52+
[MaxStringLength("1024")]
53+
320: string OperationSyntheticSource = "ai.operation.syntheticSource";
54+
55+
[Description("The cV is a light weight vector clock which can be used to identify and order related events across clients and services.")]
56+
[MaxStringLength("64")]
57+
330: string OperationCorrelationVector = "ai.operation.correlationVector";
58+
59+
[Description("Session ID - the instance of the user's interaction with the app. Information in the session context fields is always about the end user. When telemetry is sent from a service, the session context is about the user that initiated the operation in the service.")]
60+
[MaxStringLength("64")]
61+
400: string SessionId = "ai.session.id";
62+
63+
[Description("Boolean value indicating whether the session identified by ai.session.id is first for the user or not.")]
64+
[MaxStringLength("5")]
65+
[Question("Should it be marked as JSType-bool for breeze?")]
66+
405: string SessionIsFirst = "ai.session.isFirst";
67+
68+
[Description("In multi-tenant applications account ID or name that user is acting with. Examples may be subscription ID for Azure portal or blog name blogging platform.")]
69+
[MaxStringLength("1024")]
70+
505: string UserAccountId = "ai.user.accountId";
71+
72+
[Description("The browser's user agent string as reported by the browser. This property will be used to extract informaiton regarding customer browser, but will not be stored. Use custom properties to store the original user agent.")]
73+
[MaxStringLength("2048")]
74+
510: string UserAgent = "ai.user.userAgent";
75+
76+
[Description("Anonymous user id. Represents the end user of the application. When telemetry is sent from a service, the user context is about the user than initiated the operation in the service.")]
77+
[MaxStringLength("128")]
78+
515: string UserId = "ai.user.id";
79+
80+
[Description("Authenticated user id. As opposite to ai.user.id represents the user with by the friendly name. Since it's PII information it is not collected by default by most SDKs.")]
81+
[MaxStringLength("1024")]
82+
525: string UserAuthUserId = "ai.user.authUserId";
83+
84+
[Description("Name of the role application is part of. Maps directly to the role name in azure.")]
85+
[MaxStringLength("256")]
86+
705: string CloudRole = "ai.cloud.role";
87+
88+
[Description("Name of the instance where application is running. Computer name for on-premisis, instance name for Azure.")]
89+
[MaxStringLength("256")]
90+
715: string CloudRoleInstance = "ai.cloud.roleInstance";
91+
92+
[Description("SDK version. See https://github.com/Microsoft/ApplicationInsights-Home/blob/master/SDK-AUTHORING.md#sdk-version-specification for information.")]
93+
[MaxStringLength("64")]
94+
1000: string InternalSdkVersion = "ai.internal.sdkVersion";
95+
96+
[Description("Agent version. Used to indicate the version of StatusMonitor installed on the computer if it is used for data collection.")]
97+
[MaxStringLength("64")]
98+
1001: string InternalAgentVersion = "ai.internal.agentVersion";
99+
100+
}

EndpointSpecs/Schemas/Bond/Data.bond

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import "Base.bond"
2+
3+
namespace AI
4+
5+
[Description("Data struct to contain both B and C sections.")]
6+
struct Data<TDomain>
7+
: Base
8+
{
9+
[Name("Item")]
10+
[Description("Container for data item (B section).")]
11+
20: required TDomain baseData;
12+
13+
}
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import "DataPointType.bond"
2+
3+
namespace AI
4+
5+
[Description("Metric data single measurement.")]
6+
struct DataPoint
7+
{
8+
[Description("Name of the metric.")]
9+
[MaxStringLength("1024")]
10+
10: required string name;
11+
12+
[Description("Metric type.")]
13+
20: AI.DataPointType kind = Measurement;
14+
15+
[Description("Metric calculated value.")]
16+
30: required double value;
17+
18+
[Description("Metric weight of the aggregated metric. Should not be set for a measurement.")]
19+
40: nullable<int32> count;
20+
21+
[Description("Minimum value of the aggregated metric. Should not be set for a measurement.")]
22+
50: nullable<double> min;
23+
24+
[Description("Maximum value of the aggregated metric. Should not be set for a measurement.")]
25+
60: nullable<double> max;
26+
27+
[Description("Standard deviation of the aggregated metric. Should not be set for a measurement.")]
28+
70: nullable<double> stdDev;
29+
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace AI
2+
3+
[Description("Type of the metric data measurement.")]
4+
enum DataPointType
5+
{
6+
Measurement,
7+
Aggregation,
8+
}
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
namespace AI
3+
4+
[Description("The abstract common base of all domains.")]
5+
struct Domain
6+
{
7+
}
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import "Base.bond"
2+
3+
namespace AI
4+
5+
[Description("System variables for a telemetry item.")]
6+
struct Envelope
7+
{
8+
[Description("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.")]
9+
[Name("SchemaVersion")]
10+
10: int32 ver = 1;
11+
12+
[Description("Type name of telemetry data item.")]
13+
[Name("DataTypeName")]
14+
[MaxStringLength("1024")]
15+
20: required string name;
16+
17+
[Description("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.")]
18+
[Name("DateTime")]
19+
[CSType("DateTimeOffset")]
20+
[JSType("Date")]
21+
[HockeyAppMinDateOffsetFromNow("2592000000")]
22+
[MinDateOffsetFromNow("172800000")]
23+
[MaxDateOffsetFromNow("7200000")]
24+
30: required string time;
25+
26+
[Name("SamplingRate")]
27+
[Description("Sampling rate used in application. This telemetry item represents 1 / sampleRate actual telemetry item.")]
28+
40: double sampleRate = 100.0;
29+
30+
[Description("Sequence field used to track absolute order of uploaded events.")]
31+
[Name("SequenceNumber")]
32+
[MaxStringLength("64")]
33+
50: string seq;
34+
35+
[Description("The application's instrumentation key.")]
36+
[Name("InstrumentationKey")]
37+
[MaxStringLength("40")]
38+
60: string iKey;
39+
40+
[Name("Tags")]
41+
[TypeAlias("ContextTagKeys")]
42+
[Description("Key/value collection of context properties. See ContextTagKeys for information on available properties.")]
43+
500: map<string, string> tags;
44+
45+
[Name("TelemetryData")]
46+
[Description("Telemetry data item.")]
47+
999: Base data;
48+
49+
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import "Domain.bond"
2+
3+
namespace AI
4+
5+
[Description("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.")]
6+
struct EventData
7+
: Domain
8+
{
9+
[Description("Schema version")]
10+
10: required int32 ver = 2;
11+
12+
[MaxStringLength("512")]
13+
[Description("Event name. Keep it low cardinality to allow proper grouping and useful metrics.")]
14+
[Question("Why Custom Event name is shorter than Request name or dependency name?")]
15+
20: required string name;
16+
17+
[Description("Collection of custom properties.")]
18+
[MaxKeyLength("150")]
19+
[MaxValueLength("8192")]
20+
100: map<string, string> properties;
21+
22+
[Description("Collection of custom measurements.")]
23+
[MaxKeyLength("150")]
24+
200: map<string, double> measurements;
25+
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import "Domain.bond"
2+
import "ExceptionDetails.bond"
3+
import "SeverityLevel.bond"
4+
5+
namespace AI
6+
7+
[Description("Instance of Exception represents handled or unhandled exception that occurred during execution of the monitored application.")]
8+
struct ExceptionData
9+
: Domain
10+
{
11+
[Description("Schema version")]
12+
10: required int32 ver = 2;
13+
14+
[Description("Exception chain - list of inner exceptions.")]
15+
50: required vector<ExceptionDetails> exceptions;
16+
17+
[Description("Severity level. Mostly used to indicate exception severity level when it is reported by logging library.")]
18+
60: nullable<AI.SeverityLevel> severityLevel;
19+
20+
[Description("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.")]
21+
[MaxStringLength("1024")]
22+
80: string problemId;
23+
24+
[Description("Collection of custom properties.")]
25+
[MaxKeyLength("150")]
26+
[MaxValueLength("8192")]
27+
100: map<string, string> properties;
28+
29+
[Description("Collection of custom measurements.")]
30+
[MaxKeyLength("150")]
31+
200: map<string, double> measurements;
32+
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import "StackFrame.bond"
2+
3+
namespace AI
4+
5+
[Description("Exception details of the exception in a chain.")]
6+
struct ExceptionDetails
7+
{
8+
[Description("In case exception is nested (outer exception contains inner one), the id and outerId properties are used to represent the nesting.")]
9+
10: int32 id;
10+
11+
[Description("The value of outerId is a reference to an element in ExceptionDetails that represents the outer exception")]
12+
20: int32 outerId;
13+
14+
[Description("Exception type name.")]
15+
[MaxStringLength("1024")]
16+
30: required string typeName;
17+
18+
[Description("Exception message.")]
19+
[MaxStringLength("1024")]
20+
40: required string message;
21+
22+
[Description("Indicates if full exception stack is provided in the exception. Stack may be trimmed, such as in the case of StackOverflow exception.")]
23+
50: bool hasFullStack = true;
24+
25+
[Description("Text describing the stack. Either stack or parsedStack should have a value.")]
26+
[MaxStringLength("32768")]
27+
60: string stack;
28+
29+
[Description("List of stack frames. Either stack or parsedStack should have a value.")]
30+
70: vector<StackFrame> parsedStack;
31+
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import "Domain.bond"
2+
import "SeverityLevel.bond"
3+
4+
namespace AI
5+
6+
[Description("Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are be translated into intances of this type. The message does not have measurements.")]
7+
struct MessageData
8+
: Domain
9+
{
10+
[Description("Schema version")]
11+
10: required int32 ver = 2;
12+
13+
[MaxStringLength("32768")]
14+
[Description("Trace message")]
15+
20: required string message;
16+
17+
[Description("Trace severity level.")]
18+
30: nullable<AI.SeverityLevel> severityLevel;
19+
20+
[Description("Collection of custom properties.")]
21+
[MaxKeyLength("150")]
22+
[MaxValueLength("8192")]
23+
100: map<string, string> properties;
24+
25+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import "Domain.bond"
2+
import "DataPoint.bond"
3+
4+
namespace AI
5+
6+
[Description("Instance of the Metric item is a list of measurements (single data points) and/or aggregations")]
7+
struct MetricData
8+
: Domain
9+
{
10+
[Description("Schema version")]
11+
10: required int32 ver = 2;
12+
13+
[Description("List of metrics.")]
14+
20: required vector<DataPoint> metrics;
15+
16+
[Description("Collection of custom properties.")]
17+
[MaxKeyLength("150")]
18+
[MaxValueLength("8192")]
19+
100: map<string, string> properties;
20+
21+
}

0 commit comments

Comments
 (0)