簡體   English   中英

AzureMonitorTraceExporter 和 AzureMonitorSpanExporter 有什么區別?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM