Skip to content

Commit

Permalink
prometheus metrics caoyingjunz#231
Browse files Browse the repository at this point in the history
  • Loading branch information
aide-cloud committed Jul 30, 2023
1 parent 41c9d76 commit b10b4c9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 106 deletions.
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
[![License][license-image]][license-url]

## Overview

This driver allows Kubernetes to access LocalStorage on Linux node.

## Getting Started

### Installation

- 选择运行 `localstorage``kubernetes` 节点
```shell
kubectl label node <node-name> storage.caoyingjunz.io/node=
Expand Down Expand Up @@ -80,28 +78,27 @@ Table of exported metrics:
| `localstorage_controller_volumes_total` | Gauge | HELP localstorage_controller_volume_size The size of each volume in localstorage |
| `localstorage_controller_volume_size` | Gauge | HELP localstorage_controller_volumes_total The total number of volumes in localstorage |

## Feature
## Prometheus

The Prometheus configuration to scrape metrics from Logstash-exporter on Kubernetes is available
at [prometheus.yml](./docs/prometheus.yml).


## Feature
- Schedule with volume status
- Volume metrics

## 学习分享

- [go-learning](https://github.com/caoyingjunz/go-learning)

## 沟通交流

- 搜索微信号 `yingjuncz`, 备注(ls), 验证通过会加入群聊
- [bilibili](https://space.bilibili.com/3493104248162809?spm_id_from=333.1007.0.0) 技术分享

Copyright 2019 caoyingjun ([email protected]) Apache License 2.0

[build-url]: https://github.com/caoyingjunz/csi-driver-localstorage/actions/workflows/ci.yml/badge.svg

[release-image]: https://img.shields.io/badge/release-download-orange.svg

[release-url]: https://www.apache.org/licenses/LICENSE-2.0.html

[license-image]: https://img.shields.io/badge/license-Apache%202-4EB1BA.svg

[license-url]: https://www.apache.org/licenses/LICENSE-2.0.html
2 changes: 0 additions & 2 deletions cmd/localstorage-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"strconv"
"time"

k8sRuntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/server/healthz"
Expand Down Expand Up @@ -178,7 +177,6 @@ func main() {
}

go func() {
defer k8sRuntime.HandleCrash()
err = http.ListenAndServe(net.JoinHostPort("", strconv.Itoa(*metricsPort)), mux)
if err != nil {
klog.ErrorS(err, "Failed to start metrics server")
Expand Down
95 changes: 0 additions & 95 deletions deploy/latest/prometheus-service.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions docs/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
global:
scrape_interval: 10s # 采样周期
evaluation_interval: 10s # 告警规则计算周期

scrape_configs:
- job_name: 'localstorage_controller'
static_configs:
- targets: [ '<pixiu-ls-controller>:10259' ] # 10259 is metrics port

0 comments on commit b10b4c9

Please sign in to comment.