-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper intended usage of ITelemetry.Context.GlobalProperties #923
Comments
#820 - Can you take a look at this and see if it helps answer your question? |
Thank you... I did already read that, but I didn't find it clear how I should take advantage of it. (I love Application Insights, I'm just trying to use it correctly.) To me, what #820 says is, essentially, "we're making a change to the API to help the back-end behave differently... and here are a couple of ways that might happen", but it doesn't make it clear (to me, anyway) how I should use Here are some things I'm wondering about that hopefully give some orientation to the answer (and the documentation) that I'm looking for: If I have the same key in Just putting my API Design hat on for a second (and I'm not suggesting a late name change, just thinking out loud)... calling it If I use the same Application Insights instance for my back-end server AI telemetry, and my front-end browser AI telemetry, is that still OK? The things that I think of as "global" for my front-end are different from what I consider to be "global" for my ASP.NET Core back-end. Maybe it's more of a Or maybe I'm going to love the proposed new UI features to allow for fast filtering by keys in I'm sure you have a clear intention for this feature beyond what was in #820, but from the usage side, with no other documentation and no UI to look at, I'm still not clear about it. Do you have any examples you've worked through while developing Thanks... I really appreciate your time on this. 🙂 |
@ScottArbeit Been busy with some deliverables. I will read this again and respond! Thanks for your patience. |
@ScottArbeit If the number of keys remains low, but the values vary a lot - its high cardinality and belong to ISupportProperties.Properties. GlobalProperties is intended for values which are low in cardinality. "Global" name was used to distinguish from a property from being applicable to just an individual telemetry item (eg: operation id etc.) vs entire application (eg: name of cloud instance). We'll eventually change serialization formats and then changes in backend as well - I don't yet have a shareable timeline, but it'll most likely be in a 3.xx version of the SDK. (we are about to ship 2.8 in couple weeks). Let me know if this helped with your question (atleast partially!). Do share your comments and feedbacks. |
Can someone please confirm it is safe to use ITelemetry.TelemetryContext.GlobalProperties to carry values that vary by say ASP.NET MVC Request? In other words, can someone confirm "Global" does not mean "App-Global" or "App-Domain"? If I have multiple web requests running in parallel, each one will have its own TelemetryContext and hence its own GlobalProperties, correct? |
While its safe to use GlobalProperties for things which vary by request, but it's best to use ISupportProperties.Properties, if the cardinality of values for the field is high. |
If I have multiple web requests running in parallel, each one will have its own TelemetryContext and hence its own GlobalProperties, correct? - This is correct. TelemetryContext is per TelemetryItem. (there is alsoa way to set TelemetryContext on TelemetryClient itself, which would be shared) |
Okay, this made it clear. The low cardinality of values is the main criteria. Thanks! |
This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Hi!
I'm changing over to using
.GlobalProperties
, and I have a quick question about the intention behind it.In my ASP.NET Core app, I have a
CustomTelemetryInitializer
class, and in myInitialize()
implementation I put about a dozen properties on each telemetry item. Three of those properties have constant values that will not change for the lifetime of the app instance; obviously those should go into.GlobalProperties
.The other properties I capture in
Initialize()
may change values between each new telemetry item being created (for instance,currentProcess.Threads.Count
andcurrentProcess.HandleCount
). So... the same property keys are on every telemetry item, but the property values are different.Are those properties - the kind where I have the same keys on every item from my app, but values that change over time - intended for
.GlobalProperties
?(I also populate
ISupportProperties.Properties
with details from each call site, obviously they're not global.)I guess I'm asking if the "global" part of .GlobalProperties applies to the pair <key, value> or just the key. Just looking for the best way to take advantage of the new API surface and any indexing changes you make in the back-end.
Thanks!
The text was updated successfully, but these errors were encountered: