Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a11c64d
Add option to test without the proxy backend behind an environment va…
wantsui Oct 16, 2025
7f24a42
Add ui timeseries endpoint for testing and adjust test to use it.
wantsui Oct 17, 2025
54b0703
add to reporting
quinna-h Oct 17, 2025
ba2cfc2
Fix linting and adjust the response data use in tests because the for…
wantsui Oct 17, 2025
3c17fd1
wip
quinna-h Oct 20, 2025
8ddaa37
Merge branch 'otel-pg-poc-metrics-test' into otel-reporting-feature-p…
quinna-h Oct 21, 2025
a9e7f53
Add docker image details to metric tags.
wantsui Oct 21, 2025
35caa60
Add postgres settings and db queries that generate more data. TODO: f…
wantsui Oct 21, 2025
245a482
style formatting
quinna-h Oct 21, 2025
b0f0261
lint
quinna-h Oct 22, 2025
6b2ef84
Update utils/_context/_scenarios/otel_collector.py
wantsui Oct 22, 2025
0b4d67f
Add changes to use proxy while using mocked_backend. Remove the envir…
wantsui Oct 25, 2025
101442d
only if it's the mocked backend should the response be 200
wantsui Oct 28, 2025
5e5086b
Fix few comments
cbeauchesne Oct 28, 2025
c8ab30e
address comments
quinna-h Oct 30, 2025
95bbd75
Merge branch 'otel-pg-poc-metrics-test' into otel-reporting-feature-p…
quinna-h Oct 30, 2025
4f4cf25
linting
quinna-h Oct 30, 2025
26c06df
wip
quinna-h Oct 30, 2025
d865fb5
Remove the unneeded bug reference
wantsui Nov 3, 2025
212003d
Fix formatting.
wantsui Nov 3, 2025
c1ebaf3
Merge branch 'otel-pg-poc-metrics-test' into otel-reporting-feature-p…
quinna-h Nov 3, 2025
883b99b
remove use_proxy override since it is true by default.
wantsui Nov 3, 2025
f34b708
Merge branch 'main' into otel-pg-poc-metrics-test
wantsui Nov 3, 2025
504db8a
Exclude otel collector e2e from tracer release.
wantsui Nov 3, 2025
dde814d
Merge branch 'otel-pg-poc-metrics-test' into otel-reporting-feature-p…
quinna-h Nov 3, 2025
d5cbd04
Merge branch 'main' into otel-reporting-feature-parity
quinna-h Nov 3, 2025
7855169
remove otel_collector scenario
quinna-h Nov 3, 2025
16ea678
Merge branch 'main' into otel-reporting-feature-parity
quinna-h Nov 4, 2025
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
1 change: 0 additions & 1 deletion tests/otel_postgres_metrics_e2e/test_postgres_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ def test_postgresql_metrics_received_by_collector(self):
)


@scenarios.otel_collector
@scenarios.otel_collector_e2e
@features.otel_postgres_support
class Test_BackendValidity:
Expand Down
50 changes: 50 additions & 0 deletions utils/_context/_scenarios/otel_collector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import os
import pytest
import yaml
from pathlib import Path

from utils import interfaces
from utils._context.component_version import ComponentVersion
from utils._context.containers import OpenTelemetryCollectorContainer
Expand Down Expand Up @@ -64,6 +67,53 @@ def configure(self, config: pytest.Config) -> None:
"otel_collector", self.collector_container.image.labels["org.opencontainers.image.version"]
)

def customize_feature_parity_dashboard(self, result: dict) -> None:
result["configuration"]["collector_version"] = str(self.library.version)
result["configuration"]["collector_image"] = self.collector_container.image.name

# Extract image commit/revision if available from labels
if self.collector_container.image.labels:
image_labels = self.collector_container.image.labels
if "org.opencontainers.image.revision" in image_labels:
result["configuration"]["collector_image_commit"] = image_labels["org.opencontainers.image.revision"]

# Parse OTel collector configuration file
config_file_path = Path(self.collector_container.config_file)
result["configuration"]["config_file"] = config_file_path.name

try:
with open(config_file_path, "r", encoding="utf-8") as f:
otel_config = yaml.safe_load(f)

if "receivers" in otel_config:
result["configuration"]["receivers"] = list(otel_config["receivers"].keys())
if "postgresql" in otel_config["receivers"]:
pg_config = otel_config["receivers"]["postgresql"]
result["configuration"]["postgresql_receiver"] = {
"endpoint": pg_config.get("endpoint"),
"databases": pg_config.get("databases", []),
}

if "exporters" in otel_config:
result["configuration"]["exporters"] = list(otel_config["exporters"].keys())
if "datadog" in otel_config["exporters"]:
dd_exporter_config = otel_config["exporters"]["datadog"]
result["configuration"]["datadog_exporter_config"] = {
"metrics": dd_exporter_config.get("metrics", {}),
}

if "service" in otel_config and "pipelines" in otel_config["service"]:
result["configuration"]["pipelines"] = list(otel_config["service"]["pipelines"].keys())

except Exception as e:
pytest.exit(f"Failed to parse OTel collector config: {e}", 1)

# Extract version from image name
image_name = self.postgres_container.image.name
postgres_version = image_name.split(":", 1)[1] if ":" in image_name else "unknown"

result["testedDependencies"].append({"name": "postgresql", "version": postgres_version})

def _start_interfaces_watchdog(self):
super().start_interfaces_watchdog([interfaces.otel_collector])

Expand Down
11 changes: 5 additions & 6 deletions utils/_context/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,8 +1260,7 @@ def __init__(
environment: dict[str, str | None] | None = None,
volumes: dict | None = None,
) -> None:
# Allow custom config file via environment variable
self._otel_config_host_path = config_file
self.config_file = config_file

if "DOCKER_HOST" in os.environ:
m = re.match(r"(?:ssh:|tcp:|fd:|)//(?:[^@]+@|)([^:]+)", os.environ["DOCKER_HOST"])
Expand All @@ -1284,7 +1283,7 @@ def __init__(

def configure(self, *, host_log_folder: str, replay: bool) -> None:
self.volumes[f"./{host_log_folder}/docker/collector/logs"] = {"bind": "/var/log/system-tests", "mode": "rw"}
self.volumes[self._otel_config_host_path] = {"bind": "/etc/otelcol-config.yml", "mode": "ro"}
self.volumes[self.config_file] = {"bind": "/etc/otelcol-config.yml", "mode": "ro"}

super().configure(host_log_folder=host_log_folder, replay=replay)

Expand All @@ -1306,13 +1305,13 @@ def wait_for_health(self) -> bool:
return False

def start(self, network: Network) -> Container:
# _otel_config_host_path is mounted in the container, and depending on umask,
# config_file is mounted in the container, and depending on umask,
# it might have no read permissions for other users, which is required within
# the container. So set them here.
prev_mode = Path(self._otel_config_host_path).stat().st_mode
prev_mode = Path(self.config_file).stat().st_mode
new_mode = prev_mode | stat.S_IROTH
if prev_mode != new_mode:
Path(self._otel_config_host_path).chmod(new_mode)
Path(self.config_file).chmod(new_mode)
return super().start(network)


Expand Down
Loading