https://linen.dev logo
Hello again 👋 !
# mirrord-help
b
Hello again 👋 ! Anyone already tried to use OTEL autoinstrumentation with mirrord ? It seems to not work since Rider with mirrord plugin does not launch the dotnet process using the
instrument.sh
and I am wondering if there is any workaround to make it work. Thanks in advance 🙏
m
Hey, I'm not familiar with OTEL autoinstrumentation, but what's going on? You execute your rider project with mirrord, and it must also run this
instrument.sh
as a separate step?
b
Hey @meowchinist, Extract from a dockerfile that is using autoinstrumentation :
Copy code
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "App.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false && chmod +x /app/publish/instrument.sh

FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base
USER 1000
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["./instrument.sh", "dotnet", "App.dll"]
here is the link for the script : https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/instrument.sh Don't know at all if this is compatible with the way we should run the script before the dotnet command. Also another question about debugger experience (but maybe this one is more for OTEL community)
m
hmm this
"./instrument.sh", "dotnet", "App.dll"
should be compatible with mirrord, like
mirrord exec -- ./instrument.sh dotnet App.dll
(if I'm understanding it correctly, this would be how you run it from a terminal)
it's missing a mirrord config file, that you may need one to set things up properly
b
That looks a nice starting point to at least build a version locally and steal traffic from a cluster without debugging 👀
m
you should be able to get something similar going in rider, I don't know exactly how though, but do you have some sort of run configuration there? If so then just enabling mirrord should work
b
Indeed the script seems to only set some env variable, maybe a Before launch task to run this script can be enough 👀
m
hm hm
b
I'll try this tomorrow morning and keep this thread posted up in case it can help anyone else 🙏
Thanks for jumping in ! 😄
m
no worries
Also check this out https://metalbear.com/mirrord/docs/config/options#feature.env maybe you can set the env vars you need in this config