- Given a browser Single Page Application
- When using AppInsights JS SDK v2.5.3
- Then I want a CustomServiceName to be sent with ALL requests.
a) Should the custom properties be on the envelope.data
, env.data.baseData
or envelope.data.properties
?
It appears to change depending on the type of call made.
b) Can I set the CustomServiceName
on the operation context instead of EVERY request instead?
Currently we are using this
var telemetryInitializer = (envelope) => {
envelope.tags["ai.application.ver"] = "1.2.3";
if (envelope.data) {
envelope.data["CustomServiceName"] = "MyName";
if (envelope.data.properties) {
envelope.data.properties["CustomServiceName"] = "MyName";
}
}
};
aisdk.addTelemetryInitializer(telemetryInitializer);
Based on https://github.com/microsoft/ApplicationInsights-JS#telemetry-initializers