此内容没有您所选择的语言版本。

Chapter 12. Distributed tracing


12.1. Enabling distributed tracing

The client offers distributed tracing based on the Jaeger implementation of the OpenTracing standard. Use the following steps to enable tracing in your application:

  1. Install the tracing dependencies.

    Red Hat Enterprise Linux 7

    $ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    $ sudo yum install python2-pip
    $ pip install --user --upgrade setuptools
    $ pip install --user opentracing jaeger-client

    Red Hat Enterprise Linux 8

    $ sudo dnf install python3-pip
    $ pip3 install --user opentracing jaeger-client

  2. Register the global tracer in your program.

    Example: Global tracer configuration

    from proton.tracing import init_tracer
    
    tracer = init_tracer("<service-name>")

For more information about Jaeger configuration, see Jaeger Sampling.

When testing or debugging, you may want to force Jaeger to trace a particular operation. See the Jaeger Python client documentation for more information.

To view the traces your application captures, use the Jaeger Getting Started to run the Jaeger infrastructure and console.

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.