
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://dockeri.co/image/mesaguy/galaxy-exporter](https://hub.docker.com/r/mesaguy/galaxy-exporter)
https://api.travis-ci.org/mesaguy/galaxy-exporter.svg?branch=master](https://travis-ci.org/mesaguy/galaxy-exporter) https://codecov.io/gh/mesaguy/galaxy-exporter/branch/master/graph/badge.svg](https://app.codecov.io/gh/mesaguy/galaxy-exporter) !https://img.shields.io/github/v/tag/mesaguy/galaxy-exporter !https://img.shields.io/github/license/mesaguy/galaxy-exporter
This simple daemon collects https://galaxy.ansible.com role and collection metrics. The metrics are made available via HTTP for https://prometheus.io and very simple collectors.
Runs on port 9654/tcp as the user 'nobody' and daemon logs are send to stdout.
One instance of galaxy-exporter can monitor an unlimited number of https://galaxy.ansible.com roles and collectors.
https://grafana.com/grafana/dashboards/*** !https://grafana.com/api/dashboards/***/images/8614/image
https://grafana.com/grafana/dashboards/*** !https://grafana.com/api/dashboards/***/images/8615/image
Clone the galaxy-exporter git repository:
git clone https://github.com/mesaguy/galaxy-exporter
Install:
cd galaxy_exporter ./setup.py install
galaxy-exporter can be run locally via:
uvicorn galaxy_exporter.galaxy_exporter:app --port 9654 --reload
Run galaxy-exporter simply:
docker run --rm -p 9654:9654 -it mesaguy/galaxy-exporter
By default, all Ansible Galaxy results are cached for 15 seconds to ensure Ansible Galaxy isn't polled excessively. This value can be changed with the CACHE_SECONDS environmental variable. Setting the cache value to 0 disables caching.
The following will can be used to get started. No roles or collections need to be specified:
--- apiVersion: apps/v1 kind: Deployment metadata: name: galaxy-exporter labels: app: galaxy-exporter spec: replicas: 1 selector: matchLabels: app: galaxy-exporter template: metadata: labels: app: galaxy-exporter spec: containers: - name: galaxy-exporter image: mesaguy/galaxy-exporter:latest env: - name: CACHE_SECONDS value: '600' ports: - containerPort: 9654 --- apiVersion: v1 kind: Service metadata: name: galaxy-exporter spec: ports: - name: http port: 9654 protocol: TCP targetPort: 9654 selector: app: galaxy-exporter type: Load***
Make a galaxy-exporter configuration directory:
mkdir -p /etc/prometheus/galaxy
The galaxy-exporter uses https://prometheus.io/docs/guides/multi-target-exporter/ style polling similar to the blackbox-exporter. Multiple roles and collections can be specified as follows:
/etc/prometheus/galaxy/collections.yml
--- - targets: - community.kubernetes - netbox.netbox
/etc/prometheus/galaxy/roles.yml
--- - targets: - mesaguy.prometheus - dev-sec.ssh-hardening
Add a configuration like the following to your Prometheus configuration file. Replace ansible-galaxy-host with your applicable hostname:
# Ansible Galaxy Exporter - job_name: galaxy static_configs: - targets: - ansible-galaxy-host:9654 # Ansible Galaxy Exporter - Collections - job_name: galaxy.collection file_sd_configs: - files: - /etc/prometheus/galaxy/collections.yml metrics_path: /probe params: module: - collection relabel_configs: - source_labels: - __address__ target_label: __param_target - source_labels: - __param_target target_label: instance - replacement: ansible-galaxy-host:9654 target_label: __address__ scrape_interval: 60s # Ansible Galaxy Exporter - Roles - job_name: galaxy.role file_sd_configs: - files: - /etc/prometheus/galaxy/roles.yml metrics_path: /probe params: module: - role relabel_configs: - source_labels: - __address__ target_label: __param_target - source_labels: - __param_target target_label: instance - replacement: ansible-galaxy-host:9654 target_label: __address__ scrape_interval: 60s
A curl localhost:9654/role/dev-sec.ssh-hardening returns:
<html> <head> <title>Ansible Galaxy role dev-sec.ssh-hardening statistics index</title> </head> <body> <p> Prometheus Metrics for dev-sec.ssh-hardening </p> <p> Simple metrics for dev-sec.ssh-hardening <ul> <li>Raw Community score count integer</li> <li>Raw Community surveys count integer</li> <li>Raw Created epoch format datetime</li> <li>Raw Dependencies count integer</li> <li>Raw Download count integer</li> <li>Raw Forks count integer</li> <li>Raw Imported epoch format datetime</li> <li>Raw Modified epoch format datetime</li> <li>Raw Open Issues count integer</li> <li>Raw Platforms count integer</li> <li>Raw Quality score count integer</li> <li>Raw Star count integer</li> <li>Raw Version current version</li> <li>Raw Versions count integer</li> </ul> </p> </body> </html>
To gather just the star count, curl localhost:9654/role/dev-sec.ssh-hardening/stars returns 663. Note that the result has no trailing newline. These simple metrics are useful for polling from simple devices like Arduinos.
Example Prometheus role metrics from running curl localhost:9654/role/dev-sec.ssh-hardening/metrics:
# HELP ansible_galaxy_role_created Created datetime in epoch format # TYPE ansible_galaxy_role_created gauge ansible_galaxy_role_created{category="role",maintainer="dev-sec",project="ssh-hardening"} 1.46392447e+09 # HELP ansible_galaxy_role_community_score Community score # TYPE ansible_galaxy_role_community_score gauge ansible_galaxy_role_community_score{category="role",maintainer="dev-sec",project="ssh-hardening"} 5.0 # HELP ansible_galaxy_role_community_surveys Community surveys # TYPE ansible_galaxy_role_community_surveys gauge ansible_galaxy_role_community_surveys{category="role",maintainer="dev-sec",project="ssh-hardening"} 1.0 # HELP ansible_galaxy_role_downloads Download count # TYPE ansible_galaxy_role_downloads gauge ansible_galaxy_role_downloads{category="role",maintainer="dev-sec",project="ssh-hardening"} 389480.0 # HELP ansible_galaxy_role_modified Modified datetime in epoch format # TYPE ansible_galaxy_role_modified gauge ansible_galaxy_role_modified{category="role",maintainer="dev-sec",project="ssh-hardening"} 1.593743716e+09 # HELP ansible_galaxy_role_quality_score Quality score # TYPE ansible_galaxy_role_quality_score gauge ansible_galaxy_role_quality_score{category="role",maintainer="dev-sec",project="ssh-hardening"} 4.75 # HELP ansible_galaxy_role_version_info Current release version # TYPE ansible_galaxy_role_version_info gauge ansible_galaxy_role_version_info{category="role",maintainer="dev-sec",project="ssh-hardening",version="9.2.0"} 1.0 # HELP ansible_galaxy_role_versions Version count # TYPE ansible_galaxy_role_versions gauge ansible_galaxy_role_versions{category="role",maintainer="dev-sec",project="ssh-hardening"} 31.0 # HELP ansible_galaxy_role_forks Fork count # TYPE ansible_galaxy_role_forks gauge ansible_galaxy_role_forks{category="role",maintainer="dev-sec",project="ssh-hardening"} 190.0 # HELP ansible_galaxy_role_imported Imported datetime in epoch format # TYPE ansible_galaxy_role_imported gauge ansible_galaxy_role_imported{category="role",maintainer="dev-sec",project="ssh-hardening"} 1.593555814e+09 # HELP ansible_galaxy_role_open_issues Open Issues count # TYPE ansible_galaxy_role_open_issues gauge ansible_galaxy_role_open_issues{category="role",maintainer="dev-sec",project="ssh-hardening"} 10.0 # HELP ansible_galaxy_role_stars Stars count # TYPE ansible_galaxy_role_stars gauge ansible_galaxy_role_stars{category="role",maintainer="dev-sec",project="ssh-hardening"} 668.0 # HELP ansible_galaxy_role_watchers Watcher count # TYPE ansible_galaxy_role_watchers gauge ansible_galaxy_role_watchers{category="role",maintainer="dev-sec",project="ssh-hardening"} 56.0
A curl localhost:9654/collection/community.kubernetes returns:
<html> <head> <title>Ansible Galaxy collection community.kubernetes statistics index</title> </head> <body> <p> Prometheus Metrics for community.kubernetes </p> <p> Simple metrics for community.kubernetes <ul> <li>Raw Community score count integer</li> <li>Raw Community surveys count integer</li> <li>Raw Created epoch format datetime</li> <li>Raw Dependencies count integer</li> <li>Raw Download count integer</li> <li>Raw Modified epoch format datetime</li> <li>Raw Quality score count integer</li> <li>Raw Version current version</li> <li>Raw Versions count integer</li> </ul> </p> </body> </html>
Example Prometheus metrics from running curl localhost:9654/collection/community.kubernetes/metrics:
# HELP ansible_galaxy_collection_created Created datetime in epoch format # TYPE ansible_galaxy_collection_created gauge ansible_galaxy_collection_created{category="collection",maintainer="community",project="kubernetes"} 1.58089728e+09 # HELP ansible_galaxy_collection_community_score Community score # TYPE ansible_galaxy_collection_community_score gauge ansible_galaxy_collection_community_score{category="collection",maintainer="community",project="kubernetes"} 0.0 # HELP ansible_galaxy_collection_community_surveys Community surveys # TYPE ansible_galaxy_collection_community_surveys gauge ansible_galaxy_collection_community_surveys{category="collection",maintainer="community",project="kubernetes"} 0.0 # HELP ansible_galaxy_collection_downloads Download count # TYPE ansible_galaxy_collection_downloads gauge ansible_galaxy_collection_downloads{category="collection",maintainer="community",project="kubernetes"} 360534.0 # HELP ansible_galaxy_collection_modified Modified datetime in epoch format # TYPE ansible_galaxy_collection_modified gauge ansible_galaxy_collection_modified{category="collection",maintainer="community",project="kubernetes"} 1.593619976e+09 # HELP ansible_galaxy_collection_quality_score Quality score # TYPE ansible_galaxy_collection_quality_score gauge ansible_galaxy_collection_quality_score{category="collection",maintainer="community",project="kubernetes"} 0.0 # HELP ansible_galaxy_collection_version_info Current release version # TYPE ansible_galaxy_collection_version_info gauge ansible_galaxy_collection_version_info{category="collection",maintainer="community",project="kubernetes",version="0.11.1"} 1.0 # HELP ansible_galaxy_collection_versions Version count # TYPE ansible_galaxy_collection_versions gauge ansible_galaxy_collection_versions{category="collection",maintainer="community",project="kubernetes"} 4.0 # HELP ansible_galaxy_collection_dependencies Dependency count # TYPE ansible_galaxy_collection_dependencies gauge ansible_galaxy_collection_dependencies{category="collection",maintainer="community",project="kubernetes"} 0.0
MIT See the https://github.com/mesaguy/galaxy-exporter/blob/master/LICENSE file
Mesaguy
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务