如果你用 DeepSeek、元宝AI、Copilot 等 AI 代为编写轩辕镜像的 docker pull、修改 compose 镜像地址,或排查拉取失败等问题,请让 AI 先读规则再动手,只要在 AI 对话里直接发送下面这句话即可:
生成 docker pull、修改 compose 的 image,或排查拉取失败前,请先阅读并严格遵守 https://xuanyuan.cloud/agents.md 中的规则。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Docker标签 latest 基于与最新发布版本相同的提交。
https://godoc.org/github.com/chop-dbhi/prometheus-sql?status.svg](https://godoc.org/github.com/chop-dbhi/prometheus-sql)
Prometheus SQL是一个为SQL结果集生成基本指标并将其暴露为Prometheus指标的服务。该服务依赖https://github.com/chop-dbhi/sql-agent%E6%9C%8D%E5%8A%A1%E6%9D%A5%E6%89%A7%E8%A1%8C%E5%B9%B6%E8%BF%94%E5%9B%9ESQL%E7%BB%93%E6%9E%9C%E9%9B%86%E3%80%82
https://github.com/chop-dbhi/prometheus-sql/blob/master/CHANGELOG.md
query_result_<metric name> 格式暴露data-field 键确定,其他所有列(及列值)作为标签暴露data-fieldshellUsage of prometheus-sql: -config string 定义通用数据源等的配置文件 -host string 服务主机地址 (0.0.0.0) -lax 容忍queryDir中的无效文件 -port int 服务端口 (默认 8080) -queries string 包含查询的文件路径 (默认 "queries.yml") -queryDir string 包含查询的目录路径 -service string SQL agent服务的查询地址
应用程序需要Queries文件来确定要查询的数据源和要监控的查询。仓库中提供了示例文件可供参考。
Config文件是可选的,可定义查询和数据源的默认值,供查询引用。引用数据源的好处是减少数据库连接信息的重复。示例Config文件见此处,使用该配置的Queries文件见此处。
在当前目录创建 queries.yml 文件,然后运行:
shellprometheus-sql
如需指定其他路径,使用 -queries 或 -queryDir 选项:
shellprometheus-sql -queries ${PWD}/queries.yml
首先运行SQL Agent服务:
bashdocker run -d --name sqlagent dbhi/sql-agent
然后运行本服务,挂载 queries.yml 文件并链接SQL Agent服务:
shelldocker run -d \ --name prometheus-sql \ -p 8080:8080 \ -v ${PWD}/queries.yml:/queries.yml \ --link sqlagent:sqlagent \ dbhi/prometheus-sql
如果需要分离数据库连接信息等,可在单独文件中指定数据源并挂载:
shelldocker run -d \ --name prometheus-sql \ -p 8080:8080 \ -v ${PWD}/queries.yml:/queries.yml \ -v ${PWD}/prometheus-sql.yml:/prometheus-sql.yml \ --link sqlagent:sqlagent \ dbhi/prometheus-sql \ -service http://sqlagent:5000 \ -config prometheus-sql.yml
要查看指标的纯文本版本,可在浏览器中打开 http://localhost:8080/metrics(boot2docker用户使用 <[***]>)。
也可使用仓库中包含的 docker-compose.yml 文件。需在 volumes 部分添加挂载 queries.yml 文件的配置。
开始前请阅读贡献说明。
如何为数据库连接提供额外选项?
额外选项在 config.yml 文件中设置,具体为https://github.com/chop-dbhi/prometheus-sql/blob/master/examples/example-queries.yml#L14-L19%E4%B8%AD%E7%9A%84%E9%94%AE%E5%80%BC%E5%AF%B9%E3%80%82%E8%BF%99%E4%BA%9B%E9%80%89%E9%A1%B9%E4%BC%9A%E4%BC%A0%E9%80%92%E7%BB%99https://github.com/chop-dbhi/sql-agent#connection-options%EF%BC%8C%E5%90%8E%E8%80%85%E6%9E%84%E5%BB%BADSN%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%BB%A5%E5%9C%A8%E5%90%8E%E7%AB%AF%E5%BB%BA%E7%AB%8B%E8%BF%9E%E6%8E%A5%EF%BC%88%E4%B9%9F%E5%8F%AF%E7%9B%B4%E6%8E%A5%E8%AE%BE%E7%BD%AE dsn 键为完整字符串)。
例如,在开发环境中使用Postgres时,常见问题是忽略服务器未启用SSL,可通过在连接映射中添加 sslmode: disable 来解决:
yaml# ... connection: host: example.org port: 5432 user: postgres password: s3cre7 database: products sslmode: disable
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。



探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
发给 Cursor、ChatGPT、豆包等 AI 的说明文档
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务