当前位置: 首页 > 工具软件 > SigNoz > 使用案例 >

搭建可观测平台SigNoz

闻人锦
2023-12-01

一、前提条件

git,docker,docker-compose

二、下载安装脚本

git clone -b main https://github.com/SigNoz/signoz.git && cd signoz/deploy/

三、去掉示例程序

vim docker/clickhouse-setup/docker-compose.yaml

# 注释一下内容

#  hotrod:
#    image: jaegertracing/example-hotrod:1.30
#    container_name: hotrod
#    logging:
#      options:
#        max-size: 50m
#        max-file: "3"
#    command: ["all"]
#    environment:
#      - JAEGER_ENDPOINT=http://otel-collector:14268/api/traces
#
#  load-hotrod:
#    image: "grubykarol/locust:1.2.3-python3.9-alpine3.12"
#    container_name: load-hotrod
#    hostname: load-hotrod
#    environment:
#      ATTACKED_HOST: http://hotrod:8080
#      LOCUST_MODE: standalone
#      NO_PROXY: standalone
#      TASK_DELAY_FROM: 5
#      TASK_DELAY_TO: 30
#      QUIET_MODE: "${QUIET_MODE:-false}"
#      LOCUST_OPTS: "--headless -u 10 -r 1"
#    volumes:
#      - ../common/locust-scripts:/locust

四、启动

docker-compose -f docker/clickhouse-setup/docker-compose.yaml up -d

五、Java程序接入

wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar

# 添加环境变量
OTEL_EXPORTER_OTLP_ENDPOINT="http://<IP of SigNoz Backend>:4317" OTEL_RESOURCE_ATTRIBUTES=service.name=<app_name>

java -javaagent:/path/to/opentelemetry-javaagent.jar -jar  <myapp>.jar

六、查看

http://192.168.1.10:3301
 类似资料: