Skip to content

feat(contrib): add integration for aerospike/aerospike-client-go.v7#4830

Merged
darccio merged 59 commits into
mainfrom
dario.castane/dsr/aerospike
Jul 1, 2026
Merged

feat(contrib): add integration for aerospike/aerospike-client-go.v7#4830
darccio merged 59 commits into
mainfrom
dario.castane/dsr/aerospike

Conversation

@darccio

@darccio darccio commented Jun 1, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Updates #1036 so it uses the current contrib instrumentation package, implementing it for the major version v7.

Latest major version v8 will be done in an upcoming PR.

Motivation

Add support for Aerospike v7.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • New code is free of linting errors. You can check this by running make lint locally.
  • New code doesn't break existing tests. You can check this by running make test locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.

Unsure? Have a question? Request a review!

@darccio darccio added the apm:ecosystem contrib/* related feature requests or bugs label Jun 1, 2026
@datadog-official

datadog-official Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 41.92%
Overall Coverage: 62.91% (+10.73%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7753488 | Docs | Datadog PR Page | Give us feedback!

@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.72%. Comparing base (72b6fb0) to head (5b9e70d).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
instrumentation/packages.go 7.81% <ø> (-1.57%) ⬇️
internal/otelprocesscontext/processcontext.pb.go 59.61% <ø> (-1.93%) ⬇️
internal/stacktrace/contribs_generated.go 100.00% <100.00%> (ø)

... and 286 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@darccio
darccio force-pushed the dario.castane/dsr/aerospike branch from 78b032a to a1056ac Compare June 1, 2026 13:44
Comment thread contrib/aerospike/aerospike-client-go.v7/go.mod Fixed
Comment thread contrib/aerospike/aerospike-client-go.v7/go.mod Fixed
Comment thread contrib/aerospike/aerospike-client-go.v7/go.mod Fixed
Comment thread contrib/aerospike/aerospike-client-go.v7/go.mod Fixed
Comment thread contrib/aerospike/aerospike-client-go.v7/go.mod Fixed
Comment thread contrib/aerospike/aerospike-client-go.v7/go.mod Fixed
Comment thread contrib/aerospike/aerospike-client-go.v7/go.mod Fixed
Comment thread contrib/aerospike/aerospike-client-go.v7/go.mod Fixed
@pr-commenter

pr-commenter Bot commented Jun 1, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-01 11:10:52

Comparing candidate commit 7753488 in PR branch dario.castane/dsr/aerospike with baseline commit a2c5cb8 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 324 metrics, 2 unstable metrics, 1 known flaky benchmarks.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:BenchmarkOTLPTraceWriterFlush

  • 🟥 execution_time [+2.426µs; +3.694µs] or [+3.901%; +5.938%]

@kakkoyun kakkoyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

govulncheck seems unhappy though.

@darccio darccio added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Jun 1, 2026
@darccio
darccio force-pushed the dario.castane/dsr/aerospike branch from 5f3239c to f33851b Compare June 1, 2026 21:11
@darccio
darccio marked this pull request as ready for review June 2, 2026 10:02
@darccio
darccio requested review from a team as code owners June 2, 2026 10:02
darccio added 4 commits June 30, 2026 11:20
… to avoid re-weaving the client library

The struct-definition aspect injected WithContext/__ddGetCtx into
aerospike-client-go/v7.Client, forcing Orchestrion to re-weave the entire
(~150-file) aerospike package and invalidate its compile cache (the slow
"hang" on PR #4830). It existed only to parent spans created in goroutines
that capture an outer context.

That mechanism could not have worked anyway: Orchestrion's GLS is goroutine-
local (stored on runtime.g, cleared at goexit1) and is never copied across
goroutine boundaries. The supported way to parent across a goroutine is to
pass the context in as a parameter so the method-call aspect resolves it via
.Function.ArgumentOfType.

- Remove the Client.WithContext struct-definition aspect; the method-call
  aspect (wrap-expression on call sites) no longer touches the library.
- Revert the else branch to WrapClientWithContext(x, nil) (GLS fallback),
  which also fixes the receiver double-evaluation in
  {{ .AST.Fun.X }}.__ddGetCtx().
- Rewrite TestCaseConcurrent to pass ctx into each goroutine as a parameter
  instead of asserting an injected WithContext method.
…pect for goroutine span propagation

Re-introduces the Client.WithContext struct-definition aspect that was
dropped in the previous commit. The struct-definition aspect injects
WithContext/__ddGetCtx into as.Client so that users can propagate the
active span into goroutines via client.WithContext(ctx).Method(...),
without needing to pass ctx as a goroutine parameter.

The method-call aspect's else-branch is restored to call __ddGetCtx()
so that the goroutine-local context set by WithContext is picked up at
the call site when no context.Context argument is in scope.

The integration test keeps the ctx-as-parameter pattern introduced
earlier; both propagation patterns are valid and documented.
…or method instrumentation

Replace the struct-definition (WithContext/__ddGetCtx) + method-call
approach with a function-body approach that instruments each *as.Client
method directly inside the aerospike library.

Two aspects:
- Client (struct-definition): injects __dd_startAerospikeSpan and
  __dd_finishAerospikeSpan helpers into the aerospike package.
- Client.Operation.Error / Client.Operation.ValueError (function-body):
  prepend span start/finish to each method body, dispatching on whether
  the method returns (error) or (value, error).

Span parenting relies on the tracer's GLS (same goroutine). Spans
started inside goroutines are roots; TestCaseConcurrent.ExpectedTraces
is updated to reflect this.

Also adds tracing.StartDefaultSpan for the Orchestrion advice template.
@darccio

darccio commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

@rarguelloF The method-call join point causes extremely long compilation times. I reverted to the function-body implementation and went ahead to merge this. This is stalling v2.10.0 release train.

@darccio

darccio commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b1bba50c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread contrib/aerospike/aerospike-client-go.v7/aerospike.go
darccio added 4 commits June 30, 2026 14:10
…st for unambiguous span matching

Replace three identical Put goroutines with Put/Get/Delete, one per
goroutine, each operating on its own pre-populated key. The three
expected root spans now have distinct resource tags so each matches a
different actual span — no two expected entries collapse onto the same
received span.

getKey and delKey are written in Setup (before the tracer starts) to
avoid spurious Put spans in the expected trace output.
… parenting

The function-body aspect relies on tracer GLS, which is goroutine-local
and not copied across goroutine boundaries. To parent spans in goroutines,
a WithContext method is injected into *as.Client via struct-definition:

  go func() { client.WithContext(ctx).Put(nil, key, bins) }()

WithContext stores ctx in a sync.Map keyed by goroutine ID.
__dd_aerospike_get_ctx (called by __dd_startAerospikeSpan) retrieves and
removes it so the immediately following method call picks up the right
parent. When WithContext was not used, it falls back to context.Background()
and the tracer's GLS provides same-goroutine parenting automatically.

TestCaseConcurrent is updated to exercise this path: each goroutine calls
applyCtx(client, ctx) (interface-asserted so the file compiles without
Orchestrion) before a distinct operation (Put/Get/Delete), and the expected
traces assert all three as children of test.root with unique resource names.
WrapClient's embedded *as.Client promoted PutObject, GetObject,
BatchGetObjects, ScanAllObjects, ScanNodeObjects, ScanPartitionObjects,
QueryObjects, QueryNodeObjects, QueryPartitionObjects, and QueryAggregate
to the raw untraced client. Add explicit wrapper methods for all ten so
every call site produces a span regardless of which API style is used.

Add the same ten methods to the Orchestrion function-body aspects so
automatic instrumentation covers them too:
- PutObject / GetObject → Client.Operation.Error group (single Error return)
- remaining eight → Client.Operation.ValueError group ((value, Error) return)

Add one integration test per method following the existing TestPut/TestGet
pattern. Object-API tests use a shared testRecord struct with as: field tags;
scan/query tests drain the result channel and close the Recordset before
asserting on spans.
@darccio

darccio commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4bf81ecb25

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread instrumentation/packages.go
Comment thread contrib/aerospike/aerospike-client-go.v7/aerospike.go Outdated

@rachelyangdog rachelyangdog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving for capabilities changes!

darccio added 4 commits June 30, 2026 17:20
…e dead code

The aerospike-client-go/v7 library gates its reflection-based Object API
(PutObject, GetObject, BatchGetObjects, Scan*Objects, Query*Objects) behind
//go:build !as_performance in client_reflect.go.  This contrib was calling
those methods unconditionally, so any application building with
-tags as_performance would fail to compile.

Move the nine Object-API wrappers into aerospike_object.go with a matching
//go:build !as_performance constraint.  QueryAggregate is not part of the
Object API and stays in aerospike.go.

Move the corresponding integration tests and testRecord into
aerospike_object_test.go (no build tag — tests are never built with
as_performance).  Add WithService assertions to the Object tests to match the
consistency of the data-API tests.

Also delete the dead WrapClientWithContext / orchestrionCfg code left over
from the abandoned wrap-expression join-point approach — nothing in the
contrib or _integration tree calls either function.  Remove the now-unused
sync import.

Add comments to orchestrion.yml noting: (1) the Object-method join points are
harmless no-ops under as_performance (unmatched join points are silently
skipped); (2) the goroutine-exit hazard in the __dd_aerospike_ctxs sync.Map
(entries stored by WithContext are consumed by LoadAndDelete at the next
instrumented call; if the goroutine exits first the entry persists until the
runtime recycles its ID).
Without an entry in contribIntegrations, instrumentation.Load →
tracer.MarkIntegrationImported("github.com/aerospike/aerospike-client-go/v7")
returns false and Aerospike never appears in startup integration telemetry.

The key must match TracedPackage from instrumentation/packages.go.
docker-compose.yaml already pinned aerospike:ce-7.2.0.6 with a full SHA
digest.  Align ci-services.json and StartAerospikeTestContainer to use
the same digest, preventing a silent test-environment change if the tag
is ever repointed.
…e in Setup

The default NewExponentialBackOff has a 15-minute MaxElapsedTime, meaning
Setup hangs for up to 15 minutes if the Aerospike container never becomes
healthy.  Cap it at 2 minutes to fail fast on broken environments.
@darccio

darccio commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

Config Audit

PACKAGE: contrib/confluentinc/confluent-kafka-go/kafkatrace
  STATUS      CONFIG                            CALL_SITES
  UNMIGRATED  DD_TRACE_KAFKA_ANALYTICS_ENABLED  1

PACKAGE: ddtrace/opentelemetry/log
  STATUS      CONFIG                            CALL_SITES
  STILL_READ  DD_AGENT_HOST                     2
  STILL_READ  DD_ENV                            1
  STILL_READ  DD_SERVICE                        1
  STILL_READ  DD_TAGS                           1
  STILL_READ  DD_TRACE_AGENT_URL                2
  STILL_READ  DD_TRACE_REPORT_HOSTNAME          1
  STILL_READ  DD_VERSION                        1
  UNMIGRATED  DD_HOSTNAME                       1
  UNMIGRATED  OTEL_BLRP_EXPORT_TIMEOUT          1
  UNMIGRATED  OTEL_BLRP_MAX_EXPORT_BATCH_SIZE   1
  UNMIGRATED  OTEL_BLRP_MAX_QUEUE_SIZE          1
  UNMIGRATED  OTEL_BLRP_SCHEDULE_DELAY          1
  UNMIGRATED  OTEL_EXPORTER_OTLP_ENDPOINT       4
  UNMIGRATED  OTEL_EXPORTER_OTLP_HEADERS        2
  UNMIGRATED  OTEL_EXPORTER_OTLP_LOGS_ENDPOINT  4
  UNMIGRATED  OTEL_EXPORTER_OTLP_LOGS_HEADERS   2
  UNMIGRATED  OTEL_EXPORTER_OTLP_LOGS_PROTOCOL  2
  UNMIGRATED  OTEL_EXPORTER_OTLP_LOGS_TIMEOUT   1
  UNMIGRATED  OTEL_EXPORTER_OTLP_PROTOCOL       2
  UNMIGRATED  OTEL_EXPORTER_OTLP_TIMEOUT        1
  UNMIGRATED  OTEL_RESOURCE_ATTRIBUTES          1

PACKAGE: ddtrace/opentelemetry/metric
  STATUS      CONFIG                                             CALL_SITES
  STILL_READ  DD_AGENT_HOST                                      2
  STILL_READ  DD_ENV                                             1
  STILL_READ  DD_METRICS_OTEL_ENABLED                            1
  STILL_READ  DD_SERVICE                                         1
  STILL_READ  DD_TAGS                                            1
  STILL_READ  DD_TRACE_AGENT_URL                                 2
  STILL_READ  DD_TRACE_REPORT_HOSTNAME                           1
  STILL_READ  DD_VERSION                                         1
  STILL_READ  OTEL_METRICS_EXPORTER                              1
  UNMIGRATED  DD_HOSTNAME                                        1
  UNMIGRATED  OTEL_EXPORTER_OTLP_ENDPOINT                        2
  UNMIGRATED  OTEL_EXPORTER_OTLP_HEADERS                         1
  UNMIGRATED  OTEL_EXPORTER_OTLP_METRICS_ENDPOINT                2
  UNMIGRATED  OTEL_EXPORTER_OTLP_METRICS_HEADERS                 1
  UNMIGRATED  OTEL_EXPORTER_OTLP_METRICS_PROTOCOL                2
  UNMIGRATED  OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE  1
  UNMIGRATED  OTEL_EXPORTER_OTLP_PROTOCOL                        2
  UNMIGRATED  OTEL_EXPORTER_OTLP_TIMEOUT                         1
  UNMIGRATED  OTEL_RESOURCE_ATTRIBUTES                           1
  UNMIGRATED  OTEL_SERVICE_NAME                                  1

PACKAGE: ddtrace/tracer
  STATUS      CONFIG                                     CALL_SITES
  STILL_READ  DD_API_KEY                                 1
  UNMIGRATED  DD_APM_TRACING_ENABLED                     1
  UNMIGRATED  DD_APP_KEY                                 1
  UNMIGRATED  DD_CIVISIBILITY_AGENTLESS_URL              1
  UNMIGRATED  DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED  1
  UNMIGRATED  DD_LLMOBS_AGENTLESS_ENABLED                1
  UNMIGRATED  DD_LLMOBS_ENABLED                          1
  UNMIGRATED  DD_LLMOBS_ML_APP                           1
  UNMIGRATED  DD_LLMOBS_PROJECT_NAME                     1
  UNMIGRATED  DD_SITE                                    2
  UNMIGRATED  DD_TRACER_EXPERIMENTAL_SPAN_POOL_ENABLED   1
  UNMIGRATED  DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED   1
  UNMIGRATED  DD_TRACE_DEBUG_SEELOG_WORKAROUND           1
  UNMIGRATED  DD_TRACE_ENABLED                           1
  UNMIGRATED  DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT      1
  UNMIGRATED  DD_TRACE_PROPAGATION_EXTRACT_FIRST         1
  UNMIGRATED  DD_TRACE_PROPAGATION_STYLE_EXTRACT         1
  UNMIGRATED  DD_TRACE_PROPAGATION_STYLE_INJECT          1
  UNMIGRATED  OTEL_TRACES_SAMPLER_ARG                    1

PACKAGE: instrumentation
  STATUS      CONFIG                                       CALL_SITES
  STILL_READ  DD_DATA_STREAMS_ENABLED                      1
  UNMIGRATED  DD_API_SECURITY_ENDPOINT_COLLECTION_ENABLED  1

PACKAGE: instrumentation/graphql
  STATUS      CONFIG                             CALL_SITES
  UNMIGRATED  DD_TRACE_GRAPHQL_ERROR_EXTENSIONS  1

PACKAGE: instrumentation/httptrace
  STATUS      CONFIG                                                 CALL_SITES
  UNMIGRATED  DD_TRACE_BAGGAGE_TAG_KEYS                              1
  UNMIGRATED  DD_TRACE_CLIENT_IP_ENABLED                             1
  UNMIGRATED  DD_TRACE_HTTP_SERVER_ERROR_STATUSES                    1
  UNMIGRATED  DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLIST               1
  UNMIGRATED  DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLIST_CLIENT        1
  UNMIGRATED  DD_TRACE_HTTP_URL_QUERY_STRING_ALLOWLIST_SERVER        1
  UNMIGRATED  DD_TRACE_HTTP_URL_QUERY_STRING_DISABLED                1
  UNMIGRATED  DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED               1
  UNMIGRATED  DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP               2
  UNMIGRATED  DD_TRACE_RESOURCE_RENAMING_ALWAYS_SIMPLIFIED_ENDPOINT  1
  UNMIGRATED  DD_TRACE_RESOURCE_RENAMING_ENABLED                     1

PACKAGE: instrumentation/internal/namingschema
  STATUS      CONFIG                                             CALL_SITES
  STILL_READ  DD_SERVICE                                         1
  STILL_READ  DD_TRACE_SPAN_ATTRIBUTE_SCHEMA                     1
  UNMIGRATED  DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED  1

PACKAGE: internal
  STATUS      CONFIG                         CALL_SITES
  STILL_READ  DD_AGENT_HOST                  1
  STILL_READ  DD_TAGS                        1
  STILL_READ  DD_TRACE_AGENT_PORT            1
  STILL_READ  DD_TRACE_AGENT_URL             1
  UNMIGRATED  DD_EXTERNAL_ENV                1
  UNMIGRATED  DD_GIT_COMMIT_SHA              1
  UNMIGRATED  DD_GIT_REPOSITORY_URL          1
  UNMIGRATED  DD_TRACE_GIT_METADATA_ENABLED  1

PACKAGE: internal/appsec
  STATUS      CONFIG           CALL_SITES
  UNMIGRATED  DD_APPSEC_RULES  1

PACKAGE: internal/appsec/config
  STATUS      CONFIG                                                CALL_SITES
  UNMIGRATED  DD_API_SECURITY_DOWNSTREAM_BODY_ANALYSIS_SAMPLE_RATE  1
  UNMIGRATED  DD_API_SECURITY_ENABLED                               1
  UNMIGRATED  DD_API_SECURITY_MAX_DOWNSTREAM_REQUEST_BODY_ANALYSIS  1
  UNMIGRATED  DD_API_SECURITY_PROXY_SAMPLE_RATE                     1
  UNMIGRATED  DD_API_SECURITY_REQUEST_SAMPLE_RATE                   1
  UNMIGRATED  DD_API_SECURITY_SAMPLE_DELAY                          1
  UNMIGRATED  DD_APM_TRACING_ENABLED                                1
  UNMIGRATED  DD_APPSEC_ENABLED                                     1
  UNMIGRATED  DD_APPSEC_RASP_ENABLED                                1
  UNMIGRATED  DD_APPSEC_RULES                                       1
  UNMIGRATED  DD_APPSEC_SCA_ENABLED                                 1
  UNMIGRATED  DD_APPSEC_TRACE_RATE_LIMIT                            1
  UNMIGRATED  DD_APPSEC_WAF_TIMEOUT                                 1

PACKAGE: internal/appsec/listener/httpsec
  STATUS      CONFIG                     CALL_SITES
  UNMIGRATED  DD_TRACE_CLIENT_IP_HEADER  1

PACKAGE: internal/bazel
  STATUS      CONFIG                                  CALL_SITES
  UNMIGRATED  DD_TEST_OPTIMIZATION_MANIFEST_FILE      1
  UNMIGRATED  DD_TEST_OPTIMIZATION_PAYLOADS_IN_FILES  1

PACKAGE: internal/civisibility/envconfig
  STATUS      CONFIG                   CALL_SITES
  STILL_READ  DD_CIVISIBILITY_ENABLED  1

PACKAGE: internal/civisibility/integrations
  STATUS      CONFIG                                               CALL_SITES
  STILL_READ  DD_SERVICE                                           1
  STILL_READ  DD_TRACE_DEBUG                                       1
  UNMIGRATED  DD_CIVISIBILITY_CODE_COVERAGE_REPORT_UPLOAD_ENABLED  1
  UNMIGRATED  DD_CIVISIBILITY_FLAKY_RETRY_COUNT                    1
  UNMIGRATED  DD_CIVISIBILITY_FLAKY_RETRY_ENABLED                  1
  UNMIGRATED  DD_CIVISIBILITY_GIT_UPLOAD_ENABLED                   1
  UNMIGRATED  DD_CIVISIBILITY_IMPACTED_TESTS_DETECTION_ENABLED     1
  UNMIGRATED  DD_CIVISIBILITY_SUBTEST_FEATURES_ENABLED             1
  UNMIGRATED  DD_CIVISIBILITY_TOTAL_FLAKY_RETRY_COUNT              1
  UNMIGRATED  DD_TEST_MANAGEMENT_ATTEMPT_TO_FIX_RETRIES            1
  UNMIGRATED  DD_TEST_MANAGEMENT_ENABLED                           1

PACKAGE: internal/civisibility/integrations/gotesting
  STATUS      CONFIG                                                           CALL_SITES
  UNMIGRATED  DD_CIVISIBILITY_INTERNAL_PARALLEL_EARLY_FLAKE_DETECTION_ENABLED  1
  UNMIGRATED  DD_TEST_MANAGEMENT_ENABLED                                       1

PACKAGE: internal/civisibility/integrations/logs
  STATUS      CONFIG                        CALL_SITES
  UNMIGRATED  DD_CIVISIBILITY_LOGS_ENABLED  1

PACKAGE: internal/civisibility/utils
  STATUS      CONFIG                              CALL_SITES
  STILL_READ  DD_SERVICE                          1
  UNMIGRATED  DD_ACTION_EXECUTION_ID              1
  UNMIGRATED  DD_PIPELINE_EXECUTION_ID            1
  UNMIGRATED  DD_TEST_OPTIMIZATION_ENV_DATA_FILE  1
  UNMIGRATED  DD_TEST_SESSION_NAME                1

PACKAGE: internal/civisibility/utils/net
  STATUS      CONFIG                             CALL_SITES
  STILL_READ  DD_API_KEY                         1
  STILL_READ  DD_CIVISIBILITY_AGENTLESS_ENABLED  1
  STILL_READ  DD_ENV                             1
  STILL_READ  DD_SERVICE                         1
  STILL_READ  DD_TAGS                            1
  STILL_READ  DD_VERSION                         1
  UNMIGRATED  DD_CIVISIBILITY_AGENTLESS_URL      1
  UNMIGRATED  DD_SITE                            1

PACKAGE: internal/civisibility/utils/telemetry
  STATUS      CONFIG                                         CALL_SITES
  UNMIGRATED  DD_CIVISIBILITY_AUTO_INSTRUMENTATION_PROVIDER  1

PACKAGE: internal/globalconfig
  STATUS      CONFIG                           CALL_SITES
  UNMIGRATED  DD_INSTRUMENTATION_INSTALL_ID    1
  UNMIGRATED  DD_INSTRUMENTATION_INSTALL_TIME  1
  UNMIGRATED  DD_INSTRUMENTATION_INSTALL_TYPE  1

PACKAGE: internal/hostname
  STATUS      CONFIG       CALL_SITES
  UNMIGRATED  DD_HOSTNAME  1

PACKAGE: internal/namingschema
  STATUS      CONFIG                                             CALL_SITES
  STILL_READ  DD_SERVICE                                         1
  STILL_READ  DD_TRACE_SPAN_ATTRIBUTE_SCHEMA                     1
  UNMIGRATED  DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED  1

PACKAGE: internal/processtags
  STATUS      CONFIG                                          CALL_SITES
  UNMIGRATED  DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED  1

PACKAGE: internal/remoteconfig
  STATUS      CONFIG                                  CALL_SITES
  STILL_READ  DD_ENV                                  1
  UNMIGRATED  DD_RC_TUF_ROOT                          1
  UNMIGRATED  DD_REMOTE_CONFIGURATION_ENABLED         1
  UNMIGRATED  DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS  1

PACKAGE: internal/stacktrace
  STATUS      CONFIG                           CALL_SITES
  UNMIGRATED  DD_APPSEC_MAX_STACK_TRACE_DEPTH  1
  UNMIGRATED  DD_APPSEC_STACK_TRACE_ENABLED    1

PACKAGE: internal/telemetry
  STATUS      CONFIG                                             CALL_SITES
  STILL_READ  DD_API_KEY                                         1
  UNMIGRATED  DD_API_SECURITY_ENDPOINT_COLLECTION_MESSAGE_LIMIT  1
  UNMIGRATED  DD_INSTRUMENTATION_TELEMETRY_ENABLED               1
  UNMIGRATED  DD_SITE                                            1
  UNMIGRATED  DD_TELEMETRY_DEBUG                                 1
  UNMIGRATED  DD_TELEMETRY_DEPENDENCY_COLLECTION_ENABLED         1
  UNMIGRATED  DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL           1
  UNMIGRATED  DD_TELEMETRY_HEARTBEAT_INTERVAL                    1
  UNMIGRATED  DD_TELEMETRY_LOG_COLLECTION_ENABLED                1
  UNMIGRATED  DD_TELEMETRY_METRICS_ENABLED                       1

PACKAGE: openfeature
  STATUS      CONFIG                                     CALL_SITES
  STILL_READ  DD_ENV                                     2
  STILL_READ  DD_SERVICE                                 2
  STILL_READ  DD_VERSION                                 2
  UNMIGRATED  DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED  1
  UNMIGRATED  DD_FLAGGING_EVALUATION_COUNTS_ENABLED      1

PACKAGE: profiler
  STATUS      CONFIG                                    CALL_SITES
  STILL_READ  DD_API_KEY                                1
  STILL_READ  DD_ENV                                    1
  STILL_READ  DD_SERVICE                                1
  STILL_READ  DD_TAGS                                   1
  STILL_READ  DD_TRACE_STARTUP_LOGS                     1
  STILL_READ  DD_VERSION                                1
  UNMIGRATED  DD_PROFILING_AGENTLESS                    1
  UNMIGRATED  DD_PROFILING_DEBUG_COMPRESSION_SETTINGS   1
  UNMIGRATED  DD_PROFILING_DELTA                        1
  UNMIGRATED  DD_PROFILING_ENABLED                      3
  UNMIGRATED  DD_PROFILING_ENDPOINT_COUNT_ENABLED       1
  UNMIGRATED  DD_PROFILING_EXECUTION_TRACE_ENABLED      1
  UNMIGRATED  DD_PROFILING_EXECUTION_TRACE_LIMIT_BYTES  1
  UNMIGRATED  DD_PROFILING_EXECUTION_TRACE_PERIOD       1
  UNMIGRATED  DD_PROFILING_FLUSH_ON_EXIT                1
  UNMIGRATED  DD_PROFILING_OUTPUT_DIR                   1
  UNMIGRATED  DD_PROFILING_UPLOAD_TIMEOUT               1
  UNMIGRATED  DD_PROFILING_URL                          1
  UNMIGRATED  DD_SITE                                   1

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35a8fbe7b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread contrib/aerospike/aerospike-client-go.v7/orchestrion.yml
Comment thread contrib/aerospike/aerospike-client-go.v7/aerospike_object_test.go
darccio added 6 commits July 1, 2026 11:29
… pairs

In aerospike-client-go/v7, four public methods are 1-line thin wrappers that
immediately delegate to another public method also in the function-body advice
list:

  Query        → QueryPartitions
  ScanAll      → ScanPartitions
  QueryObjects → QueryPartitionObjects     (!as_performance only)
  ScanAllObjects → ScanPartitionObjects   (!as_performance only)

Without a guard, one user-facing call produces two spans (one per aspect fire).
Node variants (ScanNode, QueryNode, …) delegate to unexported methods and are
unaffected.

Fix: embed an unexported __dd_aerospike_active_key sentinel in the goroutine's
context when an instrumented call starts.  Rewrite both prepend-statements
templates to:
  1. Pop the context via __dd_aerospike_get_ctx() explicitly.
  2. If the sentinel is absent (outermost call): store a marked context back in
     __dd_aerospike_ctxs so the inner delegated call sees it, create a span,
     and defer deletion + span finish.
  3. If the sentinel is present (nested/delegated call): store the context back
     for further nesting, skip span creation.

No new data structure is introduced; the existing __dd_aerospike_ctxs sync.Map
carries the marker.  Direct calls to QueryPartitions/ScanPartitions continue to
produce one correctly-named span.  __dd_startAerospikeSpan is removed (the
templates now call tracing.StartDefaultSpan directly to avoid double-popping the
context).

Add unit tests TestScanAll, TestScanPartitions, TestQuery, TestQueryPartitions
to aerospike_test.go.  Each uses require.Len(t, spans, 1) to assert exactly one
span per call, locking down the 1-span contract for the delegation pairs in the
manual-wrapper path.
…ases

Add TestCaseScanAll and TestCaseQuery to the Orchestrion integration suite.
Each verifies that the expected span (resource "ScanAll" / "Query") is produced
as a child of test.root when ScanAll or Query is called on a raw *as.Client.

These cases document the expected single-span behaviour for the delegation
pairs and would catch regressions where spans go missing.  Note: the harness
uses partial child-matching, so extra (double) spans do not automatically fail
the test; exact-count enforcement for the Orchestrion path requires INTEGRATION=1
and a live server.
… advices

Each prepend-statements advice block needs its own imports section for
external package identifiers used in the template. The inject-declarations
imports only apply to the generated file for the struct injection, not to
the files where function bodies are instrumented.
@darccio
darccio merged commit 86a1f99 into main Jul 1, 2026
332 checks passed
@darccio
darccio deleted the dario.castane/dsr/aerospike branch July 1, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos apm:ecosystem contrib/* related feature requests or bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants