mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 07:27:37 +00:00
29056a767a
* improve code for metrics * improve code for metrics * fix * fix * Refactor telemetry initialization and environment functions ordering - Reorder functions in envs.rs by type size (8-bit to 64-bit, signed before unsigned) and add missing variants like get_env_opt_u16. - Optimize init_telemetry to support three modes: stdout logging (default error level with span tracing), file rolling logs (size-based with retention), and HTTP-based observability with sub-endpoints (trace, metric, log) falling back to unified endpoint. - Fix stdout logging issue by retaining WorkerGuard in OtelGuard to prevent premature release of async writer threads. - Enhance observability mode with HTTP protocol, compression, and proper resource management. - Update OtelGuard to include tracing_guard for stdout and flexi_logger_handles for file logging. - Improve error handling and configuration extraction in OtelConfig. * fix * up * fix * fix * improve code for obs * fix * fix
81 lines
2.4 KiB
YAML
81 lines
2.4 KiB
YAML
# Copyright 2024 RustFS Team
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
receivers:
|
|
otlp:
|
|
protocols:
|
|
grpc: # OTLP gRPC 接收器
|
|
endpoint: 0.0.0.0:4317
|
|
http: # OTLP HTTP 接收器
|
|
endpoint: 0.0.0.0:4318
|
|
|
|
processors:
|
|
batch: # 批处理处理器,提升吞吐量
|
|
timeout: 5s
|
|
send_batch_size: 1000
|
|
memory_limiter:
|
|
check_interval: 1s
|
|
limit_mib: 512
|
|
|
|
exporters:
|
|
otlp/traces: # OTLP 导出器,用于跟踪数据
|
|
endpoint: "jaeger:4317" # Jaeger 的 OTLP gRPC 端点
|
|
tls:
|
|
insecure: true # 开发环境禁用 TLS,生产环境需配置证书
|
|
otlp/tempo: # OTLP 导出器,用于跟踪数据
|
|
endpoint: "tempo:4317" # tempo 的 OTLP gRPC 端点
|
|
tls:
|
|
insecure: true # 开发环境禁用 TLS,生产环境需配置证书
|
|
prometheus: # Prometheus 导出器,用于指标数据
|
|
endpoint: "0.0.0.0:8889" # Prometheus 刮取端点
|
|
namespace: "rustfs" # 指标前缀
|
|
send_timestamps: true # 发送时间戳
|
|
# enable_open_metrics: true
|
|
otlphttp/loki: # Loki 导出器,用于日志数据
|
|
endpoint: "http://loki:3100/otlp/v1/logs"
|
|
tls:
|
|
insecure: true
|
|
extensions:
|
|
health_check:
|
|
pprof:
|
|
zpages:
|
|
service:
|
|
extensions: [ health_check, pprof, zpages ] # 启用扩展
|
|
pipelines:
|
|
traces:
|
|
receivers: [ otlp ]
|
|
processors: [ memory_limiter,batch ]
|
|
exporters: [ otlp/traces,otlp/tempo ]
|
|
metrics:
|
|
receivers: [ otlp ]
|
|
processors: [ batch ]
|
|
exporters: [ prometheus ]
|
|
logs:
|
|
receivers: [ otlp ]
|
|
processors: [ batch ]
|
|
exporters: [ otlphttp/loki ]
|
|
telemetry:
|
|
logs:
|
|
level: "info" # Collector 日志级别
|
|
metrics:
|
|
level: "detailed" # 可以是 basic, normal, detailed
|
|
readers:
|
|
- periodic:
|
|
exporter:
|
|
otlp:
|
|
protocol: http/protobuf
|
|
endpoint: http://otel-collector:4318
|
|
|
|
|