ApplicationInsights-Java icon indicating copy to clipboard operation
ApplicationInsights-Java copied to clipboard

Add support to define directory for offline logging

Open HonzaV opened this issue 7 months ago • 2 comments

Is your feature request related to a problem? Please describe. I need to store offline logs in case of AppInsights outage in persistent volume. Current implementation uses path stored in java.io.tmpdir, but this directory can be used by other frameworks, therefore it is not good idea to mount it to persistent volume.

Docs: https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-configuration?tabs=java#offline-storage-and-automatic-retries

Describe the solution you would like Environment variable or field in applicationinsights.json to set directory for temp offline logs for applicaiton-insights-runtime-attach.json

Describe alternatives you have considered I did not find any solution. Maybe usage of other deps, which enable us to define the log path?

HonzaV avatar May 26 '25 08:05 HonzaV

hi @HonzaV, the files should be stored in a subdirectory under tmp, which shouldn't be shared by any other frameworks, does that work for you?

trask avatar May 29 '25 00:05 trask

hi @HonzaV, the files should be stored in a subdirectory under tmp, which shouldn't be shared by any other frameworks, does that work for you?

Hi @trask , thanks for answer. Well I would find much more convenient to just point ApplicaitonInsights wherever I need, rather than trying to mount the persistent volume into tmp/{user.name}/applicationinsights/telemetry subfolder. I think this could possibly work also, but the folder it self may or may not exist (I think AI creates the folder only when there is a connection issue, right?) so there can be rights issues and I am not quite sure, if the stored logs would outlive the container when mounted this way.

HonzaV avatar Jun 18 '25 11:06 HonzaV