其他分享
首页 > 其他分享> > Jaeger知识点补充

Jaeger知识点补充

作者:互联网

欢迎访问我的GitHub

https://github.com/zq2599/blog_demos

内容:所有原创文章分类汇总及配套源码,涉及Java、Docker、Kubernetes、DevOPS等;

《Jaeger实战(Java版)》系列全文

  1. 《分布式调用链跟踪工具Jaeger?两分钟极速体验》
  2. 《Jaeger开发入门(java版)》
  3. 《Java应用日志如何与Jaeger的trace关联》
  4. 《Jaeger的客户端采样配置》
  5. 《极简!一个注解就能创建Jaeger的Span》
  6. 《Jaeger知识点补充》

本篇概览

  1. 修改服务名
  2. 关闭span上报的日志
  3. all-in-one镜像的持久化存储

修改服务名

在这里插入图片描述

在这里插入图片描述

关闭span上报的日志

00:18:12 [http-nio-8080-exec-1] INFO  c.b.j.p.c.HelloController [traceId=49476da841cd354b spanId=b595271a496cb0cb sampled=true] start hello from [1632269892342]
00:18:12 [http-nio-8080-exec-1] INFO  c.b.j.p.c.HelloController [traceId=49476da841cd354b spanId=b595271a496cb0cb sampled=true] hello
00:18:12 [http-nio-8080-exec-1] INFO  i.j.i.r.LoggingReporter [traceId=49476da841cd354b spanId=b595271a496cb0cb sampled=true] Span reported: 49476da841cd354b:991b82965543f8da:e6333b3a1c14f544:1 - mockBizChild
00:18:12 [http-nio-8080-exec-1] INFO  i.j.i.r.LoggingReporter [traceId=49476da841cd354b spanId=b595271a496cb0cb sampled=true] Span reported: 49476da841cd354b:e6333b3a1c14f544:b595271a496cb0cb:1 - mockBiz
00:18:13 [http-nio-8080-exec-1] INFO  i.j.i.r.LoggingReporter [traceId=49476da841cd354b spanId=b595271a496cb0cb sampled=true] Span reported: 49476da841cd354b:45e256ba3deed679:b595271a496cb0cb:1 - SET
00:18:13 [http-nio-8080-exec-1] INFO  i.j.i.r.LoggingReporter [traceId= spanId= sampled=] Span reported: 49476da841cd354b:b595271a496cb0cb:6322077c0edb62cc:1 - hello

在这里插入图片描述

00:12:42 [http-nio-8080-exec-10] INFO  c.b.j.p.c.HelloController [traceId=6430f498d5623103 spanId=9e4a4c8bb326352b sampled=true] start hello from [1632269562868]
00:12:42 [http-nio-8080-exec-10] INFO  c.b.j.p.c.HelloController [traceId=6430f498d5623103 spanId=9e4a4c8bb326352b sampled=true] hello

all-in-one镜像的持久化存储

docker run -d \
--name jaeger \
-e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
-p 5775:5775/udp \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 14268:14268 \
-p 14269:14269 \
-p 9411:9411 jaegertracing/all-in-one:1.26
docker run -d \
--name jaeger \
-e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
-e SPAN_STORAGE_TYPE=badger \
-e BADGER_EPHEMERAL=false \
-e BADGER_DIRECTORY_VALUE=/badger/data \
-e BADGER_DIRECTORY_KEY=/badger/key \
-v /Users/will/temp/202109/28/data:/badger \
-p 5775:5775/udp \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 14268:14268 \
-p 14269:14269 \
-p 9411:9411 jaegertracing/all-in-one:1.26
BADGER_FLAG=true
version: '3.0'

networks:
  jaeger-tutorials-net:
    driver: bridge
    ipam:
      config:
        - subnet: 192.168.1.0/24
          gateway: 192.168.1.1

volumes:
  # 用于存储badger的数据
  badger-data:

services:
  jaeger:
    image: jaegertracing/all-in-one:1.26
    container_name: jaeger
    # 处理时钟漂移带来的计算出负数的问题
    command: ["--query.max-clock-skew-adjustment=100ms"]
    # 选择网络
    networks:
      - jaeger-tutorials-net
    # 持久化,请选择适合自己的目录
    environment:
      SPAN_STORAGE_TYPE: badger
      BADGER_EPHEMERAL: ${BADGER_FLAG}
      BADGER_DIRECTORY_VALUE: /badger/data
      BADGER_DIRECTORY_KEY: /badger/key
    # badger存储在本地卷(或者映射到本地某个目录)
    volumes:
      - badger-data:/badger
    #选择端口
    ports:
      - 16686:16686/tcp
    restart: always

你不孤单,欣宸原创一路相伴

  1. Java系列
  2. Spring系列
  3. Docker系列
  4. kubernetes系列
  5. 数据库+中间件系列
  6. DevOps系列

欢迎关注公众号:程序员欣宸

微信搜索「程序员欣宸」,我是欣宸,期待与您一同畅游Java世界...
https://github.com/zq2599/blog_demos

标签:INFO,知识点,traceId,exec,补充,Jaeger,49476da841cd354b,badger
来源: https://www.cnblogs.com/bolingcavalry/p/15721841.html