Skip to content

feat(llmobs): auto-tag git commit sha and repository url on spans and…#9446

Open
gsvigruha wants to merge 3 commits into
masterfrom
gergely.svigruha/tracing-collect-git
Open

feat(llmobs): auto-tag git commit sha and repository url on spans and…#9446
gsvigruha wants to merge 3 commits into
masterfrom
gergely.svigruha/tracing-collect-git

Conversation

@gsvigruha

Copy link
Copy Markdown
Contributor

… experiments

Attach git.commit.sha and git.repository_url to LLMObs spans and experiments, resolved under the widest set of circumstances (prod and local dev) without per-span cost.

A new resolver (llmobs/git-metadata.js) reuses the existing file/env git metadata resolver and adds a git-CLI fallback (git rev-parse HEAD, git config --get remote.origin.url) for the typical dev checkout where no DD_GIT_* env vars or git.properties file exist. It honors DD_TRACE_GIT_METADATA_ENABLED, filters credentials out of the URL, only spawns git when a value is missing and git is available, and caches the result for the process lifetime so the subprocess never touches a hot path.

Spans get the tags via the span processor (resolved once at enable) with user-supplied git.* tags winning; experiments fold them in as defaults under user tags on both spans and metrics. getCommitSHA is extracted in plugins/util/git.js and reused by getGitInformationDiscrepancy.

What does this PR do?

Motivation

Additional Notes

… experiments

Attach git.commit.sha and git.repository_url to LLMObs spans and
experiments, resolved under the widest set of circumstances (prod and
local dev) without per-span cost.

A new resolver (llmobs/git-metadata.js) reuses the existing file/env git
metadata resolver and adds a git-CLI fallback (git rev-parse HEAD, git
config --get remote.origin.url) for the typical dev checkout where no
DD_GIT_* env vars or git.properties file exist. It honors
DD_TRACE_GIT_METADATA_ENABLED, filters credentials out of the URL, only
spawns git when a value is missing and git is available, and caches the
result for the process lifetime so the subprocess never touches a hot
path.

Spans get the tags via the span processor (resolved once at enable) with
user-supplied git.* tags winning; experiments fold them in as defaults
under user tags on both spans and metrics. getCommitSHA is extracted in
plugins/util/git.js and reused by getGitInformationDiscrepancy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gsvigruha
gsvigruha requested review from a team as code owners July 20, 2026 21:19
@dd-octo-sts

dd-octo-sts Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 7.48 MB
Deduped: 8.14 MB
No deduping: 8.14 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.2 | 124.41 kB | 440.65 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-official

datadog-official Bot commented Jul 20, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

🚦 3 Pipeline jobs failed

Platform | integration-guardrails (22.0.0)   View in Datadog   GitHub Actions

AppSec | AppSec / express   View in Datadog   GitHub Actions

All Green | all-green   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 98.36% (-0.06%)

Useful? React with 👍 / 👎

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

@datadog-official datadog-official 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.

Datadog Autotest: PASS

More details

PR auto-tags LLMObs spans and experiments with git metadata (commit SHA and repository URL) resolved via file/env and git CLI. All 73 tests pass; tag merge order ensures user-supplied tags override system defaults; caching is process-lifetime to avoid hot-path subprocess spawns; credentials are filtered from URLs. No behavioral regressions detected.

Was this helpful? React 👍 or 👎

📊 Validated against 73 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 369b618 · What is Autotest? · Any feedback? Reach out in #autotest

@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: 369b6188a8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

