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

Quickstart: instrument a Node.js service with Beyla not tracing logs on HTTP call #1093

Closed
sandeepkoseai opened this issue Aug 15, 2024 · 10 comments

Comments

@sandeepkoseai
Copy link

Hello Team,

I am experiencing issues with Grafana Beyla when trying to trace logs for a Node.js service on Ubuntu. I followed the Node.js Quickstart guide but am not seeing any traces in Beyla despite performing all steps as instructed.

Here are the specifics of my environment and the steps I’ve followed:

Environment:

  • OS Versions: Ubuntu 22.04 LTS and 24.04 LTS
  • Node.js Version: v18.19.1 (Also tested with older versions)
  • NPM Version: 9.2.0

Steps Taken:

  1. Run an Instrumentable Node.js Service:

    curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/nodejs/package.json
    curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/nodejs/quickstart.js
    npm install && npm start
  2. Download Beyla:
    Downloaded the latest Beyla executable from the Beyla releases page. Uncompressed and placed the Beyla executable in my $PATH.

  3. Run Beyla with Minimal Configuration:

    export BEYLA_SERVICE_NAME=quickstart
    export BEYLA_OPEN_PORT=8080
    export BEYLA_TRACE_PRINTER=text
    sudo -E beyla
  4. Test the Service:
    With Beyla and the Node.js service running, I made an HTTP request:

    curl http://localhost:8080/foo

Expected Output:
Beyla should output traces to the standard output, similar to:

2024-01-09 10:31:33.19103133 (3.254486ms[3.254486ms]) 200 GET /foo [127.0.0.1]->[127.0.0.1:8080]
size:80B svc=[{quickstart nodejs lima-ubuntu-lts-5074}] traceparent=[00-46214bd23716280eef43cf798dbe5522-0000000000000000-01]

Current Issue:
I am not receiving any trace output in the Beyla console after making the HTTP request, even waited for sometime. The Beyla console output after starting is:

time=2024-08-15T08:53:17.121Z level=INFO msg="Grafana Beyla" Version=v1.7.0 Revision=9d07bfb "OpenTelemetry SDK Version"=1.28.0
time=2024-08-15T08:53:17.124Z level=INFO msg="got host ID" component=ContextInfo func=fetchHostID fetcher=AWS hostID=i-0ea5b51aa1675a5c6
time=2024-08-15T08:53:17.124Z level=INFO msg="starting Beyla in Application Observability mode"
time=2024-08-15T08:53:17.130Z level=INFO msg="using hostname" component=traces.ReadDecorator function=instance_ID_hostNamePIDDecorator hostname=ip-x.x.x.x.us-east-2.compute.internal
time=2024-08-15T08:53:17.131Z level=INFO msg="Starting main node" component=beyla.Instrumenter
time=2024-08-15T08:53:17.326Z level=INFO msg="instrumenting process" component=discover.TraceAttacher cmd=/usr/bin/node pid=955982

Request for Assistance:
Please let me know if there are any additional steps I should take or if there is something I might be missing.

@grcevski
Copy link
Contributor

Hi @sandeepkoseai, everything looks correct from your steps. We need to enable a bit more logging to see what's happening.

Can you please add the following two environment options and send us the Beyla output:

export BEYLA_LOG_LEVEL=debug
export BEYLA_BPF_DEBUG=1

Run one or two curl commands like you did before.

This will print a lot more and we should be able to tell what's not working or what's misconfigured.

@sandeepkoseai
Copy link
Author

sandeepkoseai commented Aug 15, 2024 via email

@grcevski
Copy link
Contributor

Ah this is the issue we just fixed few days ago with kernel versions 6.7 and newer. Are you able to try our main branch?

The PR that resolved the problem is this one #1086. CC @rafaelroquetto

@sandeepkoseai
Copy link
Author

sandeepkoseai commented Aug 16, 2024 via email

@rafaelroquetto
Copy link
Contributor

Hi @sandeepkoseai, are you able to post the SHA1 of the branch HEAD commit just so that we can be sure about what we are dealing with?
You can do it with git rev-parse HEAD.
Thanks!

@sandeepkoseai
Copy link
Author

sandeepkoseai commented Aug 16, 2024 via email

@grcevski
Copy link
Contributor

Hi @sandeepkoseai,

Based on what Beyla showed in the log, the build revision that's running is "9d07bfb". When you downloaded the "main" branch, if you built it with make, the new Beyla executable will be in bin/beyla. I wonder if it's simply an issue that you are still picking up the old 1.7.0 branch of Beyla?

When you run Beyla we print the git hash as the first line in the version, e.g.:

time=2024-08-15T16:13:48.846Z level=INFO msg="Grafana Beyla" Version=v1.7.0
Revision=9d07bfb "OpenTelemetry SDK Version"=1.28.0

@sandeepkoseai
Copy link
Author

Hi Nikola,

I performed a fresh clone on the main branch and ran the make command, but I encountered several issues. Here are the details:

1. Initial Error: llvm-strip Not Found

  • Error Message:
    go generate ./pkg/...
    Error: exec: "llvm-strip": executable file not found in $PATH
    pkg/internal/ebpf/common/common.go:23: running "/home/ubuntu/beyla/bin/bpf2go": exit status 1
    Error: exec: "llvm-strip": executable file not found in $PATH
    pkg/internal/ebpf/goredis/goredis.go:32: running "/home/ubuntu/beyla/bin/bpf2go": exit status 1
    ...
    make: *** [Makefile:152: generate] Error 1
    
  • Resolution: Installed LLVM:
    sudo apt-get install llvm -y

2. Subsequent Error: clang Not Found

  • Error Message:
    go generate ./pkg/...
    Error: compile: exec: "clang": executable file not found in $PATH
    pkg/internal/ebpf/common/common.go:23: running "/home/ubuntu/beyla/bin/bpf2go": exit status 1
    Error: compile: exec: "clang": executable file not found in $PATH
    pkg/internal/ebpf/goredis/goredis.go:32: running "/home/ubuntu/beyla/bin/bpf2go": exit status 1
    ...
    make: *** [Makefile:152: generate] Error 1
    
  • Resolution: Installed Clang:
    sudo apt-get install clang -y

3. Current Issue: Test Failures

  • Error Message:
    coverage: 8.5% of statements in ./...
    FAIL    github.com/grafana/beyla/pkg/internal/ebpf/common    0.178s
    ok      github.com/grafana/beyla/pkg/internal/ebpf/httpfltr    1.179s    coverage: 0.3% of statements in ./...
    ...
    FAIL
    make: *** [Makefile:184: test] Error 1
    

Could you please assist with resolving the test failures (#3) or provide the bin/beyla package, if possible?

Best regards,
Sandeep Kose

@grcevski
Copy link
Contributor

Hi @sandeepkoseai, you can ignore the test failures, if you'd like you can also just run make dev which will build without the tests.

We've also made a pre-release with the fixes here, so you can instead pull the binaries directly https://github.com/grafana/beyla/releases

v1.7.1-alpha.1

@sandeepkoseai
Copy link
Author

Hello Team,

Thank you for your help! The issue has been resolved with the release of version v1.7.1-alpha.1.

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

No branches or pull requests

3 participants