none
Correct JSON structure for custum.dimensions RRS feed

  • Question

  • Hi,

    would you say that the below JSON structure for the dimensions array is ok?

    {
    	"context": {
    		"application": {
    		"version": "1.0.0.0"
    		},	
    		"cloud": {},
    		"custom": {
    		"dimensions": [{
    				"CustomerId": "cId_1"
    			},
    			{ 
    				"BookingId": "bId_1"
    			}]
    		}
    	}
    }

    Many thanks in advance


    Friday, September 20, 2019 9:30 AM

All replies

  • Hello Zimbet,

    The correct structure would require the full envelope (dimensions are called properties) and will be something like this:

    {
    	"name": "Microsoft.ApplicationInsights.PickEventNameHere",
    	"time": "2019-09-23T19:27:15.1119273Z",
    	"iKey": "You Ikey Here",
    	"tags": {
    		"ai.cloud.role": "YourRole",
    		"ai.cloud.roleInstance": "YourInstance",
    		"ai.operation.id": "OperationIdHere",
    		"ai.operation.parentId": "ParentIdHere",
    		"ai.internal.sdkVersion": ""
    	},
    	"data": {
    		"baseType": "DataTypeHereForExample EventData",
    		"baseData": {
    			"ver": 2,
    			"name": "NameForTheEvent",
    			"id": "IdOfTheEvent",
    …
    			"properties": {
    				"TestName": "TestValue"
    			}
    		}
    	}

    You can look up schema definitions for AI Endpoint on GitHub page here.

    Also, one easy way to get the right schema is to use a tool like Fiddler to capture outgoing HTTPS traffic from the machine to get the actual AI SDK package on the wire, then you can mimic the same JSON if necessary.

    You can send events to /v2/validate endpoint to check whether they will be accepted in their current form: https://dc.services.visualstudio.com/v2/validate


    Dmitry Matveev


    Monday, September 23, 2019 7:33 PM
    Owner