* @returns {{ commitSHA: string | undefined, repositoryUrl: string | undefined }}
*/
function resolveLLMObsGitMetadata (config) {
if (cache) return cache

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep disabled git metadata cache separate

When this resolver is first called with DD_TRACE_GIT_METADATA_ENABLED=false, it stores the empty disabled result in the single module-level cache; any later LLMObs initialization in the same process with git metadata enabled will hit this early return and never consult env/file/CLI metadata, so spans and experiments remain untagged. This call-order exists in multi-config test processes and matches the regression the shared git_metadata helper avoids by caching disabled and enabled results independently.

Useful? React with 👍 / 👎.


// Only spawn the CLI when the file/env reads left something missing and git
// is actually installed — avoids failed subprocess spawns + error telemetry.
if ((!commitSHA || !repositoryUrl) && isGitAvailable()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid running git outside a repository

When LLMObs starts in a production image that has the git binary but no checked-out .git directory and no DD_GIT_* metadata, isGitAvailable() passes and this block runs git rev-parse HEAD / git config --get remote.origin.url; checked outside a repo, git rev-parse HEAD exits 128 with fatal: not a git repository, and sanitizedExec logs that as a Git plugin error. That makes normal “metadata unavailable” startups emit error-level logs, so this fallback should first verify the cwd is inside a work tree or use a silent failure path.

Useful? React with 👍 / 👎.

Comment on lines +340 to +341
if (this.#gitCommitSHA) tags[GIT_COMMIT_SHA] = this.#gitCommitSHA
if (this.#gitRepositoryUrl) tags[GIT_REPOSITORY_URL] = this.#gitRepositoryUrl

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update LLMObs tests for injected git tags

With the default DD_TRACE_GIT_METADATA_ENABLED=true, real useLlmObs() tests run from this git checkout will now add git.commit.sha and git.repository_url to every formatted LLMObs span, but packages/dd-trace/test/llmobs/util.js still exact-matches the tag array length and expected entries. Existing SDK/plugin tests that call assertLlmObsSpanEvent without git tags will fail unless the helper accounts for these auto tags or the tests disable git metadata.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.36%. Comparing base (6418d2d) to head (30c2550).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9446      +/-   ##
==========================================
- Coverage   98.41%   98.36%   -0.05%     
==========================================
  Files         938      939       +1     
  Lines      126209   126293      +84     
  Branches    10744    10683      -61     
==========================================
+ Hits       124207   124227      +20     
- Misses       2002     2066      +64     
Flag Coverage Δ
aiguard 57.79% <43.75%> (-0.04%) ⬇️
aiguard-integration 56.23% <43.75%> (-0.01%) ⬇️
apm-bucket-0 57.64% <43.75%> (-0.08%) ⬇️
apm-bucket-1 63.70% <43.75%> (-0.04%) ⬇️
apm-bucket-2 62.72% <43.75%> (-0.04%) ⬇️
apm-bucket-3 60.08% <43.75%> (-0.04%) ⬇️
apm-capabilities-tracing 64.19% <56.25%> (-0.01%) ⬇️
apm-integrations-aerospike 56.65% <43.75%> (-0.04%) ⬇️
apm-integrations-confluentinc-kafka-javascript 61.60% <43.75%> (-0.04%) ⬇️
apm-integrations-couchbase 57.07% <43.75%> (-0.04%) ⬇️
apm-integrations-http 62.77% <43.75%> (-0.04%) ⬇️
apm-integrations-kafkajs 62.16% <43.75%> (-0.04%) ⬇️
apm-integrations-next 59.19% <43.75%> (-0.04%) ⬇️
apm-integrations-prisma 58.67% <43.75%> (-0.04%) ⬇️
appsec 72.94% <43.75%> (-0.04%) ⬇️
appsec-express_fastify_graphql ?
appsec-fastify_graphql_kafka 69.10% <43.75%> (?)
appsec-integration 51.44% <43.75%> (+<0.01%) ⬆️
appsec-kafka_ldapjs_lodash ?
appsec-ldapjs_lodash_mongodb-core 65.28% <43.75%> (?)
appsec-mongodb-core_mongoose_mysql ?
appsec-mongoose_mysql_node-serialize 67.43% <43.75%> (?)
appsec-next 57.51% <43.75%> (-0.03%) ⬇️
appsec-node-serialize_passport_postgres ?
appsec-passport_postgres_sourcing 67.37% <43.75%> (?)
appsec-sourcing_stripe_template ?
appsec-stripe_template 64.04% <43.75%> (?)
debugger 64.95% <43.75%> (-0.06%) ⬇️
instrumentations-bucket-0 51.62% <43.75%> (-0.03%) ⬇️
instrumentations-bucket-1 60.20% <43.75%> (-0.04%) ⬇️
instrumentations-bucket-10 61.78% <43.75%> (-0.04%) ⬇️
instrumentations-bucket-11 56.67% <43.75%> (-0.04%) ⬇️
instrumentations-bucket-12 51.94% <43.75%> (-0.03%) ⬇️
instrumentations-bucket-13 51.99% <43.75%> (-0.03%) ⬇️
instrumentations-bucket-2 53.28% <43.75%> (-0.03%) ⬇️
instrumentations-bucket-3 53.58% <43.75%> (-0.03%) ⬇️
instrumentations-bucket-4 59.20% <43.75%> (-0.04%) ⬇️
instrumentations-bucket-5 49.99% <43.75%> (-0.02%) ⬇️
instrumentations-bucket-6 60.92% <43.75%> (-0.04%) ⬇️
instrumentations-bucket-7 58.35% <43.75%> (-0.04%) ⬇️
instrumentations-bucket-8 59.43% <43.75%> (-0.04%) ⬇️
instrumentations-bucket-9 51.99% <43.75%> (-0.03%) ⬇️
instrumentations-instrumentation-couchbase 51.05% <43.75%> (-0.03%) ⬇️
instrumentations-instrumentation-zlib 51.62% <43.75%> (-0.03%) ⬇️
instrumentations-integration-esbuild 34.13% <16.66%> (?)
llmobs-ai_anthropic_bedrock 62.63% <78.57%> (+0.03%) ⬆️
llmobs-bucket-1 61.89% <78.57%> (+0.03%) ⬆️
llmobs-openai 62.76% <78.57%> (+0.03%) ⬆️
llmobs-sdk 66.33% <89.79%> (+0.07%) ⬆️
llmobs-vertex-ai 59.25% <78.57%> (+0.04%) ⬆️
master-coverage 98.36% <100.00%> (?)
openfeature 53.98% <43.75%> (-0.01%) ⬇️
openfeature-unit 52.72% <43.75%> (-0.03%) ⬇️
platform-core_esbuild_instrumentations-misc 40.38% <43.75%> (-0.01%) ⬇️
platform-integration 61.49% <43.75%> (-0.02%) ⬇️
platform-shimmer_unit-guardrails_webpack 39.08% <43.75%> (+<0.01%) ⬆️
plugins-bucket-0 57.05% <43.75%> (-0.03%) ⬇️
plugins-bucket-1 54.43% <43.75%> (-0.01%) ⬇️
plugins-bucket-11 61.83% <43.75%> (-0.49%) ⬇️
plugins-bucket-17 61.88% <43.75%> (?)
plugins-bucket-18 62.58% <43.75%> (+0.47%) ⬆️
plugins-bucket-19 61.67% <43.75%> (+1.55%) ⬆️
plugins-bucket-20 64.31% <43.75%> (+2.22%) ⬆️
plugins-bucket-4 58.58% <43.75%> (-0.04%) ⬇️
plugins-bullmq_cassandra_cookie 61.79% <43.75%> (-0.04%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 56.74% <43.75%> (-0.04%) ⬇️
plugins-fetch_fs_generic-pool 58.81% <43.75%> (-0.08%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 64.74% <43.75%> (-0.05%) ⬇️
plugins-hapi_hono_ioredis 60.26% <43.75%> (-0.04%) ⬇️
plugins-jest_knex_langgraph ?
plugins-jest_langgraph_ldapjs 55.57% <43.75%> (?)
plugins-ldapjs_light-my-request_limitd-client ?
plugins-light-my-request_limitd-client_lodash 58.64% <43.75%> (?)
plugins-lodash_mariadb_memcached ?
plugins-mariadb_memcached_mercurius 61.60% <43.75%> (?)
plugins-moleculer_mongodb_mongodb-core ?
plugins-mongodb_mongodb-core_mongoose 59.70% <43.75%> (?)
plugins-mongoose_multer_mysql ?
plugins-multer_mysql_mysql2 58.43% <43.75%> (?)
plugins-mysql2_nats_node-serialize ?
plugins-nats_node-serialize_opensearch 60.82% <43.75%> (?)
plugins-opensearch_passport-http_pino ?
plugins-passport-http_pino_postgres 58.65% <43.75%> (?)
plugins-postgres_process_pug ?
plugins-process_pug_redis 57.69% <43.75%> (?)
plugins-redis_router_sequelize ?
plugins-test-and-upstream-rhea_undici_url ?
plugins-undici_url_valkey 58.58% <43.75%> (?)
plugins-valkey_vm_winston ?
plugins-vm_winston_ws 59.95% <43.75%> (?)
plugins-ws ?
profiling 62.20% <43.75%> (-0.04%) ⬇️
serverless-aws-sdk-aws-sdk 55.07% <43.75%> (-0.03%) ⬇️
serverless-aws-sdk-bedrockruntime 54.76% <43.75%> (-0.03%) ⬇️
serverless-aws-sdk-client 56.43% <43.75%> (-0.03%) ⬇️
serverless-aws-sdk-dynamodb 55.67% <43.75%> (-0.04%) ⬇️
serverless-aws-sdk-eventbridge 49.39% <43.75%> (-0.02%) ⬇️
serverless-aws-sdk-kinesis 59.37% <43.75%> (-0.04%) ⬇️
serverless-aws-sdk-lambda 57.41% <43.75%> (-0.03%) ⬇️
serverless-aws-sdk-s3 55.62% <43.75%> (-0.03%) ⬇️
serverless-aws-sdk-serverless-peer-service 59.78% <43.75%> (-0.04%) ⬇️
serverless-aws-sdk-sns 60.17% <43.75%> (-0.04%) ⬇️
serverless-aws-sdk-sqs 60.60% <43.75%> (-0.04%) ⬇️
serverless-aws-sdk-stepfunctions 55.60% <43.75%> (-0.03%) ⬇️
serverless-aws-sdk-util 51.50% <43.75%> (-0.03%) ⬇️
serverless-bucket-0 54.32% <43.75%> (+<0.01%) ⬆️
serverless-bucket-1 59.28% <43.75%> (-0.04%) ⬇️
test-optimization-cucumber 71.77% <56.25%> (-0.06%) ⬇️
test-optimization-cypress 65.78% <56.25%> (+0.05%) ⬆️
test-optimization-jest 73.23% <56.25%> (-0.08%) ⬇️
test-optimization-mocha 73.43% <56.25%> (+<0.01%) ⬆️
test-optimization-playwright-playwright-atr 60.40% <56.25%> (-0.02%) ⬇️
test-optimization-playwright-playwright-efd 60.59% <56.25%> (-0.02%) ⬇️
test-optimization-playwright-playwright-final-status 60.56% <56.25%> (-0.02%) ⬇️
test-optimization-playwright-playwright-impacted-tests 60.50% <56.25%> (+0.36%) ⬆️
test-optimization-playwright-playwright-reporting 60.19% <56.25%> (-0.18%) ⬇️
test-optimization-playwright-playwright-test-management 60.89% <56.25%> (-0.35%) ⬇️
test-optimization-playwright-playwright-test-span 60.32% <56.25%> (-0.07%) ⬇️
test-optimization-selenium 59.81% <56.25%> (-0.18%) ⬇️
test-optimization-testopt 58.45% <56.25%> (+0.07%) ⬆️
test-optimization-vitest 70.20% <56.25%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@pr-commenter

pr-commenter Bot commented Jul 20, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-20 23:37:31

Comparing candidate commit 30c2550 in PR branch gergely.svigruha/tracing-collect-git with baseline commit 6418d2d in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2325 metrics, 33 unstable metrics.

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 ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-210413.255µs; +211829.689µs] or [-7.919%; +7.972%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-241606.543µs; +240461.643µs] or [-9.455%; +9.410%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-158.440ms; +163.125ms] or [-5.131%; +5.283%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-188.888ms; +198.238ms] or [-6.500%; +6.822%]

scenario:appsec-control-20

  • unstable execution_time [-128114.864µs; +127156.197µs] or [-7.737%; +7.679%]

scenario:appsec-control-24

  • unstable execution_time [-114753.754µs; +113140.554µs] or [-9.262%; +9.131%]

scenario:appsec-control-26

  • unstable execution_time [-126.672ms; +117.866ms] or [-10.256%; +9.543%]

scenario:appsec-iast-no-vulnerability-control-20

  • unstable execution_time [-12.347ms; +19.998ms] or [-4.791%; +7.760%]

scenario:appsec-iast-no-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-15756.617µs; +17334.484µs] or [-6.041%; +6.646%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-14297.526µs; +14626.860µs] or [-5.544%; +5.672%]

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-26.847ms; +29.531ms] or [-4.875%; +5.362%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-2600.847ms; +4158.828ms] or [-27.292%; +43.641%]
  • unstable execution_time [-2618.694ms; +4176.571ms] or [-25.583%; +40.803%]
  • unstable instructions [-23.3G instructions; +37.0G instructions] or [-29.354%; +46.505%]
  • unstable max_rss_usage [-8.358MB; +13.104MB] or [-5.243%; +8.219%]
  • unstable throughput [-823.178op/s; +515.607op/s] or [-25.418%; +15.921%]

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable cpu_user_time [-2535.932ms; +4109.305ms] or [-26.549%; +43.021%]
  • unstable execution_time [-2520.996ms; +4127.985ms] or [-24.519%; +40.149%]
  • unstable instructions [-23.1G instructions; +36.9G instructions] or [-29.071%; +46.385%]
  • unstable max_rss_usage [-9.110MB; +13.424MB] or [-5.710%; +8.414%]
  • unstable throughput [-817.753op/s; +489.528op/s] or [-25.388%; +15.198%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-412.936ms; +270.489ms] or [-8.613%; +5.642%]
  • unstable execution_time [-408.074ms; +270.002ms] or [-8.381%; +5.546%]
  • unstable throughput [-94094.242op/s; +146304.849op/s] or [-5.460%; +8.490%]

scenario:plugin-couchbase-upsert-24

  • unstable cpu_user_time [-239.813ms; +375.431ms] or [-5.263%; +8.239%]
  • unstable execution_time [-251.806ms; +393.595ms] or [-5.513%; +8.618%]
  • unstable throughput [-1753974.755op/s; +1129917.505op/s] or [-6.366%; +4.101%]

scenario:plugin-graphql-long-with-depth-and-collapse-off-20

  • unstable max_rss_usage [-23.643MB; +56.612MB] or [-6.133%; +14.684%]

scenario:plugin-graphql-long-with-depth-off-20

  • unstable max_rss_usage [-5.317MB; +8.001MB] or [-4.204%; +6.325%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable cpu_user_time [-602.520ms; +594.026ms] or [-5.232%; +5.159%]
  • unstable execution_time [-611005.649µs; +612325.949µs] or [-5.201%; +5.212%]
  • unstable throughput [-3.597op/s; +3.627op/s] or [-5.253%; +5.296%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-4587.141KB; +6250.474KB] or [-5.743%; +7.825%]

gsvigruha and others added 2 commits July 20, 2026 17:37
The new git.commit.sha / git.repository_url span tags are derived from
the checkout the tests run in, so their values are environment-dependent
and can't be pinned in the exact-tag assertions the LLMObs plugin
harness makes. Disable DD_TRACE_GIT_METADATA_ENABLED in the useLlmObs
harness so provider plugin tests stay deterministic; the git-tagging
behavior itself is covered in span_processor.spec and git-metadata.spec.

Also wrap an over-long tagMap.set call to satisfy max-len.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address review feedback on the LLMObs git metadata resolver:

- Cache enabled and disabled results independently (mirroring
  git_metadata.js) so a disabled first call no longer short-circuits a
  later enabled initialization in the same process.
- Gate the git-CLI fallback on the .git folder existing, not just on the
  git binary being installed. A production image that ships git but no
  checkout would otherwise run `git rev-parse HEAD` on every startup, get
  exit 128, and log it as a Git plugin error. The folder gate keeps the
  dev-env benefit (e.g. packed refs where .git exists but file parsing
  misses) while staying silent when there is no repository.

Extends the resolver spec to cover both branches and restore 100%
patch coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant