MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_v2_sourced_rows

Function get_v2_sourced_rows

app/api/agentops/exporter/processor.py:307–328  ·  view source on GitHub ↗

Get span from ClickHouse that were supplied by v2 exporter

(limit: int, offset: int)

Source from the content-addressed store, hash-verified

305
306
307async def get_v2_sourced_rows(limit: int, offset: int) -> list:
308 """Get span from ClickHouse that were supplied by v2 exporter"""
309 client = await get_async_clickhouse()
310 query = """
311 SELECT * FROM otel_2.otel_traces
312 WHERE mapContains(SpanAttributes, 'session.id')
313 LIMIT {limit}
314 OFFSET {offset}
315 """
316 try:
317 query = query.format(table_name=IMPORT_TABLE_NAME, limit=limit, offset=offset)
318 result = await client.query(query)
319 if result and hasattr(result, 'result_rows') and len(result.result_rows) > 0:
320 rows = []
321 for row in result.result_rows:
322 row_dict = dict(zip(result.column_names, row))
323 rows.append(row_dict)
324 return rows
325 return []
326 except Exception as e:
327 print(f"Error fetching rows: {e}")
328 return []
329
330
331async def assign_correct_project_id(span_id: str, project_id: str) -> bool:

Callers

nothing calls this directly

Calls 2

get_async_clickhouseFunction · 0.90
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…