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

Integrate catadog image as proxy service between agent and library #3958

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SKIP_SIMPLECOV=1
DD_AGENT_HOST=testagent
DD_AGENT_HOST=catadog
DD_API_KEY=00000000000000000000000000000000
DD_METRIC_AGENT_PORT=8125
DD_TRACE_AGENT_PORT=9126
DD_TRACE_AGENT_PORT=8128

# Values are used for proxying from APM Test Agent to real Datadog Agent
DD_REAL_AGENT_HOST=ddagent
Expand Down
32 changes: 20 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ services:
- presto
- redis
- testagent
- catadog
env_file: ./.env
environment: &common-environment
BUNDLE_GEMFILE: /app/Gemfile-2.5
DD_AGENT_HOST: testagent
DD_TRACE_AGENT_PORT: 9126
DD_AGENT_HOST: catadog
DD_TRACE_AGENT_PORT: 8128
TEST_DATADOG_INTEGRATION: 1
TEST_ELASTICSEARCH_HOST: elasticsearch
TEST_MEMCACHED_HOST: memcached
Expand Down Expand Up @@ -201,23 +202,30 @@ services:
- "127.0.0.1:${DD_REAL_AGENT_PORT}:8126"
volumes:
- ddagent_var_run:/var/run/datadog

testagent:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.12.0
ports:
- "127.0.0.1:${DD_TRACE_AGENT_PORT}:9126"
- "127.0.0.1:9126:9126"
depends_on:
- ddagent
env_file: ./.env
environment:
- LOG_LEVEL=DEBUG
- TRACE_LANGUAGE=ruby
- DD_TRACE_AGENT_URL=http://${DD_REAL_AGENT_HOST}:${DD_REAL_AGENT_PORT}
- PORT=${DD_TRACE_AGENT_PORT}
- DD_POOL_TRACE_CHECK_FAILURES=true
- DD_DISABLE_ERROR_RESPONSES=true
- ENABLED_CHECKS=trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service

- LOG_LEVEL=DEBUG
- TRACE_LANGUAGE=ruby
- DD_TRACE_AGENT_URL=http://${DD_REAL_AGENT_HOST}:${DD_REAL_AGENT_PORT}
- PORT=9126
- DD_POOL_TRACE_CHECK_FAILURES=true
- DD_DISABLE_ERROR_RESPONSES=true
- ENABLED_CHECKS=trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
catadog:
image: ghcr.io/datadog/catadog:latest
command: --agent-host testagent --agent-port 9126
ports:
- "127.0.0.1:${DD_TRACE_AGENT_PORT}:8128"
depends_on:
- testagent
environment:
- PORT=${DD_TRACE_AGENT_PORT}
elasticsearch:
image: elasticsearch:8.1.3
expose:
Expand Down
15 changes: 14 additions & 1 deletion docs/DevelopmentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,23 @@ The actionable in this case would be to ensure that the thread created in `worke

Depending on the situation, the thread in question might need to be forced to terminate. It's recommended to have a mechanism in place to terminate it (a shared variable that changes value when the thread should exit), but as a last resort, `Thread#terminate` forces the thread to finish. Keep in mind that regardless of the termination method, `Thread#join` must be called to ensure that the thread has completely finished its shutdown process.

**Catadog**

The catadog Docker image is a composable and extensible tool for development, testing, and diagnosis. The catadog container
runs alongside the Ruby tracer and forwards trace information to the APM Test Agent.

Catadog also emits helpful logging, which can be viewed in local testing or in CircleCI as a job step for tracer and contrib
tests. Locally, to get catadog logs:

$ docker-compose logs -f catadog

Read more about catadog:
https://github.com/datadog/catadog#readme

**The APM Test Agent**

The APM test agent emulates the APM endpoints of the Datadog Agent. The Test Agent container
runs alongside the Ruby tracer locally and in CI, handles all traces during test runs and performs a number
runs alongside catadog and in CI, handles all traces during test runs and performs a number
of 'Trace Checks'. For more information on these checks, see:
https://github.com/DataDog/dd-apm-test-agent#trace-invariant-checks

Expand Down
Loading