Skip to content

Conversation

@Jeel-mehta
Copy link
Contributor

@Jeel-mehta Jeel-mehta commented Jul 2, 2025

Issue description:
There are currently no OTel supported logs being emitted from the sample-app.

Description of changes:

  • Replaced console.log statements with Bunyan logging library throughout the application

  • Added Bunyan dependency (^1.8.15) to package.json

  • Implemented structured logging with consistent format across all endpoints

  • Updated the following files:

    • frontend_service/index.js
    • remote-service/index.js
    • package.json for both frontend-service and remote-service
      This is similar to [PR [#186]] from ADOT JS repository

    Testing:
    Testing:
    Tested locally using docker-compose:

  1. Built and ran both frontend and remote services successfully

  2. Verified all endpoints working as expected:

    • /healthcheck - ✅ Success
    • /outgoing-http-call - ✅ Success
    • /aws-sdk-call - ✅ Success with testingId parameter
    • /remote-service - ✅ Success
    • /client-call - ✅ Success
    • /mysql - Attempted (Expected error due to no local DB setup)
  3. Verified Bunyan structured logs appearing correctly for both services:

    • Frontend service logs showing proper formatting and levels
    • Remote service logs showing proper formatting and levels

All endpoints tested using curl commands against localhost:8000 and localhost:8001.
Services started and stopped successfully using docker-compose up/down.

I am attaching two screenshots for reference of my testing:
Screenshot 2025-07-02 at 3 40 35 PM
Screenshot 2025-07-02 at 3 40 14 PM

Also I tested the updated sample app after adot js instrumentation to see if I receive logs in my personal cloudwatch account. Here are the screenshots for the logs received
Screenshot 2025-07-02 at 5 58 38 PM
Screenshot 2025-07-02 at 5 59 00 PM

Rollback procedure:

<Can we safely revert this commit if needed? If not, detail what must be done to safely revert and why it is needed.>

Ensure you've run the following tests on your changes and include the link below:

To do so, create a test.yml file with name: Test and workflow description to test your changes, then remove the file for your PR. Link your test run in your PR description. This process is a short term solution while we work on creating a staging environment for testing.

NOTE: TESTS RUNNING ON A SINGLE EKS CLUSTER CANNOT BE RUN IN PARALLEL. See the needs keyword to run tests in succession.

  • Run Java EKS on e2e-playground in us-east-1 and eu-central-2
  • Run Python EKS on e2e-playground in us-east-1 and eu-central-2
  • Run metric limiter on EKS cluster e2e-playground in us-east-1 and eu-central-2
  • Run EC2 tests in all regions
  • Run K8s on a separate K8s cluster (check IAD test account for master node endpoints; these will change as we create and destroy clusters for OS patching)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Jeel-mehta Jeel-mehta changed the title Replace Console with bunyan lgger in Sample App Replace Console with bunyan logger in Sample App Jul 2, 2025
@Jeel-mehta Jeel-mehta marked this pull request as ready for review July 2, 2025 22:50
Copy link
Contributor

@liustve liustve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you run these sample applications with a custom built ADOT JS artifact from mainline and validate that the logs appear in your expected dev account's log group and update your PR description with screenshots of it?

@Jeel-mehta Jeel-mehta force-pushed the Updating_Node_sample_app branch from 60881b5 to b545aaa Compare July 3, 2025 01:39
@Jeel-mehta
Copy link
Contributor Author

Can you run these sample applications with a custom built ADOT JS artifact from mainline and validate that the logs appear in your expected dev account's log group and update your PR description with screenshots of it?
I have updated the PR description.

@Jeel-mehta Jeel-mehta merged commit cdf9895 into main Jul 3, 2025
1 check passed
@Jeel-mehta Jeel-mehta deleted the Updating_Node_sample_app branch July 3, 2025 17:06
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

Successfully merging this pull request may close these issues.

3 participants