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

Use the JavaAgent on a read-only filesytem #1673

Closed
florianrusch opened this issue May 5, 2021 · 0 comments · Fixed by #1945
Closed

Use the JavaAgent on a read-only filesytem #1673

florianrusch opened this issue May 5, 2021 · 0 comments · Fixed by #1945

Comments

@florianrusch
Copy link

Is your feature request related to a problem? Please describe.

Yes – on kubernetes it's a best practise to start the pods/container with a read-only filesystem to prevent certain attacks on the infrastructure. Sadly the applicationinsights java agent seems to need write permissions at least at this location: /tmp/applicationinsights-java

Describe the solution you would like

I would like to usr the java agent on a read only filesystem.

Additional context

Error message:

2021-05-05 06:05:47.518Z ERROR c.m.applicationinsights.agent - ApplicationInsights Java Agent 3.0.4-BETA failed to start
java.lang.IllegalStateException: Could not create directory: /tmp/applicationinsights-java
	at com.microsoft.applicationinsights.agent.internal.AiComponentInstaller.start(AiComponentInstaller.java:120)
	at com.microsoft.applicationinsights.agent.internal.AiComponentInstaller.beforeByteBuddyAgent(AiComponentInstaller.java:89)
	at io.opentelemetry.javaagent.tooling.AgentInstaller.installComponentsBeforeByteBuddy(AgentInstaller.java:180)
	at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:114)
	at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:98)
	at com.microsoft.applicationinsights.agent.internal.wasbootstrap.MainEntryPoint.start(MainEntryPoint.java:82)
	at io.opentelemetry.javaagent.tooling.AgentInstallerOverride.installBytebuddyAgent(AgentInstallerOverride.java:11)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.opentelemetry.javaagent.bootstrap.AgentInitializer.startAgent(AgentInitializer.java:50)
	at io.opentelemetry.javaagent.bootstrap.AgentInitializer.initialize(AgentInitializer.java:30)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:66)
	at com.microsoft.applicationinsights.agent.Agent.premain(Agent.java:41)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
@trask trask added this to the future milestone Jul 23, 2021
@ghost ghost added the Status: Fixed label Nov 4, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants