What is the difference between AzureMonitorTraceExporter and AzureMonitorSpanExporter?

Viewed 140
from azure.core.settings import settings
from azure.core.tracing.ext.opentelemetry_span import OpenTelemetrySpan
settings.tracing_implementation = OpenTelemetrySpan

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor

I was trying to apply opentelemetry to monitor a Azure Function App. And I found there are two ways to configure export: AzureMonitorTraceExporter and AzureMonitorSpanExporter. What is the difference between them?

from  azure.monitor.opentelemetry.exporter  import  AzureMonitorTraceExporter
app_insights_key = os.getenv('APPINSIGHTS_INSTRUMENTATIONKEY_String')
exporter = AzureMonitorTraceExporter.from_connection_string(app_insights_key)

and

from azure_monitor import AzureMonitorSpanExporter
app_insights_key = os.getenv('APPINSIGHTS_INSTRUMENTATIONKEY')
exporter = AzureMonitorSpanExporter(instrumentation_key=app_insights_key)

And which way is better for a Azure Function App? Thanks.

1 Answers
Related