# gluster_exporter **Repository Path**: create17/gluster_exporter ## Basic Information - **Project Name**: gluster_exporter - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-20 - **Last Updated**: 2022-07-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gluster_exporter Gluster exporter for Prometheus 基于 https://github.com/ofesseler/gluster_exporter ,v0.2.7tag改造优化。改造或优化如下: - 命令行参数解析库,由用kingpin代替flag库 - 修复volume free/total获取不到的bug - 通过gluster volume status {volume} detail来判断volume状态,-> volume_status - 处理exporter运行时,volume heal info模块报错问题,默认不执行该模块 ## 编译 该 exporter 基于 go1.15.7 版本开发,编译。 下载下载项目代码后,可执行以下命令构建二进制文件: ``` go build ``` ## gluster_exporter的使用参数 ./gluster_exporter -h | Option | Default | Description | ------------------------ | ------------------- | ----------------- | -h, --hel | - | Displays usage. | --metrics-path | `/metrics` | URL Endpoint for metrics | --listen-address | `:9189` | The address to listen on for HTTP requests. | --version | - | Prints version information | --volumes.show.enabled | - | Enable show volume heal info | --volumes | `_all` | Show volume heal info, comma separated volume names: vol1,vol2,vol3. Default is '_all' to scrape all metrics | --profile | - | Get profile metrics | --quota | - | Get quota metrics ## Relevant Gluster Metrics Commands within the exporter are executed with `--xml`. exporter 相关指标是通过以下命令获取,通过xml解析 ### Command: `gluster volume info` | Name | type | impl. state | | ------------ | -------- | ------------| | OpErrno | Gauge | implemented | | opRet | Gauge | implemented | | Status | Gauge | implemented | | BrickCount | Gauge | implemented | | Volumes.Count | Gauge | implemented | | Volume.Status | Gauge | implemented | ### Command: `gluster peer status` | Name | type | impl. state | | ------------------------- | -------- | ------------| | peerStatus.peer.state | Gauge | pending | | peerStatus.peer.connected | Gauge | implemented | ### Command: `gluster volume list` with `gluster volume info` this is obsolete | Name | type | impl. state | | -------------- | -------- | ------------| | volList.count | Gauge | pending | | volList.volume | string | pending | ### Command: `gluster volume profile gv_test info cumulative` | Name | type | impl. state | | -------------------------------------------------- | -------- | ------------| | volProfile.profileOp | Gauge | pending | | volProfile.brickCount | Gauge | pending | | volProfile.cumulativeStatus.duration | Count | implemented | | volProfile.cumulativeStatus.totalRead | Count | implemented | | volProfile.cumulativeStatus.totalWrite | Count | implemented | | volProfile.cumulativeStats.fopStats.fop.Name | WRITE, STATFS, FLUSH, OPENDIR, CREATE, LOOKUP, READDIR, FINODELK, ENTRYLK, FXATTROP | pending | | volProfile.cumulativeStats.fopStats.fop.hits | count | implemented | | volProfile.cumulativeStats.fopStats.fop.avgLatency | Gauge | implemented | | volProfile.cumulativeStats.fopStats.fop.minLatency | Gauge | implemented | | volProfile.cumulativeStats.fopStats.fop.maxLatency | Gauge | implemented | ### Command `gluster volume status all detail` | Name | type | Labels | impl. state | |------|------|--------|-------------| | volStatus.volumes.volume[].node[].sizeFree | Gauge | hostname, path, volume | implemented | | volStatus.volumes.volume[].node[].sizeTotal | Gauge | hostname, path, volume | implemented | ### Metrics in prometheus | Name | Descritpion | | ------------ | -------- | | up | Was the last query of Gluster successful. | | volumes_count | How many volumes were up at the last query. | | volume_status | Status code of requested volume. | | node_size_free_bytes | Free bytes reported for each node on each instance. Labels are to distinguish origins | | node_size_total_bytes | Total bytes reported for each node on each instance. Labels are to distinguish origins | | brick_count | Number of bricks at last query. | | brick_duration | Time running volume brick. | | brick_data_read | Total amount of data read by brick. | | brick_data_written | Total amount of data written by brick. | | brick_fop_hits | Total amount of file operation hits. | | brick_fop_latency_avg | Average fileoperations latency over total uptime | | brick_fop_latency_min | Minimum fileoperations latency over total uptime | | brick_fop_latency_max | Maximum fileoperations latency over total uptime | | peers_connected | Is peer connected to gluster cluster. | | heal_info_files_count | File count of files out of sync, when calling 'gluster v heal VOLNAME info | | volume_writeable | Writes and deletes file in Volume and checks if it is writeable | | mount_successful | Checks if mountpoint exists, returns a bool value 0 or 1 | 再次感谢 https://github.com/ofesseler/gluster_exporter 作者的开源支持,谢谢