odigos-io / odigos

Distributed tracing without code changes. 🚀 Instantly monitor any application using OpenTelemetry and eBPF

Home Page:https://odigos.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multiple application/languages running in the same container flip-flop the instrumentation

esara opened this issue · comments

Describe the bug
We have containers where the container runs more then one process, one in java and another process is in python.
The actual use cases is that the main business logic is in java, but python provides a diagnostics interface.
During autoinstrumentation odigos sometimes finds the java process and later finds the python process, changes the instrumentedapp cr and restarts the application with a different instrumenation (only one of them).

To Reproduce
Create a docker image with a java process as pid1, but also a python background process running like:

$ cat entrypoint.sh 

export STARTUP_COMMAND="java $JAVA_OPTS -jar $@"

# Start up the http server
/usr/bin/nohup /diags.py >/tmp/diags.log &

echo "Executing startup command: \"$STARTUP_COMMAND\""
exec env PATH=$PATH $STARTUP_COMMAND

Expected behavior
a) It would be great to detect the language of the pid 1 process as this should be consistent and not change even after the restart of the process.
b) Alternatively, we can detect multiple languages and inject the instrumentation and env variables to all detected languages

Thanks for reporting this and #1085. Both of those are good catches and something we are definitely going to address. We've been working on other bugs to do with our controller reconciliation loops recently as well.

Meanwhile, if there's anyone else who wants to take a look and needs a sparring partner, reach out to the team on slack!