-
Notifications
You must be signed in to change notification settings - Fork 200
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
Conversation
This pull request introduces 1 alert when merging 9c91ea2 into 46e60d5 - view on LGTM.com new alerts:
|
...c/main/java/com/microsoft/applicationinsights/agent/internal/telemetry/TelemetryChannel.java
Outdated
Show resolved
Hide resolved
...est/java/com/microsoft/applicationinsights/agent/internal/localstorage/IntegrationTests.java
Outdated
Show resolved
Hide resolved
.../main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileCache.java
Show resolved
Hide resolved
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileLoader.java
Outdated
Show resolved
Hide resolved
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 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. |
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? |
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 |
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileLoader.java
Outdated
Show resolved
Hide resolved
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileLoader.java
Outdated
Show resolved
Hide resolved
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileLoader.java
Outdated
Show resolved
Hide resolved
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileLoader.java
Outdated
Show resolved
Hide resolved
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileLoader.java
Outdated
Show resolved
Hide resolved
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileSender.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Trask Stalnaker <[email protected]>
…ub.com/microsoft/ApplicationInsights-Java into heya/write-instrumentation-key-to-disk
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.
looking good. one last question, which test would have caught this issue?
...rc/main/java/com/microsoft/applicationinsights/agent/internal/telemetry/TelemetryClient.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/microsoft/applicationinsights/agent/internal/telemetry/TelemetryClient.java
Outdated
Show resolved
Hide resolved
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileLoader.java
Show resolved
Hide resolved
...est/java/com/microsoft/applicationinsights/agent/internal/localstorage/IntegrationTests.java
Outdated
Show resolved
Hide resolved
...est/java/com/microsoft/applicationinsights/agent/internal/localstorage/IntegrationTests.java
Outdated
Show resolved
Hide resolved
...est/java/com/microsoft/applicationinsights/agent/internal/localstorage/IntegrationTests.java
Outdated
Show resolved
Hide resolved
...main/java/com/microsoft/applicationinsights/agent/internal/localstorage/LocalFileLoader.java
Outdated
Show resolved
Hide resolved
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 |
Fix #1948