
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Apache Exporter for Prometheus是一款用于通过HTTP协议导出Apache服务器mod_status模块统计数据的工具,供Prometheus监控系统采集和分析。该工具兼容Apache 2.2和2.4版本,支持配置监控目标地址、认证信息、日志级别等参数,帮助用户实时掌握Apache服务器的运行状态与性能指标。
-scrape_uri)、指标暴露地址(-telemetry.address)及路径(-telemetry.endpoint)-log.level),覆盖从debug到panic的各级别日志适用于需要通过Prometheus监控Apache Web服务器状态的各类场景,包括:
apache_up指标判断Apache服务可用性)从项目根目录执行以下命令构建Docker镜像:
bashdocker build -t apache_exporter .
基本运行示例
bashdocker run -d -p 9117:9117 docker.xuanyuan.run/apache_exporter \ -scrape_uri "https://your.server.com/server-status/?auto"
参数说明:
-p 9117:9117:将容器内默认监控端口(9117)映射到主机,供Prometheus采集指标-scrape_uri:指定Apache服务器server-status页面的URL(需包含?auto参数以获取机器可读格式)带HTTP认证的运行示例
若Apache的server-status页面启用HTTP基本认证,需在scrape_uri中嵌入用户名和密码:
bashdocker run -d -p 9117:9117 docker.xuanyuan.run/apache_exporter \ -scrape_uri "http://user:password@localhost/server-status?auto"
| 参数 | 说明 | 默认值 |
|---|---|---|
-insecure | 当使用HTTPS时,忽略服务器证书验证(默认关闭) | false |
-log.level value | 日志级别,仅记录指定级别及以上的消息,有效值:debug/info/warn/error/fatal/panic | info |
-scrape_uri string | Apache server-status页面的访问URI(必须包含?auto参数) | "http://localhost/server-status/?auto" |
-telemetry.address string | 指标暴露的网络地址(格式:host:port) | ":9117" |
-telemetry.endpoint string | 指标暴露的HTTP路径 | "/metrics" |
-version | 显示Exporter版本信息 | - |
# HELP apache_accesses_total 当前Apache总访问量 (*) # TYPE apache_accesses_total counter # HELP apache_scoreboard Apache记分板状态(工作进程状态分布) # TYPE apache_scoreboard gauge # HELP apache_sent_kilobytes_total 当前总发送千字节数 (*) # TYPE apache_sent_kilobytes_total counter # HELP apache_cpu_load CPU负载 (*) # TYPE apache_cpu_load gauge # HELP apache_up Apache服务器是否可达(1=可达,0=不可达) # TYPE apache_up gauge # HELP apache_uptime_seconds_total Apache服务器运行时间(秒) (*) # TYPE apache_uptime_seconds_total counter # HELP apache_workers Apache工作进程状态(各状态进程数量) # TYPE apache_workers gauge
# HELP http_request_duration_microseconds HTTP请求延迟(微秒) # TYPE http_request_duration_microseconds summary # HELP http_request_size_bytes HTTP请求大小(字节) # TYPE http_request_size_bytes summary # HELP http_response_size_bytes HTTP响应大小(字节) # TYPE http_response_size_bytes summary # HELP process_cpu_seconds_total 进程总CPU时间(秒) # TYPE process_cpu_seconds_total counter # HELP process_max_fds 最大打开文件描述符数 # TYPE process_max_fds gauge # HELP process_open_fds 当前打开文件描述符数 # TYPE process_open_fds gauge # HELP process_resident_memory_bytes 常驻内存大小(字节) # TYPE process_resident_memory_bytes gauge # HELP process_start_time_seconds 进程启动时间(Unix时间戳,秒) # TYPE process_start_time_seconds gauge # HELP process_virtual_memory_bytes 虚拟内存大小(字节) # TYPE process_virtual_memory_bytes gauge
注意:标记
(*)的指标需在Apache配置中启用ExtendedStatus On才能获取。Apache 2.3.6及以上版本加载mod_status模块时会默认开启ExtendedStatus。
该Exporter最初由https://github.com/neezgee%E5%88%9B%E5%BB%BA%E3%80%82
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务