Skip to content
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
6 changes: 6 additions & 0 deletions manifests/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,12 @@ manifest:
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars: v2.53.0
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_false: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_true: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<3.53.0'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping_on_span:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<3.53.0'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_log_level_env: missing_feature (DD_LOG_LEVEL is not supported in .NET)
tests/parametric/test_otel_logs.py: '>=3.36.0' # Modified by easy win activation script
tests/parametric/test_otel_logs.py::Test_FR01_Enable_OTLP_Log_Collection::test_otlp_logs_enabled: missing_feature # Created by easy win activation script
Expand Down
6 changes: 6 additions & 0 deletions manifests/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,12 @@ manifest:
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_otel_enabled_takes_precedence: irrelevant (does not support enabling opentelemetry via DD_TRACE_OTEL_ENABLED)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_false: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_true: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<2.11.0-dev.1'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping_on_span:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<2.11.0-dev.1'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_log_level_env: missing_feature (DD_LOG_LEVEL is not supported in go)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_sdk_disabled_set: irrelevant (does not support enabling opentelemetry via DD_TRACE_OTEL_ENABLED)
tests/parametric/test_otel_logs.py: '>=2.5.0' # Modified by easy win activation script
Expand Down
6 changes: 6 additions & 0 deletions manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3971,6 +3971,12 @@ manifest:
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars: v1.35.2
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_false: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_true: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<1.66.0-SNAPSHOT'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping_on_span:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<1.66.0-SNAPSHOT'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_sdk_disabled_set: 'missing_feature (Currently DD_TRACE_OTEL_ENABLED=true is required for OTEL_SDK_DISABLED to be parsed. Revisit when the OpenTelemetry integration is enabled by default.)'
tests/parametric/test_otel_logs.py: '>=1.62.0'
tests/parametric/test_otel_logs.py::Test_FR06_OTLP_Protocols::test_otlp_protocols: incomplete_test_app (GPRC fails for system-test but works with real collector)
Expand Down
7 changes: 7 additions & 0 deletions manifests/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,13 @@ manifest:
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_otel_enabled_takes_precedence: missing_feature (this setting is not exposed in the Node.js config object)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_false: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_true: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<7.0.0-pre'
- declaration: incomplete_test_app (/trace/config endpoint is not implemented)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping_on_span:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<7.0.0-pre'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_sdk_disabled_set: missing_feature (this setting is not exposed in the Node.js config object)
tests/parametric/test_otel_logs.py::Test_FR01_Enable_OTLP_Log_Collection: *ref_5_72_0
tests/parametric/test_otel_logs.py::Test_FR03_Resource_Attributes: *ref_5_72_0
Expand Down
6 changes: 6 additions & 0 deletions manifests/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,12 @@ manifest:
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars: v1.1.0
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_false: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_true: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<1.25.0'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping_on_span:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<1.25.0'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_log_level_to_debug_mapping: irrelevant (PHP uses DD_TRACE_DEBUG to set DD_TRACE_LOG_LEVEL=debug, so it does not do this mapping in the reverse direction)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_traces_always_on:
- declaration: missing_feature (The always_on sampler mapping is properly implemented in v1.2.0)
Expand Down
6 changes: 6 additions & 0 deletions manifests/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,12 @@ manifest:
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars: v2.9.0
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_false: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_true: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<4.15.0-rc1'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping_on_span:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<4.15.0-rc1'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_log_level_env: missing_feature (DD_LOG_LEVEL is not supported in Python)
tests/parametric/test_otel_logs.py::Test_FR01_Enable_OTLP_Log_Collection: v3.13.0.dev
tests/parametric/test_otel_logs.py::Test_FR03_Resource_Attributes: v3.13.0.dev
Expand Down
6 changes: 6 additions & 0 deletions manifests/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2470,6 +2470,12 @@ manifest:
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_otel_enabled_takes_precedence: missing_feature (does not support enabling opentelemetry via DD_TRACE_OTEL_ENABLED)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_false: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_dd_trace_sample_ignore_parent_true: missing_feature (dd_trace_sample_ignore_parent requires an RFC, this feature is not implemented in any language)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<2.42.0-dev'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping_on_span:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<2.42.0-dev'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_log_level_env: missing_feature (DD_LOG_LEVEL is not supported in ruby)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_sdk_disabled_set: missing_feature (does not support enabling opentelemetry via DD_TRACE_OTEL_ENABLED)
tests/parametric/test_otel_logs.py: '>=2.34.0-dev'
Expand Down
7 changes: 7 additions & 0 deletions manifests/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ manifest:
- declaration: incomplete_test_app
- declaration: incomplete_test_app (/trace/config endpoint is not implemented)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_attribute_mapping: incomplete_test_app (/trace/config endpoint is not implemented)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<0.5.3-dev'
- declaration: incomplete_test_app (/trace/config endpoint is not implemented)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_deployment_environment_mapping_on_span:
- declaration: missing_feature (deployment.environment.name mapping is not released)
component_version: '<0.5.3-dev'
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_env_vars_set: incomplete_test_app (/trace/config endpoint is not implemented)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_log_level_env: incomplete_test_app (/trace/config endpoint is not implemented)
tests/parametric/test_otel_env_vars.py::Test_Otel_Env_Vars::test_otel_sdk_disabled_set: incomplete_test_app (/trace/config endpoint is not implemented)
Expand Down
124 changes: 120 additions & 4 deletions tests/parametric/test_otel_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,33 +148,149 @@ def test_otel_log_level_env(self, test_agent: TestAgentAPI, test_library: APMLib
"library_env",
[
{
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment=test1,service.name=test2,service.version=5,foo=bar1,baz=qux1",
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment=legacy,service.name=test2,service.version=5,foo=bar1,baz=qux1",
"DD_TRACE_OTEL_ENABLED": "true",
}
],
)
def test_otel_attribute_mapping(self, test_agent: TestAgentAPI, test_library: APMLibrary):
def test_otel_attribute_mapping(self, test_agent: TestAgentAPI, test_library: APMLibrary) -> None:
with test_library as t:
if t.lang == "nodejs":
assert_nodejs_telemetry_config(
test_agent, {"dd_service": "test2", "dd_env": "test1", "dd_version": "5"}
test_agent, {"dd_service": "test2", "dd_env": "legacy", "dd_version": "5"}
)
# OTEL_RESOURCE_ATTRIBUTES tags surface on spans, not in the DD_TAGS telemetry value
with t.dd_start_span(name="otel_attrs"):
pass
span = find_only_span(test_agent.wait_for_num_traces(1))
assert span["meta"]["foo"] == "bar1"
assert span["meta"]["baz"] == "qux1"
assert "deployment.environment" not in span["meta"]
assert "deployment.environment.name" not in span["meta"]
return
resp = t.config()

