metrics

[k8s]metricbeat的kubernetes模块&kube-metric模块

给你一囗甜甜゛ 提交于 2019-12-30 03:41:14
正确姿势启动metricbeat metricbeat.modules: - module: system metricsets: - cpu - filesystem - memory - network - process enabled: true period: 10s processes: ['.*'] cpu_ticks: false output.elasticsearch: hosts: ["http://192.168.x.x:9200"] setup.template.name: "metricbeat" setup.template.fields: "fields.yml" setup.template.overwrite: true setup.template.settings: index.number_of_shards: 1 index.number_of_replicas: 1 setup.kibana.host: "192.168.x.x:5601" setup.dashboards.enabled: true ./metricbeat -e -c metricbeat.yml -d "publish" metricbeat的Kubernetes插件 metricbeat.modules: # Node metrics, from kubelet

Ambari-java python多用混合

泄露秘密 提交于 2019-12-29 15:26:25
由于 Ambari Metrics 存储的是集群运行情况信息,在当前集群运行良好情况下,不是特别重要;所以我们采取删除重建的方式修复。以下为主要步骤: 删除 Ambari Metrics 元数据 Ambari Metrics 使用 hbase 存储数据。hbase 元数据存储在 zookeeper 上。 查看 ams-hbase-site 配置 zookeeper.znode.parent 项,确定其元数据存储路径,然后使用zkClient进行删除。 删除 Ambari Metrics 历史数据 Ambari Metrics 使用 hbase 存储数据。hbase 数据存储在本地目录(单节点)或hdfs中(高可用)。 查看 ams-hbase-site 配置 hbase.rootdir 项,确定数据存储路径,使用命令行进行删除。 删除 Ambari Metrics 临时文件 Ambari Metrics 临时文件包含: a. Aggregator checkpoint 目录:配置在 Metrics Collector 的 Aggregator checkpoint directory 项中。 b. hbase 本地文件:配置在 ams-hbase-site 的 hbase.local.dir 项中。 c. phoenix spool 目录:配置在 ams-hbase-site 的

how to implement custom metric in keras?

