Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

test(integration): add dtype=object to preserve types and insert resource keys (#9897)

Srikanth Chekuri201d5c24a5ef
diff --git a/tests/integration/fixtures/traces.py b/tests/integration/fixtures/traces.py
index 62fa209a60..0aa7491206 100644
--- a/tests/integration/fixtures/traces.py
+++ b/tests/integration/fixtures/traces.py
@@ -81,7 +81,7 @@ class TracesResourceOrAttributeKeys(ABC):
self.is_column = is_column
def np_arr(self) -> np.array:
- return np.array([self.name, self.tag_type, self.datatype, self.is_column])
+ return np.array([self.name, self.tag_type, self.datatype, self.is_column], dtype=object)
class TracesTagAttributes(ABC):
@@ -636,8 +636,10 @@ def insert_traces(
)
attribute_keys: List[TracesResourceOrAttributeKeys] = []
+ resource_keys: List[TracesResourceOrAttributeKeys] = []
for trace in traces:
attribute_keys.extend(trace.attribute_keys)
+ resource_keys.extend(trace.resource_keys)
if len(attribute_keys) > 0:
clickhouse.conn.insert(
@@ -646,6 +648,13 @@ def insert_traces(
data=[attribute_key.np_arr() for attribute_key in attribute_keys],
)
+ if len(resource_keys) > 0:
+ clickhouse.conn.insert(
+ database="signoz_traces",
+ table="distributed_span_attributes_keys",
+ data=[resource_key.np_arr() for resource_key in resource_keys],
+ )
+
# Insert main traces
clickhouse.conn.insert(
database="signoz_traces",