-
Notifications
You must be signed in to change notification settings - Fork 74
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
fetchDevices() and update banner telemetry #519
Conversation
Update Banner Telemetry
FetchDevices() telemetry
try { | ||
const response = await request(DATAPLANE_CONTROLLER_ENDPOINT, dataPlaneRequest); | ||
AppInsightsClient.getInstance()?.trackEvent({name: TELEMETRY_EVENTS.FETCH_DEVICES}, {status: response.status.toString(), statusText: response.statusText}); | ||
const result = await dataPlaneResponseHelper(response); | ||
return result; | ||
} catch (e) { | ||
AppInsightsClient.getInstance()?.trackEvent({name: TELEMETRY_EVENTS.FETCH_DEVICES}, {status: 'N/A', statusText: e.toString()}); | ||
throw (e); | ||
} |
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.
Just a thought for the future -
Seems like this method has use outside of just fetching devices (even though that's the only place it's used for now). Possibly in a future PR we could abstract this to a helper function that takes an endpoint, request, and telemetry type;
export const fetchWithTelemetry(endpoint: string, request: any, telemetryType: {enum_or_telemetry_type_TBD})
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.
LGTM. Let's tackle Ryan's comment once we start to add more telemetry in this area which has us from the duplicate imports and implementations.
Also, I am assuming the 'init' event is just for internal use not going to be displayed on any dashboard correct?
Yes, I was originally using the init event to tell when my app refreshed within the log but I'm likely going to repurpose it for some actual one-time logging in the future |
Added logging to collect data on the fetchDevices() server call and whether people interact with the update version banner
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Thank you for contributing to the Azure IoT Explorer!
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
npm run test
command)