Applicationinsights-js: Regression in v2: "Field 'name' on type 'RemoteDependencyData' is too long" with long URL

Created on 11 Jun 2019  路  3Comments  路  Source: microsoft/ApplicationInsights-JS

Seems issue #369 came back in v2... seeing a lot of these in SharePoint Online when using the OOTB AI JS v2 SDK:

Field 'name' on type 'RemoteDependencyData' is too long. Expected: 1024 characters, Actual: 1242

image

bug

All 3 comments

Thanks for the report, I've fixed this in #933 which will land in 2.0.2

Hello! I am still having this problem! My config is almost identical to this example, and my dependencies are as follows:

"@microsoft/applicationinsights-react-js": "^2.0.2", 
"@microsoft/applicationinsights-web": "^2.0.1", 

Would really appreciate some help. Thank you!

Hi @ecezalp 2.0.2 hasn't shipped yet, but for now you can add a (non-breaking) telemetry initializer in the meantime

appInsights.addTelemetryInitializer(item => {
    if (item.baseType === 'RemoteDependencyData') {
        if (item.baseData.name.length > 1024) {
            item.baseData.name = item.baseData.name.substring(0, 1024);
        }
    }
});
Was this page helpful?
0 / 5 - 0 ratings