
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
push-exporter是一款轻量级指标导出器镜像,专为监控各类推送(push)任务设计。该镜像通过采集推送操作的关键指标(如成功率、延迟、失败原因等),并以Prometheus兼容格式暴露指标接口,帮助用户实时掌握推送服务状态,及时发现异常并优化推送性能。支持HTTP/HTTPS、WebSocket、MQTT等多种推送协议,适用于API推送、消息队列、移动端通知等场景。
/metrics接口,可直接接入Prometheus、Grafana等监控系统,支持指标可视化和告警配置。bashdocker run -d \ --name push-exporter \ -p 9234:9234 \ # 默认监听端口 -e PUSH_TARGETS="https://api.example.com/push,ws://mqtt.example.com:8083" \ # 目标推送服务列表(逗号分隔) -e SCRAPE_INTERVAL=10s \ # 指标采集间隔 -e LOG_LEVEL=info \ # 日志级别(debug/info/warn/error) myregistry/push-exporter:latest
yamlversion: '3.8' services: push-exporter: image: myregistry/push-exporter:latest container_name: push-exporter ports: - "9234:9234" environment: - PUSH_TARGETS="https://api.example.com/push,ws://mqtt.example.com:8083" - SCRAPE_INTERVAL=10s - LOG_LEVEL=info - CUSTOM_LABELS="service=user-notify,env=prod" # 自定义监控标签 restart: unless-stopped
| 参数名 | 描述 | 默认值 | 示例值 |
|---|---|---|---|
PORT | 监听端口 | 9234 | 9234 |
PUSH_TARGETS | 目标推送服务地址列表(逗号分隔) | 无(必填) | "[***]" |
SCRAPE_INTERVAL | 指标采集间隔(支持s/m/h单位) | 15s | 10s |
LOG_LEVEL | 日志级别 | info | debug |
CUSTOM_LABELS | 自定义Prometheus标签(key=value格式,逗号分隔) | 无 | "service=user-notify,env=prod" |
TIMEOUT | 推送请求超时时间 | 5s | 3s |
如需更复杂配置(如按协议自定义监控规则),可通过挂载配置文件实现。配置文件为YAML格式,示例:
yaml# push-exporter-config.yaml targets: - url: "https://api.example.com/push" protocol: http timeout: 5s labels: service: "order-push" - url: "ws://mqtt.example.com:8083" protocol: websocket scrape_interval: 20s global: log_level: warn custom_labels: env: prod
挂载命令:
bashdocker run -d \ --name push-exporter \ -p 9234:9234 \ -v $(pwd)/push-exporter-config.yaml:/app/config.yaml \ # 挂载配置文件 myregistry/push-exporter:latest --config /app/config.yaml
启动后,通过 http://<容器IP>:9234/metrics 访问指标接口,示例指标:
push_success_total{target="https://api.example.com/push",service="order-push"} 1250 push_failure_total{target="https://api.example.com/push",reason="timeout",service="order-push"} 12 push_latency_seconds_avg{target="https://api.example.com/push",service="order-push"} 0.85
可在Prometheus中添加如下抓取配置:
yamlscrape_configs: - job_name: 'push-exporter' static_configs: - targets: ['push-exporter:9234'] # 容器名或IP:端口
SCRAPE_INTERVAL(如30s),避免指标采集影响推送性能。您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。




来自真实用户的反馈,见证轩辕镜像的优质服务