Skip to content

Commit 889a338

Browse files
authored
Merge branch 'main' into munir/fix-logging-log-correlation-disabled
2 parents c3f7622 + 5fa0681 commit 889a338

File tree

157 files changed

+1629
-895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+1629
-895
lines changed

.github/workflows/system-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
persist-credentials: false
4646
repository: 'DataDog/system-tests'
4747
# Automatically managed, use scripts/update-system-tests-version to update
48-
ref: 'd5152ebefb021a4273f8d189d798c5e302986f7b'
48+
ref: 'f3752de0abce8bd5e7625577a105eb8af53bb8ce'
4949

5050
- name: Download wheels to binaries directory
5151
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
@@ -90,7 +90,7 @@ jobs:
9090
persist-credentials: false
9191
repository: 'DataDog/system-tests'
9292
# Automatically managed, use scripts/update-system-tests-version to update
93-
ref: 'd5152ebefb021a4273f8d189d798c5e302986f7b'
93+
ref: 'f3752de0abce8bd5e7625577a105eb8af53bb8ce'
9494

9595
- name: Build runner
9696
uses: ./.github/actions/install_runner
@@ -275,7 +275,7 @@ jobs:
275275
persist-credentials: false
276276
repository: 'DataDog/system-tests'
277277
# Automatically managed, use scripts/update-system-tests-version to update
278-
ref: 'd5152ebefb021a4273f8d189d798c5e302986f7b'
278+
ref: 'f3752de0abce8bd5e7625577a105eb8af53bb8ce'
279279
- name: Download wheels to binaries directory
280280
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
281281
with:

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ variables:
1414
DD_VPA_TEMPLATE: "vpa-template-cpu-p70-10percent-2x-oom-min-cap"
1515
# CI_DEBUG_SERVICES: "true"
1616
# Automatically managed, use scripts/update-system-tests-version to update
17-
SYSTEM_TESTS_REF: "d5152ebefb021a4273f8d189d798c5e302986f7b"
17+
SYSTEM_TESTS_REF: "f3752de0abce8bd5e7625577a105eb8af53bb8ce"
1818

1919
default:
2020
interruptible: true

