microsoft / fluent-plugin-application-insights

This is the fluentd output plugin for Azure Application Insights.
MIT License
15 stars 19 forks source link

RemoteDependency `target` property not correctly mapped #7

Open dennis-tra opened 5 years ago

dennis-tra commented 5 years ago

In our setup we're using this plugin to pass our container logs to application insights. We are logging in the following format (sanatized):

{'data':{'baseData':{'data':'fullURL','duration':'00.00:00:00.028268','id':'2fb3e136-a03c-4e6a-a45f-8d72ff24caa3','name':'GET endpointName','resultCode':'200','success':true,'target':'SOMEAPI','type':'HTTP','ver':2},'baseType':'RemoteDependencyData'},'level':'info',,'name':'Microsoft.ApplicationInsights.RemoteDependency','time':'2019-01-28T03:00:47.118448007Z'}

Everything is mapped correctly to the corresponding columns except for the target property. I expected the target column for this remote dependency entry to contain 'SOMEAPI', instead it contains the hostname of 'fullURL'.

As per Azure docs it says 'When the external service doesn't support monitoring, target is set to the host name of the service (for example, stock-prices-api.com)' (https://docs.microsoft.com/en-us/azure/azure-monitor/app/correlation)

I have these three questions:

I had also opened an Azure ticket (REG:119012825000608) which pointed me to opening an issue here.

Thanks for your time :)

yantang-msft commented 5 years ago

The first two questions are kind of complicated to the end user and should be irrelevant to the real problem you're having. But if you are interested, it means if the remote service doesn't have AI SDK installed, the caller (the client in this example) will simply set the target to the remote service's host name. While if the remote service has AI SDK installed, before sending the response, the remote service will inject some special predefined header in the response. In this case, the caller set the 'target' property accordingly like this.

I don't know why the 'target' property is overwritten in the final telemetry, the schema looks good to me. I guess there is some special logic around the ingestion pipeline. @SergeyKanzhelev any ideas?