Skip to content

feat(examples): add Docker Compose setup with trace correlation#30

Open
petems wants to merge 1 commit intoDataDog:mainfrom
petems:petems/add-example-docker-compose-setup
Open

feat(examples): add Docker Compose setup with trace correlation#30
petems wants to merge 1 commit intoDataDog:mainfrom
petems:petems/add-example-docker-compose-setup

Conversation

@petems
Copy link

@petems petems commented Sep 25, 2025

  • Add complete Docker Compose example with Apache, Node.js, and Datadog Agent
  • Configure Apache with mod_datadog for APM tracing and log correlation
  • Implement Winston logging in Node.js service with automatic trace injection
  • Set up Datadog Agent for log collection from Docker containers
  • Add envchain support for secure API key management
  • Include proper trace and span ID correlation across services
  • Add comprehensive documentation in CLAUDE.md

Had some challenges getting Apache setup for a customer, a lot of of this isn't publically documented and I couldn't find a specific example, had to grab stuff from tests and stuff. This hopefully helps with that for future people 😄

See also: DataDog/documentation#31844

🤖 Generated with Claude Code

@petems petems requested a review from a team as a code owner September 25, 2025 23:41
@petems petems requested review from dmehala and removed request for a team September 25, 2025 23:41
- Add complete Docker Compose example with Apache, Node.js, and Datadog Agent
- Configure Apache with mod_datadog for APM tracing and log correlation
- Implement Winston logging in Node.js service with automatic trace injection
- Set up Datadog Agent for log collection from Docker containers
- Add envchain support for secure API key management
- Include proper trace and span ID correlation across services
- Add comprehensive documentation in CLAUDE.md

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@petems petems force-pushed the petems/add-example-docker-compose-setup branch from e7e1563 to 2a360f5 Compare September 25, 2025 23:43
Comment on lines +57 to +61
### Load testing
```bash
make stress
```
This uses vegeta to send 1000 req/s for 60 seconds to test the tracing under load.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see any Makefile. I would suggest to remove this section

container_name: sample-ddagent
environment:
- DD_API_KEY
- DD_SITE=datadoghq.com
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- DD_SITE=datadoghq.com
- DD_SITE

To allow the user to overwrite DD_SITE

- `docker-compose.yml`: Main orchestration configuration
- `apache/`: Apache configuration and Dockerfile
- `httpjs/`: Node.js HTTP service with Dockerfile and http.js server
- `Makefile`: Contains stress testing command
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

- `apache/`: Apache configuration and Dockerfile
- `httpjs/`: Node.js HTTP service with Dockerfile and http.js server
- `Makefile`: Contains stress testing command
- `doc/`: Documentation and trace sample images No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@@ -0,0 +1,2 @@
This is the source code and build instructions for an HTTP server. It's the
"http" upstream service in [docker-compose.yml](../../docker-compose.yml). No newline at end of file

Choose a reason for hiding this comment

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

Suggested change
"http" upstream service in [docker-compose.yml](../../docker-compose.yml).
"httpjs" upstream service in [docker-compose.yml](../../docker-compose.yml).

Choose a reason for hiding this comment

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

Is this httpd.conf file used anywhere? I don't see it being copied into the image

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