.gitlab/package.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,76 @@ download_dependency_wheels:
8282
artifacts:
8383
paths:
8484
- "pywheels-dep/"
85+
86+
publish-wheels-to-s3:
87+
tags: ["arch:amd64"]
88+
image: registry.ddbuild.io/images/mirror/amazon/aws-cli:2.4.29
89+
stage: package
90+
rules:
91+
- when: always
92+
needs:
93+
- job: download_ddtrace_artifacts
94+
artifacts: true
95+
- job: compute_library_version
96+
artifacts: true
97+
variables:
98+
BUCKET: dd-trace-py-builds
99+
script:
100+
- set -euo pipefail
101+
- shopt -s nullglob
102+
# Find wheels
103+
- WHEELS=(pywheels/*.whl)
104+
- |
105+
if [ ${#WHEELS[@]} -eq 0 ]; then
106+
echo "No wheels found in pywheels/"; exit 1
107+
fi
108+
- echo "Found ${#WHEELS[@]} wheel(s):"
109+
- printf ' - %s\n' "${WHEELS[@]}"
110+
111+
- |
112+
if [ -f library-version/version.txt ]; then
113+
VERSION="$(tr -d '\r\n' < library-version/version.txt)"
114+
fi
115+
116+
if [ -z "${VERSION:-}" ]; then
117+
echo "ERROR: VERSION is not defined or library-version/version.txt missing!"
118+
exit 1
119+
fi
120+
121+
- printf 'Detected version %s\n' ${VERSION}
122+
123+
# Upload all wheels to versioned prefix and pipeline-id prefix
124+
- aws s3 cp --recursive --exclude "*" --include "*.whl" pywheels "s3://${BUCKET}/${VERSION}/"
125+
- aws s3 cp --recursive --exclude "*" --include "*.whl" pywheels "s3://${BUCKET}/${CI_PIPELINE_ID}/"
126+
127+
- |
128+
VERSION_ENC="${VERSION//+/%2B}"
129+
S3_BASE_VER="https://${BUCKET}.s3.amazonaws.com/${VERSION_ENC}"
130+
S3_BASE_PIPE="https://${BUCKET}.s3.amazonaws.com/${CI_PIPELINE_ID}"
131+
132+
generate_index_html() {
133+
local outfile="$1"
134+
{
135+
echo "<html><body>"
136+
for w in "${WHEELS[@]}"; do
137+
fname="$(basename "$w")"
138+
enc_fname="${fname//+/%2B}"
139+
echo "<a href=\"${enc_fname}\">${fname}</a><br>"
140+
done
141+
echo "</body></html>"
142+
} > "${outfile}"
143+
}
144+
145+
# Generate both minimal indexes
146+
generate_index_html "index.version.html"
147+
generate_index_html "index.pipeline.html"
148+
149+
# Upload to each S3 prefix
150+
aws s3 cp "index.version.html" "s3://${BUCKET}/${VERSION}/index.html" --content-type text/html
151+
aws s3 cp "index.pipeline.html" "s3://${BUCKET}/${CI_PIPELINE_ID}/index.html" --content-type text/html
152+
153+
# Print the clickable URLs
154+
VER_INDEX_URL="${S3_BASE_VER}/index.html"
155+
PIPE_INDEX_URL="${S3_BASE_PIPE}/index.html"
156+
echo "S3 index (version): ${VER_INDEX_URL}"
157+
echo "S3 index (pipeline): ${PIPE_INDEX_URL}"

.gitlab/services.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
DD_REMOTE_CONFIGURATION_REFRESH_INTERVAL: 5s
1313
DD_DOGSTATSD_NON_LOCAL_TRAFFIC: true
1414
testagent:
15-
name: registry.ddbuild.io/images/mirror/dd-apm-test-agent/ddapm-test-agent:v1.34.0
15+
name: registry.ddbuild.io/images/mirror/dd-apm-test-agent/ddapm-test-agent:v1.36.0
1616
alias: testagent
1717
variables:
1818
LOG_LEVEL: ERROR
@@ -26,6 +26,7 @@
2626
DD_DISABLE_ERROR_RESPONSES: true
2727
ENABLED_CHECKS: trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
2828
SNAPSHOT_IGNORED_ATTRS: span_id,trace_id,parent_id,duration,start,metrics.system.pid,metrics.system.process_id,metrics.process_id,meta.runtime-id,meta._dd.p.tid,meta.pathway.hash,metrics._dd.tracer_kr,meta._dd.parent_id,meta.kafka.cluster_id
29+
VCR_PROVIDER_MAP: azure_openai=https://llmobs-test-resource.openai.azure.com/
2930
mongo:
3031
name: registry.ddbuild.io/images/mirror/mongo:6.0.5
3132
alias: mongo

.gitlab/templates/cached-testrunner.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
deactivate
2525
cache:
2626
# Share pip between jobs of the same Python version
27-
- key: v4-build_base_venvs-${{PYTHON_VERSION}}-cache-{current_month}
27+
- key: v5-build_base_venvs-${{PYTHON_VERSION}}-cache-{current_month}
2828
paths:
2929
- .cache
30-
- key: v4-build_base_venvs-${{PYTHON_VERSION}}-ext-{current_month}
30+
- key: v5-build_base_venvs-${{PYTHON_VERSION}}-ext-{current_month}
3131
paths:
3232
- .ext_cache
33-
- key: v4-build_base_venvs-${{PYTHON_VERSION}}-download-cache-{current_month}
33+
- key: v5-build_base_venvs-${{PYTHON_VERSION}}-download-cache-{current_month}
3434
paths:
3535
- .download_cache

ddtrace/_logger.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ def _configure_ddtrace_native_logger():
128128
try:
129129
from ddtrace.internal.native._native import logger
130130

131-
native_writer_enabled = get_config("_DD_TRACE_WRITER_NATIVE", False, asbool, report_telemetry=True)
132-
if native_writer_enabled:
131+
from .settings._config import config
132+
133+
if config._trace_writer_native:
133134
backend = get_config("_DD_NATIVE_LOGGING_BACKEND", "file", report_telemetry=True)
134135
kwargs = {"output": backend}
135136
if backend == "file":
@@ -140,6 +141,6 @@ def _configure_ddtrace_native_logger():
140141
kwargs["max_files"] = get_config("_DD_NATIVE_LOGGING_FILE_ROTATION_LEN", 1, int, report_telemetry=True)
141142

142143
logger.configure(**kwargs)
143-
logger.set_log_level(get_config("_DD_NATIVE_LOGGING_LOG_LEVEL", "warn", report_telemetry=True))
144+
logger.set_log_level(get_config("_DD_NATIVE_LOGGING_LOG_LEVEL", "warning", report_telemetry=True))
144145
except Exception:
145146
log.warning("Failed to initialize native logger", exc_info=True)

ddtrace/_monkey.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
from wrapt.importer import when_imported
99

10-
from ddtrace.appsec._listeners import load_common_appsec_modules
1110
from ddtrace.internal.compat import Path
1211
from ddtrace.internal.telemetry.constants import TELEMETRY_NAMESPACE
1312
from ddtrace.settings._config import config
@@ -365,8 +364,6 @@ def _patch_all(**patch_modules: bool) -> None:
365364

366365
patch(raise_errors=False, **modules)
367366

368-
load_common_appsec_modules()
369-
370367

371368
def patch(raise_errors=True, **patch_modules):
372369
# type: (bool, Union[List[str], bool]) -> None

ddtrace/_trace/_inferred_proxy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ def finish_callback(_):
6363

6464

6565
def set_inferred_proxy_span_tags(span, proxy_context) -> Span:
66-
span.set_tag_str(COMPONENT, supported_proxies[proxy_context["proxy_system_name"]]["component"])
66+
span._set_tag_str(COMPONENT, supported_proxies[proxy_context["proxy_system_name"]]["component"])
6767

68-
span.set_tag_str(http.METHOD, proxy_context["method"])
69-
span.set_tag_str(http.URL, f"{proxy_context['domain_name']}{proxy_context['path']}")
70-
span.set_tag_str("stage", proxy_context["stage"])
68+
span._set_tag_str(http.METHOD, proxy_context["method"])
69+
span._set_tag_str(http.URL, f"{proxy_context['domain_name']}{proxy_context['path']}")
70+
span._set_tag_str("stage", proxy_context["stage"])
7171

7272
span.set_metric("_dd.inferred_span", 1)
7373
return span

ddtrace/_trace/processor/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ class TraceTagsProcessor(TraceProcessor):
224224
def _set_git_metadata(self, chunk_root):
225225
repository_url, commit_sha, main_package = gitmetadata.get_git_tags()
226226
if repository_url:
227-
chunk_root.set_tag_str("_dd.git.repository_url", repository_url)
227+
chunk_root._set_tag_str("_dd.git.repository_url", repository_url)
228228
if commit_sha:
229-
chunk_root.set_tag_str("_dd.git.commit.sha", commit_sha)
229+
chunk_root._set_tag_str("_dd.git.commit.sha", commit_sha)
230230
if main_package:
231-
chunk_root.set_tag_str("_dd.python_main_package", main_package)
231+
chunk_root._set_tag_str("_dd.python_main_package", main_package)
232232

233233
def process_trace(self, trace: List[Span]) -> Optional[List[Span]]:
234234
if not trace:
@@ -249,11 +249,11 @@ def process_trace(self, trace: List[Span]) -> Optional[List[Span]]:
249249
for span in spans_to_tag:
250250
span._update_tags_from_context()
251251
self._set_git_metadata(span)
252-
span.set_tag_str("language", "python")
252+
span._set_tag_str("language", "python")
253253
# for 128 bit trace ids
254254
if span.trace_id > MAX_UINT_64BITS:
255255
trace_id_hob = _get_64_highest_order_bits_as_hex(span.trace_id)
256-
span.set_tag_str(HIGHER_ORDER_TRACE_ID_BITS, trace_id_hob)
256+
span._set_tag_str(HIGHER_ORDER_TRACE_ID_BITS, trace_id_hob)
257257

258258
if LAST_DD_PARENT_ID_KEY in span._meta and span._parent is not None:
259259
# we should only set the last parent id on local root spans

ddtrace/_trace/processor/resource_renaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ def on_span_finish(self, span):
7474
if not route or config._trace_resource_renaming_always_simplified_endpoint:
7575
url = span.get_tag(http.URL)
7676
endpoint = self._compute_simplified_endpoint(url)
77-
span.set_tag_str(http.ENDPOINT, endpoint)
77+
span._set_tag_str(http.ENDPOINT, endpoint)

0 commit comments

Comments
 (0)