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

Allow preset values to be configured #639

Closed
scott-the-programmer opened this issue Oct 14, 2021 · 4 comments
Closed

Allow preset values to be configured #639

scott-the-programmer opened this issue Oct 14, 2021 · 4 comments
Assignees

Comments

@scott-the-programmer
Copy link

Allow preset values to be configured

Modifying preset values such as maxDirectorySize and maxFileAgeForRead would be useful for clients to be able to tailor to their specific use case.

Personally, I think the cleanest way might be to allow leverage set(additionalConfiguration) introduced by #456 and propagate that down to PerformancePreset

Datadog.Configuration
       .set(additionalConfiguration: ["performance": ["maxDirectorySize": 512 * 1_024 * 1_024]])

Keen to know everyone else's thoughts!

@buranmert buranmert self-assigned this Oct 15, 2021
@buranmert
Copy link
Contributor

hi @scott-the-programmer

can you tell us more about your use case?

@scott-the-programmer
Copy link
Author

The main reason would be to provide an absolute limit on the logs accumulated before trackingConsent is acknowledged. From the looks of it, this could be covered by setting maxDirectorySize.

In the absolute worst case, while trackingConsent is pending, verbose logging could store up to 512mb of logs that could potentially be shipped to datadog in a relatively short period of time.

@buranmert
Copy link
Contributor

buranmert commented Oct 18, 2021

in order to avoid such cases, we do upload file by file; so the upper bound of an upload should be maxFileSize (which is by default 4Mb). if you have 512Mb of logs collected, it should be uploaded in roughly 512 / ~4 = ~128 batches and the interval between two uploads is on average 5 seconds (128 * 5 seconds = ~10.6 minutes).

you can play with batch size and upload frequency parameters to change the values above.

also, since we use iOS' Caches folder and logs collected at .pending mode are not carried over to the next app launch (they are discarded), having 512Mb of logs is really the absolute worst case as you said.

please let me know if your concerns are addressed; if not, we can try to find a solution 🤞

@buranmert
Copy link
Contributor

i'm hoping the concern is addressed and closing the issue.
feel free to reopen if needed.

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

No branches or pull requests

2 participants