-
Notifications
You must be signed in to change notification settings - Fork 135
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
Adding Attach and Feature Statbeats #799
Conversation
if (process.env.WEBSITE_SITE_NAME) { // Web apps | ||
this._resourceProvider = Constants.StatsbeatResourceProvider.appsvc; | ||
this._resourceIdentifier = process.env.WEBSITE_SITE_NAME; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heyams Current specs says WEBSITE_SITE_NAME/WEBSITE_HOME_STAMPNAME
for rpid
. Does this mean the literal string (with the slash concatenating the two), or choose WEBSITE_SITE_NAME
if available, otherwise WEBSITE_HOME_STAMPNAME
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect WEBSITE_SITE_NAME/WEBSITE_HOME_STAMPNAME. if stampName is empty, it will be "{WEBSITE_SITE_NAME}/". yes.
} else if (process.env.FUNCTIONS_WORKER_RUNTIME) { // Function apps | ||
this._resourceProvider = Constants.StatsbeatResourceProvider.function; | ||
if (process.env.WEBSITE_HOSTNAME) { | ||
this._resourceIdentifier = process.env.WEBSITE_HOSTNAME; | ||
} | ||
} else if (this._config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the application is not in any of these rps? We probably shouldn't be sending this stats at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rp has a default case: "unknown". like standalone apps.. it's not an attach scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so we should not be sending any of the "attach" metrics in this default case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heyams can you confirm we don't send attach Statbeat for unknown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to track unknown as well.. i.e. non-attach vs. attach. that's a good data trend to show.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we populate for properties then? Do we just leave empty? Does metric have same name and fields?
"language": this._language, | ||
"version": this._sdkVersion | ||
} | ||
this._statbeatMetrics.push({ name: Constants.StatsbeatCounter.ATTACH, value: 1, properties: attachProperties }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attach statsbeat is every 15 mins. feature is every 24 hours. you might want to have a separate method for attach and one for feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heyams For applications that exit before 24 hours, do we send a statsbeat telemetry upon exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heyams Why attach is being sent every 15 minutes?, are you expecting rpId to be updated that often?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the same interval as the azure metadata service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vm id can get changed frequently, which impacts rpId for vm. other attach scenarios is not an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heyams For applications that exit before 24 hours, do we send a statsbeat telemetry upon exit?
it will be nice. currently java doesn't do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not only about "nice". If applications exit, there may be cases where we never get the telemetry. We MUST flush before exit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hectorhdzg probably not blocking for this pr though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lzchen we flush all telemetry on exit, but we do not create telemetry on exit, we don't want to do that, that will make sense with high priority telemetry, maybe something that actually let users know that the app stopped running, but that doesn't apply with Statsbeats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Something to bring up at tomorrow's meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor constant renaming.. other than that, looks good to me.
let attachProperties = { | ||
"os": this._os, | ||
"rp": this._resourceProvider, | ||
"rpid": this._resourceIdentifier, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, what will undefined
serialize as? Empty string? This is for the case when rp
== unknown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._resourceIdentifier defaults to "unknown" so it supposed to never be undefined, are you seeing something here?
I believe undefined properties are dropped when serializing JSON, at least they are when running this in the browser
JSON.stringify({"test":undefined})
"{}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So on non-attach scenario, the payload would look like: {"rp": "unknown"} with no "rpid" correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually rpid is also included, something like this {"rp": "unknown","rpid": "unknown"}
"language": this._language, | ||
"version": this._sdkVersion, | ||
"attach": this._attach, | ||
"feature": this._features, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "aad handling" is listed as a feature. Will stats be released as the next beta version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hectorhdzg is aad handling the same as tracking aad enablement? i check your repo.. look like this is not added anywhere to the feature list. it only happens in tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only have AAD feature in beta branch, I'm planning to update beta with latest changes in main for next release including Statsbeat implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hectorhdzg
So statsbeats will be released as the next beta package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statbeats will be part of both releases, beta and regular one
Statsbeats metrics related to instrumentations have not been added yet correct? @hectorhdzg |
"language": this._language, | ||
"version": this._sdkVersion, | ||
"attach": this._attach, | ||
"feature": this._features, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heyams @hectorhdzg Do we have a comprehensive list of all the features
we will be tracking for each language? It would also be good to coordinate bit representations for common features across our sdks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each language will have their own specific features.. tracking AAD enablement will be a common feature.. other than that, there is nothing else i can think of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about local storage? Standard metrics? Pre-aggregated metrics? Live metrics? All of these are/will be features that will be supported by all sdks so we should agree on a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lzchen having a shared list of features will make easier the data consumption here, happy to add them once we agree on them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statsbeat is designed only for Breeze endpoints. Live metrics is not tracked. Java hasn't implemented pre-aggregated metrics and standard metrics yet.
I am planning to create a new set of statsbeat metrics for Local Storage. As of now, AAD is the only common feature. Let's get the basic Statsbeat done first and we can add the rest as Statsbeat evolves.. A list to agree upon at this moment is premature. Please document it somewhere for future consideration. (cc @ramthi)
@lzchen we send instrumentation property in all network Statsbeats, I don't believe there is an "Instrumentation" specific one. |
No description provided.