From 086ee5b7d3307d854f2d9ba5e92acd326961b16c Mon Sep 17 00:00:00 2001 From: Almudena Sanz Date: Thu, 15 May 2025 09:54:16 -0700 Subject: [PATCH] replace SpanAttributes by semconv attributes --- .../src/opentelemetry/exporter/richconsole/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/__init__.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/__init__.py index dfea177a56..59415e2bd8 100644 --- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/__init__.py +++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/__init__.py @@ -64,7 +64,9 @@ import opentelemetry.trace from opentelemetry.sdk.trace import ReadableSpan from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult -from opentelemetry.semconv.trace import SpanAttributes +from opentelemetry.semconv._incubating.attributes.db_attributes import ( + DB_STATEMENT, +) def _ns_to_time(nanoseconds): @@ -120,7 +122,7 @@ def _child_add_optional_attributes(child: Tree, span: ReadableSpan): label=Text.from_markup("[bold cyan]Attributes :[/bold cyan] ") ) for attribute in span.attributes: - if attribute == SpanAttributes.DB_STATEMENT: + if attribute == DB_STATEMENT: attributes.add( Text.from_markup(f"[bold cyan]{attribute} :[/bold cyan] ") )