不羁岁月 提交于 2019-12-29 04:14:28
问题 I get this error : sum() got an unexpected keyword argument 'out' when I run this code: import pandas as pd, numpy as np import keras from keras.layers.core import Dense, Activation from keras.models import Sequential def AUC(y_true,y_pred): not_y_pred=np.logical_not(y_pred) y_int1=y_true*y_pred y_int0=np.logical_not(y_true)*not_y_pred TP=np.sum(y_pred*y_int1) FP=np.sum(y_pred)-TP TN=np.sum(not_y_pred*y_int0) FN=np.sum(not_y_pred)-TN TPR=np.float(TP)/(TP+FN) FPR=np.float(FP)/(FP+TN) return((1

monitoring with Prometheus

时光毁灭记忆、已成空白 提交于 2019-12-29 01:42:22
Prometheus是一款开源的监控工具,支持k8s metrics的数据格式,同时也支持通过k8s api进行服务发现从而实现对自定义的metrics进行监控。下面通过一个示例来介绍如何将Prometheus集成到k8s集群中。 参考资料 文中的示例具体参考了这篇文章: https://coreos.com/blog/monitoring-kubernetes-with-prometheus.html Prometheus官方文档: https://prometheus.io/docs 镜像:quay.io/prometheus/prometheus:v1.0.1 示例 编排需要两个文件: prom-deployment.yml 和 prom-service.yml 。前者用于创建deployment并运行一个pod,还创建了一个configmap用于配置Prometheus。后者用于对外提供Prometheus服务。 下面介绍一下configmap中的几个关键配置: scrape_configs用来配置数据源(Prometheus称之为target),每个target可以用job_name来命名。Prometheus会定期向每个target发送http请求来获取metrics数据,默认path为/metrics。

k8s实践17:监控利器prometheus helm方式部署配置测试

点点圈 提交于 2019-12-28 00:14:26
监控利器prometheus helm方式部署配置测试 1.部署helm 部署helm参考方法 后面使用helm部署grafana和prometheus,因此首先需要部署helm,保证helm能正常使用. 部署helm客户端过程见下: [root@k8s-node1 helm]# curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6617 100 6617 0 0 5189 0 0:00:01 0:00:01 --:--:-- 5193 [root@k8s-node1 helm]# ls get_helm.sh [root@k8s-node1 helm]# chmod 700 get_helm.sh [root@k8s-node1 helm]# ./get_helm.sh Downloading https://get.helm.sh/helm-v3.0.2-linux-amd64.tar.gz Preparing to install helm

Prometheus监控学习笔记之Prometheus存储

我只是一个虾纸丫 提交于 2019-12-27 03:55:02
0x00 概述 Prometheus之于kubernetes(监控领域),如kubernetes之于容器编排。 随着heapster不再开发和维护以及influxdb 集群方案不再开源,heapster+influxdb的监控方案,只适合一些规模比较小的k8s集群。而prometheus整个社区非常活跃,除了官方社区提供了一系列高质量的exporter,例如node_exporter等。Telegraf(集中采集metrics) + prometheus的方案,也是一种减少部署和管理各种exporter工作量的很好的方案。 今天主要讲讲我司在使用prometheus过程中,存储方面的一些实战经验。 0x01 Prometheus 储存瓶颈 通过prometheus的架构图可以看出,prometheus提供了本地存储,即tsdb时序数据库。本地存储的优势就是运维简单,缺点就是无法海量的metrics持久化和数据存在丢失的风险,我们在实际使用过程中,出现过几次wal文件损坏,无法再写入的问题。 当然prometheus2.0以后压缩数据能力得到了很大的提升。为了解决单节点存储的限制,prometheus没有自己实现集群存储,而是提供了远程读写的接口,让用户自己选择合适的时序数据库来实现prometheus的扩展性。 prometheus通过下面两种方式来实现与其他的远端存储系统对接

使用kubeadm安装Kubernetes 1.15

假装没事ソ 提交于 2019-12-25 00:21:11
kubeadm是Kubernetes官方提供的用于快速安装Kubernetes集群的工具,伴随Kubernetes每个版本的发布都会同步更新,kubeadm会对集群配置方面的一些实践做调整,通过实验kubeadm可以学习到Kubernetes官方在集群配置上一些新的最佳实践。 1.准备 1.1系统配置 [root@k8s-master ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.246 k8s-master 192.168.0.247 k8s-node1 192.168.0.248 k8s-node2 如果各个主机启用了防火墙,需要开放Kubernetes各个组件所需要的端口,可以查看Installing kubeadm中的”Check required ports”一节。 这里简单起见在各节点禁用防火墙: systemctl stop firewalld systemctl disable firewalld 禁用SELINUX: setenforce 0 vi /etc

How do I deal with old collected metrics in Prometheus?

谁都会走 提交于 2019-12-24 20:42:30
问题 I am using a Gauge Vector in my application for collecting and exposing a particular metric with labels from my application in the Prometheus metrics format. The problem is that once I have set a metric value for a particular set of labels, even if that metric is not collected again it will be scraped by Prometheus until the application restarts and the metric is removed from memory. This means that even if that metric is no longer valid anymore (hasn't been set again for a day say)

Prometheus+Grafana监控系统搭建

假装没事ソ 提交于 2019-12-24 18:25:07
博文大纲: 一、prometheus简介 二、Prometheus组成及架构 三、部署prometheus 1)环境准备 2)部署prometheus 一、prometheus简介 Prometheus是一套开源的系统监控报警框架。它以给定的时间间隔从已配置的目标收集指标,评估规则表达式,显示结果,并在发现某些情况为真时触发警报。 作为新一代的监控框架,Prometheus具有以下特点 : 强大的多维度数据模型: (1)时间序列数据通过metric名和键值对来区分; (2)所有的metrics都可以设置任意的多维标签; (3)数据模型更随意,,不需要刻意设置为以点分隔的字符串; (4)可以对数据模型进行聚合、切割和切片操作; (5)支持双精度浮点类型,标签可以设为全unicode(统一码); 灵活、强大的查询语句:在同一个查询语句,可以对多个 metrics 进行乘法、加法、连接、取分数位等操作; 易于管理:不依赖于分布式存储; 使用 pull 模式采集时间序列数据; 可以采用 push gateway 的方式把时间序列数据推送至 Prometheus server 端; 可以通过服务发现或者静态配置去获取监控的 targets; 有多种可视化图形界面; 易于伸缩。; 二、Prometheus组成及架构 Prometheus包含了许多组件,其中许多组件都是可选的,常用的组件有:

Standard node.js metrics?

偶尔善良 提交于 2019-12-24 13:13:14
问题 Are there any standard metrics publishing packages for node.js? I'm not asking about general metrics libraries, but rather packages that produce a specific set of metrics (e.g. http QPS, runtime memory usage, gc stats, etc...) If you wanted to offer a monitoring service for node.js users, what would you monitor? 回答1: I believe that Node Application Metrics ('appmetrics') provides what your looking for. This is a module that provides a set of metrics about a running Node.js process, rather