Closed lmolkova closed 6 years ago
Are you referring to default properties on the TelemetryContext (role name, role instance would fall into this bucket) or custom properties on all telemetry items? ApplicationInsights-Go has the former but not the latter. To set the role name+instance for all telemetry submitted, one would need to simply add:
client := appinsights.NewTelemetryClient("<ikey>")
client.Context().Cloud().SetRoleName("role-name")
client.Context().Cloud().SetRoleInstance("role-instance")
I assume that's what you meant as it is what the issue you linked refers to. Setting custom properties on all outgoing telemetry is not currently supported, but I can certainly see the use case for it. (We additionally want to set things like "Resource group" on all telemetry, and there is not a good place to put it in the TelemetryContext
).
Nevermind, after taking another look I see what you're driving at (the latter). I think that's a reasonable thing to add.
All official AI SDKs allow setting arbitrary properties to the context either through TelemetryInititalizers or through TelemetryClient/TelemetryContext api.
E.g. in Node:
Additionally, I'd suggest following .NET SDK approach (whatever will be decided in https://github.com/Microsoft/ApplicationInsights-dotnet/issues/630)