Skip to content
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

Persist instrumentation key on disk #1953

Merged
merged 23 commits into from
Nov 10, 2021
Merged

Conversation

heyams
Copy link
Contributor

@heyams heyams commented Nov 4, 2021

Fix #1948

@lgtm-com
Copy link

lgtm-com bot commented Nov 4, 2021

This pull request introduces 1 alert when merging 9c91ea2 into 46e60d5 - view on LGTM.com

new alerts:

  • 1 for Potential input resource leak

@heyams heyams marked this pull request as ready for review November 9, 2021 05:37
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen if user upgrades and they still have prior .trn files without the ikey in them?

@heyams
Copy link
Contributor Author

heyams commented Nov 9, 2021

what will happen if user upgrades and they still have prior .trn files without the ikey in them?

if they have .trn that is not older than 48 hours.. it will get sent to App Insights backend. for anything that is older than 48 hours, purger would take care of it.

@trask
Copy link
Member

trask commented Nov 9, 2021

if they have .trn that is not older than 48 hours.. it will get sent to App Insights backend. for anything that is older than 48 hours, purger would take care of it.

did I miss the code that is handling reading in the old file format with no ikey embedded?

@heyams
Copy link
Contributor Author

heyams commented Nov 9, 2021

if they have .trn that is not older than 48 hours.. it will get sent to App Insights backend. for anything that is older than 48 hours, purger would take care of it.

did I miss the code that is handling reading in the old file format with no ikey embedded?

if old trn that doesn't have instrumentation key, it will not get sent. in that case it will get purged out after 48 hours. should i add the purge to include files that are missing instrumentation key?

@trask
Copy link
Member

trask commented Nov 9, 2021

if old trn that doesn't have instrumentation key, it will not get sent. in that case it will get purged out after 48 hours. should i add the purge to include files that are missing instrumentation key?

have you tested this? my guess from the code is that it will cause errors because we will parse the first 36 bytes into an ikey, and then the rest of the json message will be corrupted

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good. one last question, which test would have caught this issue?

@heyams
Copy link
Contributor Author

heyams commented Nov 10, 2021

looking good. one last question, which test would have caught this issue?

how to mock a readonly system? we might need to add a smoke test for readonly?

@trask
Copy link
Member

trask commented Nov 10, 2021

looking good. one last question, which test would have caught this issue?

how to mock a readonly system? we might need to add a smoke test for readonly?

sorry, by "this issue" I mean the one that this PR addresses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error sending telemetry items: instrumentationKey must be non-null
2 participants