[英]What is the difference between AzureMonitorTraceExporter and AzureMonitorSpanExporter?
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.我试图应用 opentelemetry 来监控 Azure Function 应用程序。 And I found there are two ways to configure export: AzureMonitorTraceExporter and AzureMonitorSpanExporter.
我发现有两种配置导出的方法:AzureMonitorTraceExporter 和 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?对于 Azure Function App,哪种方式更好? Thanks.
谢谢。
AzureMonitorSpanExporter
is old one and not supported/developed now. AzureMonitorSpanExporter
是旧的,现在不支持/开发。 It is moved fromhttps://github.com/microsoft/opentelemetry-azure-monitor-python to https://github.com/Azure/azure-sdk-for-python .它从https://github.com/microsoft/opentelemetry-azure-monitor-python移动到https://github.com/Azure/azure-sdk-for-python 。 You should be using
AzureMonitorTraceExporter
.您应该使用
AzureMonitorTraceExporter
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.