Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
12 changes: 6 additions & 6 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ jobs:
serverless-system-tests:
needs: [serverless-system-tests-build-layer]
# Automatically managed, use scripts/update-system-tests-version to update
uses: DataDog/system-tests/.github/workflows/system-tests.yml@4be985b2a08121eb586d8e37e03e89e2407ba2a2
uses: DataDog/system-tests/.github/workflows/system-tests.yml@692e9462ef7296cf1224c0d2bd3a3623a1bfe590
secrets: inherit
with:
library: python_lambda
ref: '4be985b2a08121eb586d8e37e03e89e2407ba2a2'
ref: '692e9462ef7296cf1224c0d2bd3a3623a1bfe590'
binaries_artifact: serverless_system_tests_binaries
scenarios_groups: lambda_end_to_end
skip_empty_scenarios: true
Expand All @@ -126,22 +126,22 @@ jobs:
if: github.event_name != 'schedule' || github.event.repository.fork == false
needs: [integration-frameworks-combine-wheels]
# Automatically managed, use scripts/update-system-tests-version to update
uses: DataDog/system-tests/.github/workflows/system-tests.yml@4be985b2a08121eb586d8e37e03e89e2407ba2a2
uses: DataDog/system-tests/.github/workflows/system-tests.yml@692e9462ef7296cf1224c0d2bd3a3623a1bfe590
secrets: inherit
with:
library: python
ref: '4be985b2a08121eb586d8e37e03e89e2407ba2a2'
ref: '692e9462ef7296cf1224c0d2bd3a3623a1bfe590'
scenarios: INTEGRATION_FRAMEWORKS
binaries_artifact: integration-frameworks-wheels
push_to_test_optimization: true

tracer-release:
needs:
- download-s3-wheels
uses: DataDog/system-tests/.github/workflows/system-tests.yml@4be985b2a08121eb586d8e37e03e89e2407ba2a2
uses: DataDog/system-tests/.github/workflows/system-tests.yml@692e9462ef7296cf1224c0d2bd3a3623a1bfe590
with:
library: python
ref: '4be985b2a08121eb586d8e37e03e89e2407ba2a2'
ref: '692e9462ef7296cf1224c0d2bd3a3623a1bfe590'
binaries_artifact: wheels-manylinux_x86_64
desired_execution_time: 900
scenarios_groups: tracer-release
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ variables:
DD_VPA_TEMPLATE: "vpa-template-cpu-p70-10percent-2x-oom-min-cap"
# CI_DEBUG_SERVICES: "true"
# Automatically managed, use scripts/update-system-tests-version to update
SYSTEM_TESTS_REF: "4be985b2a08121eb586d8e37e03e89e2407ba2a2"
SYSTEM_TESTS_REF: "692e9462ef7296cf1224c0d2bd3a3623a1bfe590"

# Profiling native build image (built from dd/images/dd-trace-py/profiling_native)
PROFILING_NATIVE_IMAGE: "registry.ddbuild.io/dd-trace-py:v103334885-be1888c-profiling_native"
Expand Down
7 changes: 7 additions & 0 deletions ddtrace/internal/native/_native.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@ class TraceExporterBuilder:
:param process_tags: Comma-separated list of key:value process tags (e.g., "key1:val1,key2:val2").
"""
...
def set_tracer_tags(self, tracer_tags: list[str]) -> TraceExporterBuilder:
"""Set tracer tags on the OTLP metrics resource."""
...
def set_tracer_version(self, version: str) -> TraceExporterBuilder:
"""
Set the tracer version of the TraceExporter.
Expand Down Expand Up @@ -708,6 +711,10 @@ class TraceExporterBuilder:
:param bucket_size_ns: The size of stats bucket in nanoseconds.
"""

def set_additional_metric_tag_keys(self, tag_keys: list[str]) -> TraceExporterBuilder:
"""Set span tag keys included in computed stats."""
...

def enable_client_side_stats_obfuscation(self) -> TraceExporterBuilder:
"""
Obfuscate client side stats buckets in the client instead of in the agent.
Expand Down
5 changes: 5 additions & 0 deletions ddtrace/internal/settings/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,11 @@ def __init__(self) -> None:
"DD_TRACE_STATS_COMPUTATION_ENABLED", trace_compute_stats_default, asbool
)
self._otel_stats_computation_enabled = _get_config("OTEL_TRACES_SPAN_METRICS_ENABLED", None, asbool)
self._trace_stats_additional_tags = _get_config(
"DD_TRACE_STATS_ADDITIONAL_TAGS",
[],
lambda value: [tag.strip() for tag in value.split(",") if tag.strip()],
)
self._client_side_stats_obfuscation = _get_config(
"_DD_TRACE_STATS_COMPUTATION_EXPERIMENTAL_CLIENT_OBFUSCATION_ENABLED", True, asbool
)
Expand Down
1 change: 1 addition & 0 deletions ddtrace/internal/settings/_supported_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@
"DD_TRACE_SQLITE_ENABLED",
"DD_TRACE_STARLETTE_ENABLED",
"DD_TRACE_STARTUP_LOGS",
"DD_TRACE_STATS_ADDITIONAL_TAGS",
"DD_TRACE_STATS_COMPUTATION_ENABLED",
"DD_TRACE_STRUCTLOG_ENABLED",
"DD_TRACE_SUBPROCESS_ENABLED",
Expand Down
11 changes: 11 additions & 0 deletions ddtrace/internal/writer/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
log = get_logger(__name__)

LOG_ERR_INTERVAL = 60
_OTLP_TRACER_TAG_RESERVED_KEYS = frozenset({"service", "env", "version", "runtime_id", "runtime-id"})


def _safelog(log_func: Callable[..., None], msg: str, *args, **kwargs) -> None:
Expand Down Expand Up @@ -761,6 +762,16 @@ def _build_base_exporter_builder(
builder.set_app_version(config.version)
if test_session_token is not None:
builder.set_test_session_token(test_session_token)
if otlp_metrics_enabled:
tracer_tags = [
f"{key}:{value}"
for key, value in sorted(config.tags.items())
if key.lower() not in _OTLP_TRACER_TAG_RESERVED_KEYS and value
]
if tracer_tags:
builder.set_tracer_tags(tracer_tags)
if config._trace_stats_additional_tags:
builder.set_additional_metric_tag_keys(config._trace_stats_additional_tags)
# OTLP trace metrics require the native concentrator regardless of DD_TRACE_STATS_COMPUTATION_ENABLED.
if otlp_metrics_enabled or (compute_stats_enabled and not stats_opt_out):
if otlp_metrics_enabled:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
features:
- |
tracing: Adds support for exporting Datadog trace metrics. Set ``OTEL_TRACES_SPAN_METRICS_ENABLED=true`` to enable it.
Comment thread
mabdinur marked this conversation as resolved.
Outdated
Loading
Loading