跳转到主要内容

OpenTelemetry的Google Cloud Trace导出器

项目描述

https://badge.fury.io/py/opentelemetry-exporter-gcp-trace.svg Documentation Status

此库提供将跟踪导出到Google Cloud Trace的支持。

有关资源检测和GCP跟踪上下文传播,请参阅 opentelemetry-tools-google-cloud。有关Google Cloud Monitoring导出器,请参阅 opentelemetry-exporter-gcp-monitoring

安装

pip install opentelemetry-exporter-gcp-trace

用法

from opentelemetry import trace
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import (
    SimpleSpanProcessor,
)

trace.set_tracer_provider(TracerProvider())

cloud_trace_exporter = CloudTraceSpanExporter(
    project_id='my-gcloud-project',
)
trace.get_tracer_provider().add_span_processor(
    SimpleSpanProcessor(cloud_trace_exporter)
)
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span('foo'):
    print('Hello world!')

参考文献

项目详情


下载文件

下载您平台对应的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

opentelemetry_exporter_gcp_trace-1.7.0.tar.gz (18.4 kB 查看哈希值)

上传时间 源代码

构建分发

opentelemetry_exporter_gcp_trace-1.7.0-py3-none-any.whl (13.8 kB 查看哈希值)

上传时间 Python 3

由以下提供支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面