Skip to content

Commit

Permalink
Diagnostic Contract Fix (#8271)
Browse files Browse the repository at this point in the history
* Diagnostic Contract update

* there is no enableHttpCorrelation in 2019-12-01-preview
  • Loading branch information
solankisamir authored Feb 4, 2020
1 parent 2474c56 commit 0603855
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1784,9 +1784,63 @@
"$ref": "#/definitions/PipelineDiagnosticSettings",
"description": "Diagnostic settings for incoming/outgoing HTTP messages to the Backend"
},
"enableHttpCorrelationHeaders": {
"logClientIp": {
"type": "boolean",
"description": "Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true."
"description": "Log the ClientIP. Default is false."
},
"httpCorrelationProtocol": {
"type": "string",
"enum": [
"None",
"Legacy",
"W3C"
],
"x-ms-enum": {
"name": "HttpCorrelationProtocol",
"modelAsString": true,
"values": [
{
"value": "None",
"description": "Do not read and inject correlation headers."
},
{
"value": "Legacy",
"description": "Inject Request-Id and Request-Context headers with request correlation data. See https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HttpCorrelationProtocol.md."
},
{
"value": "W3C",
"description": "Inject Trace Context headers. See https://w3c.github.io/trace-context."
}
]
},
"description": "Sets correlation protocol to use for Application Insights diagnostics."
},
"verbosity": {
"type": "string",
"enum": [
"verbose",
"information",
"error"
],
"x-ms-enum": {
"name": "Verbosity",
"modelAsString": true,
"values": [
{
"value": "verbose",
"description": "All the traces emitted by trace policies will be sent to the logger attached to this diagnostic instance."
},
{
"value": "information",
"description": "Traces with 'severity' set to 'information' and 'error' will be sent to the logger attached to this diagnostic instance."
},
{
"value": "error",
"description": "Only traces with 'severity' set to 'error' will be sent to the logger attached to this diagnostic instance."
}
]
},
"description": "The verbosity level applied to traces emitted by trace policies."
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,43 @@
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/diagnostics/applicationinsights",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api/diagnostics/applicationinsights",
"type": "Microsoft.ApiManagement/service/apis/diagnostics",
"name": "applicationinsights",
"properties": {
"alwaysLog": "allErrors",
"loggerId": "/loggers/applicationinsights",
"httpCorrelationProtocol": "Legacy",
"logClientIp": true,
"loggerId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest",
"sampling": {
"samplingType": "fixed",
"percentage": 50
"percentage": 100
},
"frontend": {
"request": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
},
"response": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
}
},
"backend": {
"request": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
},
"response": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,43 @@
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights",
"type": "Microsoft.ApiManagement/service/diagnostics",
"name": "applicationinsights",
"properties": {
"alwaysLog": "allErrors",
"loggerId": "/loggers/applicationinsights",
"httpCorrelationProtocol": "Legacy",
"logClientIp": true,
"loggerId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest",
"sampling": {
"samplingType": "fixed",
"percentage": 50
"percentage": 100
},
"frontend": {
"request": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
},
"response": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
}
},
"backend": {
"request": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
},
"response": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,56 @@
"resourceGroupName": "rg1",
"api-version": "2019-12-01-preview",
"subscriptionId": "subid",
"apiId": "57d1f7558aa04f15146d9d8a"
"apiId": "echo-api"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/diagnostics/applicationinsights",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api/diagnostics/applicationinsights",
"type": "Microsoft.ApiManagement/service/apis/diagnostics",
"name": "default",
"name": "applicationinsights",
"properties": {
"alwaysLog": "allErrors",
"loggerId": "/loggers/applicationinsights",
"httpCorrelationProtocol": "Legacy",
"logClientIp": true,
"loggerId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest",
"sampling": {
"samplingType": "fixed",
"percentage": 50
"percentage": 100
},
"frontend": {
"request": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
},
"response": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
}
},
"backend": {
"request": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
},
"response": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 100
}
}
}
}
}
],
"nextLink": ""
]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,63 @@
"body": {
"value": [
{
"id": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/applicationinsights",
"type": "Microsoft.ApiManagement/service/diagnostics",
"name": "applicationinsights",
"properties": {
"alwaysLog": "allErrors",
"loggerId": "/loggers/applicationinsights",
"httpCorrelationProtocol": "Legacy",
"verbosity": "information",
"logClientIp": true,
"loggerId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/aisamplingtest",
"sampling": {
"samplingType": "fixed",
"percentage": 50
"percentage": 100
},
"frontend": {
"request": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 0
}
},
"response": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 0
}
}
},
"backend": {
"request": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 0
}
},
"response": {
"headers": [
"Content-type"
],
"headers": [],
"body": {
"bytes": 512
"bytes": 0
}
}
}
}
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/diagnostics/azuremonitor",
"type": "Microsoft.ApiManagement/service/diagnostics",
"name": "azuremonitor",
"properties": {
"logClientIp": true,
"loggerId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/azuremonitor",
"sampling": {
"samplingType": "fixed",
"percentage": 100
}
}
}
],
"nextLink": ""
]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,10 @@
"$ref": "#/definitions/PipelineDiagnosticSettings",
"description": "Diagnostic settings for incoming/outgoing HTTP messages to the Backend"
},
"enableHttpCorrelationHeaders": {
"type": "boolean",
"description": "Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true."
},
"httpCorrelationProtocol": {
"type": "string",
"enum": [
Expand Down

0 comments on commit 0603855

Please sign in to comment.