assert resp["dd_service"] == "test2"
assert resp["dd_env"] == "test1"
assert resp["dd_env"] == "legacy"
assert resp["dd_version"] == "5"
tags = resp["dd_tags"]
assert isinstance(tags, (str, list))
assert "foo:bar1" in tags
assert "baz:qux1" in tags
tags_text = str(tags)
assert "deployment.environment:" not in tags_text
assert "deployment.environment.name:" not in tags_text

@pytest.mark.parametrize(
("library_env", "expected_env"),
[
pytest.param(
{
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment.name=stable,service.name=test2,service.version=5,foo=bar1,baz=qux1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"stable",
id="stable-only",
),
pytest.param(
{
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment.name=stable,deployment.environment=legacy,service.name=test2,service.version=5,foo=bar1,baz=qux1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"stable",
id="both-stable-first",
),
pytest.param(
{
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment=legacy,deployment.environment.name=stable,service.name=test2,service.version=5,foo=bar1,baz=qux1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"stable",
id="both-legacy-first",
),
pytest.param(
{
"DD_ENV": "datadog",
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment.name=stable,deployment.environment=legacy,service.name=test2,service.version=5,foo=bar1,baz=qux1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"datadog",
id="dd-env-precedence",
),
],
)
def test_otel_deployment_environment_mapping(self, expected_env: str, test_library: APMLibrary) -> None:
with test_library as t:
resp = t.config()

assert resp["dd_service"] == "test2"
assert resp["dd_env"] == expected_env
assert resp["dd_version"] == "5"
tags = resp["dd_tags"]
assert isinstance(tags, (str, list))
assert "foo:bar1" in tags
assert "baz:qux1" in tags
tags_text = str(tags)
assert "deployment.environment:" not in tags_text
assert "deployment.environment.name:" not in tags_text

@pytest.mark.parametrize(
("library_env", "expected_env"),
[
pytest.param(
{
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment=legacy,foo=bar1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"legacy",
id="legacy-only",
),
pytest.param(
{
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment.name=stable,foo=bar1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"stable",
id="stable-only",
),
pytest.param(
{
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment.name=stable,deployment.environment=legacy,foo=bar1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"stable",
id="both-stable-first",
),
pytest.param(
{
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment=legacy,deployment.environment.name=stable,foo=bar1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"stable",
id="both-legacy-first",
),
pytest.param(
{
"DD_ENV": "datadog",
"OTEL_RESOURCE_ATTRIBUTES": "deployment.environment.name=stable,deployment.environment=legacy,foo=bar1",
"DD_TRACE_OTEL_ENABLED": "true",
},
"datadog",
id="dd-env-precedence",
),
],
)
def test_otel_deployment_environment_mapping_on_span(
self, expected_env: str, test_agent: TestAgentAPI, test_library: APMLibrary
) -> None:
with test_library as t, t.dd_start_span(name="otel_deployment_environment"):
pass

span = find_only_span(test_agent.wait_for_num_traces(1))
assert span["meta"]["env"] == expected_env
assert span["meta"]["foo"] == "bar1"
assert "deployment.environment" not in span["meta"]
assert "deployment.environment.name" not in span["meta"]

@pytest.mark.parametrize("library_env", [{"OTEL_TRACES_SAMPLER": "always_on", "DD_TRACE_OTEL_ENABLED": "true"}])
def test_otel_traces_always_on(self, test_agent: TestAgentAPI, test_library: APMLibrary):
Expand Down
Loading