Get span from ClickHouse that were supplied by v2 exporter
(limit: int, offset: int)
| 305 | |
| 306 | |
| 307 | async 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 | |
| 331 | async def assign_correct_project_id(span_id: str, project_id: str) -> bool: |
nothing calls this directly
no test coverage detected
searching dependent graphs…