Skip to content

run example/demo error on Mac,no tracing generated #3586

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

Closed
caterchong opened this issue Aug 22, 2024 · 5 comments · Fixed by #4145
Closed

run example/demo error on Mac,no tracing generated #3586

caterchong opened this issue Aug 22, 2024 · 5 comments · Fixed by #4145
Assignees
Milestone

Comments

@caterchong
Copy link

Bug Report

Symptom

Mac's chip: Apple M2 pro
docker: docker desktop(v4.33.0). settings->General-> User Rosetta for x86_64/amd64 emulation on Apple Silicon opened.

make

There is no tracing. in demo/log dir, all log files are empty.

check demo-service, /var/log/opentelemetry/dotnet/otel-dotnet-auto-1-Examples.Service-StartupHook-20240822.log

[Error] CLR profiler (64bit) is not found at '/otel-dotnet-auto/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so'. Recheck 'CORECLR_PROFILER_PATH'.

should auto instrument and output tracing normally

bug reason

in demo/otel-dotnet.env

CORECLR_PROFILER_PATH="/otel-dotnet-auto/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so"

It's hard-coded to linux-x64

@RassK
Copy link
Contributor

RassK commented Aug 22, 2024

I guess the emulator outputs environment as Linux. In case of using emulators you may need to tweak the envs manually using https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/docs/config.md

@caterchong
Copy link
Author

the emulator outputs the right environment variable , linux with arm64 arch.

docker build works fine, intalls the right so,

/otel-dotnet-auto/linux-arm64/OpenTelemetry.AutoInstrumentation.Native.so

docker-compose.yaml

    env_file:
      - otel-dotnet.env # enables OpenTelemetry .NET Automatic Instrumentation

otel-dotnet.env hardcode CORECLR_PROFILER_PATH with linux-x64 ,which is wrong under mac m2 pro.

/otel-dotnet-auto/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so

@RassK
Copy link
Contributor

RassK commented Aug 29, 2024

the emulator outputs the right environment variable , linux with arm64 arch.

@caterchong Shouldn't it be linux-x64 after the emulation? If emulator outputs arm64 instead of x64, it's definitely wrong.
It should be x64 for the application, so emulator translates x64 to arm64.

@pjanotti
Copy link
Contributor

pjanotti commented Sep 9, 2024

I couldn't get hold of a arm mac to try to repro this. Until some dev on the SIG can get a hold of one it is going to be hard to make progress without detailed repro steps.

@Kielek Kielek modified the milestones: 1.8.0, 1.9.0 Sep 12, 2024
@pjanotti pjanotti assigned Kielek and unassigned pjanotti Oct 2, 2024
@pjanotti pjanotti modified the milestones: 1.9.0, vNext Oct 2, 2024
@pjanotti pjanotti assigned pjanotti and unassigned Kielek Feb 12, 2025
@pjanotti pjanotti moved this from Backlog to Committed in OpenTelemetry .NET Automatic Instrumentation Feb 12, 2025
@pjanotti pjanotti modified the milestones: vNext, 1.11.0 Feb 12, 2025
@Kielek Kielek modified the milestones: 1.11.0, 1.12.0 Mar 6, 2025
@pjanotti
Copy link
Contributor

Ok I got a repro for this one on mac arm, I will investigate as time permits.

# cat ./otel-dotnet-auto-1-Examples.Service-StartupHook-20250326.log
[2025-03-26T15:27:55.3208992Z] [Information] Rule Engine: MinSupportedFrameworkRule evaluation success. 
[2025-03-26T15:27:55.4070635Z] [Information] Rule Engine: OpenTelemetrySdkMinimumVersionRule evaluation success. 
[2025-03-26T15:27:55.4289542Z] [Error] CLR profiler (64bit) is not found at '/otel-dotnet-auto/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so'. Recheck 'CORECLR_PROFILER_PATH'. 
[2025-03-26T15:27:55.4314034Z] [Error] Rule 'Native profiler diagnoser' failed: Verifies that native profiler is correctly setup in case it's enabled. 
[2025-03-26T15:27:55.4381837Z] [Error] Error in StartupHook initialization: LoaderFolderLocation: /otel-dotnet-auto/net
Exception: Rule Engine Failure: One or more rules failed validation. Automatic Instrumentation won't be loaded.
System.Exception: Rule Engine Failure: One or more rules failed validation. Automatic Instrumentation won't be loaded.
   at StartupHook.Initialize() in /_/src/OpenTelemetry.AutoInstrumentation.StartupHook/StartupHook.cs:line 34 
# export
export APP_UID='1654'
export ASPNETCORE_HTTP_PORTS='8080'
export ASPNET_VERSION='8.0.6'
export CORECLR_ENABLE_PROFILING='1'
export CORECLR_PROFILER='{918728DD-259F-4A6A-AC2B-B85E1B658318}'
export CORECLR_PROFILER_PATH='/otel-dotnet-auto/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so'
export DB_CONNECTION='Server=sqlserver,1433;User=sa;Password=yourStrong(!)Password;TrustServerCertificate=True;'
export DOTNET_ADDITIONAL_DEPS='/otel-dotnet-auto/AdditionalDeps'
export DOTNET_GENERATE_ASPNET_CERTIFICATE='false'
export DOTNET_NOLOGO='true'
export DOTNET_RUNNING_IN_CONTAINER='true'
export DOTNET_SDK_VERSION='8.0.302'
export DOTNET_SHARED_STORE='/otel-dotnet-auto/store'
export DOTNET_STARTUP_HOOKS='/otel-dotnet-auto/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll'
export DOTNET_USE_POLLING_FILE_WATCHER='true'
export DOTNET_VERSION='8.0.6'
export HOME='/root'
export HOSTNAME='1faed357bd40'
export NUGET_XMLDOC_MODE='skip'
export OLDPWD='/var/log/opentelemetry'
export OTEL_DOTNET_AUTO_HOME='/otel-dotnet-auto'
export OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES='Examples.Service'
export OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_SOURCES='Examples.Service'
export OTEL_EXPORTER_OTLP_ENDPOINT='http://otel-collector:4318'
export OTEL_SERVICE_NAME='service'
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
export POWERSHELL_DISTRIBUTION_CHANNEL='PSDocker-DotnetSDK-Ubuntu-22.04-arm64'
export PWD='/var/log/opentelemetry/dotnet'
export TERM='xterm'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@caterchong @RassK @pjanotti @Kielek and others