signoz 开源apm 工具试用
2022/3/31 23:21:52
本文主要是介绍signoz 开源apm 工具试用,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
signoz 官方提供了demo ,我们基于docker 也可以快速的体验服务
参考架构
signoz 的架构还是比较简单的,利用了社区的标准(OpenTelemetry),同时集成了metrics 以及trace,类似的grafan tempo 也是一个全家桶的东西使用也比较简单
运行
注意对于docker-compose 启动的,官方的示例是需要一些调整的,不调整也没事,只是会有异常提示
- clone 代码&&启动
git clone -b main https://github.com/SigNoz/signoz.git && cd signoz/deploy/
sudo docker-compose -f docker/clickhouse-setup/docker-compose.yaml up -d
- 参考docker-compose 文件
version: "3.9"
services:
clickhouse:
image: yandex/clickhouse-server:21.12.3.32
volumes:
- ./clickhouse-config.xml:/etc/clickhouse-server/config.xml
- ./data/clickhouse/:/var/lib/clickhouse/
deploy:
restart_policy:
condition: on-failure
healthcheck:
# "clickhouse", "client", "-u ${CLICKHOUSE_USER}", "--password ${CLICKHOUSE_PASSWORD}", "-q 'SELECT 1'"
test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"]
interval: 30s
timeout: 5s
retries: 3
alertmanager:
image: signoz/alertmanager:0.6.0
volumes:
- ./data/alertmanager:/data
command:
- --queryService.url=http://query-service:8080
- --storage.path=/data
depends_on:
- query-service
deploy:
restart_policy:
condition: on-failure
query-service:
image: signoz/query-service:0.7.4
command: ["-config=/root/config/prometheus.yml"]
ports:
- "8080:8080"
volumes:
- ./prometheus.yml:/root/config/prometheus.yml
- ../dashboards:/root/config/dashboards
- ./data/signoz/:/var/lib/signoz/
environment:
- ClickHouseUrl=tcp://clickhouse:9000
- STORAGE=clickhouse
- GODEBUG=netdns=go
- TELEMETRY_ENABLED=true
- DEPLOYMENT_TYPE=docker-swarm
deploy:
restart_policy:
condition: on-failure
depends_on:
- clickhouse
frontend:
image: signoz/frontend:0.7.4
depends_on:
- query-service
ports:
- "3301:3301"
volumes:
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
otel-collector:
image: signoz/otelcontribcol:0.43.0
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
# - "8889:8889" # Prometheus metrics exposed by the agent
# - "13133" # health_check
# - "14268:14268" # Jaeger receiver
# - "55678:55678" # OpenCensus receiver
# - "55679:55679" # zpages extension
# - "55680:55680" # OTLP gRPC legacy receiver
# - "55681:55681" # OTLP HTTP legacy receiver
depends_on:
- clickhouse
otel-collector-metrics:
image: signoz/otelcontribcol:0.43.0
command: ["--config=/etc/otel-collector-metrics-config.yaml"]
volumes:
- ./otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml
deploy:
restart_policy:
condition: on-failure
depends_on:
- clickhouse
hotrod:
image: jaegertracing/example-hotrod:1.30
command: ["all"]
environment:
- JAEGER_ENDPOINT=http://otel-collector:14268/api/traces
logging:
options:
max-size: 50m
max-file: "3"
load-hotrod:
image: "grubykarol/locust:1.2.3-python3.9-alpine3.12"
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
使用&&效果
打开http://localhost:3301
调用链情况
说明
signoz 使用起来还是比较简单的,而且基于了标准的OpenTelemetry,其他东西集成也比较简单,比如spring boot 应用,我们直接在启动的时候配置agent 就可以了(基于OpenTelemetry agent 就可以了,但是此agent 有点偏大。。。。)
参考配置(基于容器的部分)
ENV OTEL_METRICS_EXPORTER=none
ENV OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
ENV OTEL_RESOURCE_ATTRIBUTES=service.name=mydemoapp
ENTRYPOINT ["java","-javaagent:/opentelemetry-javaagent.jar","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
参考资料
https://signoz.io/docs/
https://github.com/signoz/signoz
这篇关于signoz 开源apm 工具试用的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-05小米13T Pro系统合集:性能与摄影的极致融合,值得你升级的系统ROM
- 2024-10-01基于Python+Vue开发的医院门诊预约挂号系统
- 2024-10-01基于Python+Vue开发的旅游景区管理系统
- 2024-10-01RestfulAPI入门指南:打造简单易懂的API接口
- 2024-10-01初学者指南:了解和使用Server Action
- 2024-10-01Server Component入门指南:搭建与配置详解
- 2024-10-01React 中使用 useRequest 实现数据请求
- 2024-10-01使用 golang 将ETH账户的资产平均分散到其他账户
- 2024-10-01JWT用户校验课程:从入门到实践
- 2024-10-01Server Component课程入门指南