jeager-python使用问题

来源:47-1 python发送单个span

qq_慕仙2363268

2021-04-17

代码相同,但是我显示应用名称不对啊,显示的不是mxshop,而是jeager-query

import logging
import time
from jaeger_client import Config
import requests

if __name__ == "__main__":
    log_level = logging.DEBUG
    logging.getLogger('').handlers = []
    logging.basicConfig(format='%(asctime)s %(message)s', level=log_level)

    config = Config(
        config={ # usually read from some yaml config
            'sampler': {
                'type': 'const',  # 全部采样
                'param': 1,     # 1 开始全部采样
            },
            'local_agent':{
                'reporting_host':'81.68.197.3',
                'reporting_port':'6381',
            },
            'logging': True,
        },
        service_name='mx-shop',
        validate=True,
    )
    # this call also sets opentracing.tracer
    tracer = config.initialize_tracer()

    with tracer.start_span('GetSpan') as get_span:
        requests.get("https://www.baidu.com")


    time.sleep(2)   # yield to IOLoop to flush the spans - https://github.com/jaegertracing/jaeger-client-python/issues/50
    tracer.close()  # flush any buffered spans
写回答

2回答

bobby

2021-04-23

端口号写错了 6381应该是6831

1
0

qq_慕仙2363268

提问者

2021-04-17

老师运行后,可以去http://81.68.197.3:16686查看,效果如下//img.mukewang.com/szimg/607a9aae09e6225a06880692.jpg

0
6
bobby
回复
qq_慕仙2363268
好的。
2021-04-25
共6条回复

Go+Python打造电商系统 自研微服务框架 抓紧高薪机遇

快速转型Go工程师,成为具备双语言后端能力的开发者

508 学习 · 530 问题

查看课程