![](/img/trans.png)
[英]What is the difference between machineType and mixedInstancesPolicy
[英]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
我试图应用 opentelemetry 来监控 Azure Function 应用程序。 我发现有两种配置导出的方法:AzureMonitorTraceExporter 和 AzureMonitorSpanExporter。 它们之间有什么区别?
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter
app_insights_key = os.getenv('APPINSIGHTS_INSTRUMENTATIONKEY_String')
exporter = AzureMonitorTraceExporter.from_connection_string(app_insights_key)
和
from azure_monitor import AzureMonitorSpanExporter
app_insights_key = os.getenv('APPINSIGHTS_INSTRUMENTATIONKEY')
exporter = AzureMonitorSpanExporter(instrumentation_key=app_insights_key)
对于 Azure Function App,哪种方式更好? 谢谢。
AzureMonitorSpanExporter
是旧的,现在不支持/开发。 它从https://github.com/microsoft/opentelemetry-azure-monitor-python移动到https://github.com/Azure/azure-sdk-for-python 。 您应该使用AzureMonitorTraceExporter
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.