InfluxDB

influxdb sum first value metric of different series but same time interval for grafana graph

谁都会走 提交于 2019-12-22 09:56:27
问题 I am using influxdb grafana and collectd and i want to display memory usage graph. The collectd give me this metrics value for memory and save it in influxdb influxdb/memory/memory-buffered influxdb/memory/memory-cached influxdb/memory/memory-free influxdb/memory/memory-used i want to display in grafana graph the total memory so i need to sum the following metrics: memory_buffered + memory_cached + memory_free + memory_used How can I query this in influxdb or in grafana ? 回答1: I think this is

influxdb python: 404 page not found

北城余情 提交于 2019-12-22 05:19:12
问题 I am trying to use the influxdb-python lib which I found here. But I cant even get the tutorial programm to work. When I run the following example code: $ python >>> from influxdb import InfluxDBClient >>> json_body = [ { "measurement": "cpu_load_short", "tags": { "host": "server01", "region": "us-west" }, "time": "2009-11-10T23:00:00Z", "fields": { "value": 0.64 } } ] >>> client = InfluxDBClient('localhost', 8086, 'root', 'root', 'example') >>> client.create_database('example') I get this

采用 SpringBoot Actuator + InfluxDB + Grafana 实现小平台监控

会有一股神秘感。 提交于 2019-12-19 20:00:18
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 概述 SpringBoot应用对监控要求不是高,可以采用 SpringBootAdmin就可以搞定,但是如果需要长期,并且希望后期能优化应用,提高平台抗风险性时,可以使用InfluxDB保存应用的性能度量数据。 InfluxDB可以支持海量数据存储 Grafana可以显示不同维度的数据 操作步骤 SpringBoot Sample用例 生成 SpringBoot Sample 项目地址 https://start.spring.io/ 添加依赖包与配置 依赖包配置 <!---收集各种性能指标插件--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <!---通过此插件直接写数据到Influx DB--> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-influx</artifactId> </dependency> Influx DB配置 management: metrics: export:

Docker容器监控

陌路散爱 提交于 2019-12-19 19:48:58
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1.3.1 容器监控 利用docker compose组合应用并利用scale可以快速对容器进行扩充,而docker compose启动的服务容器都在同一台宿主机上,对于一个宿主机上运行多个容器应用时,容器的运行情况,如:CPU使用率,内存使用率,网络状态,磁盘空间等一系列随时间变化的时序数据信息,都需要进行了解,因此监控是必须的。 容器监控方案选择 对于容器的监控方案可谓多种多样,除了docker本身自带的 docker stats 命令,还有Scout,Data Dog,Sysdig Cloud,Sensu Monitoring Framework,CAdvisor等都可以对容器进行监控。 通过 docker stats 命令可以很方便的看到当前宿主机上所有容器的CPU,内存,以及网络流量等数据。但 docker stats 命令的缺点是只是统计当前宿主机的所有容器,为获取的数据是实时的,没有地方存储,也没有报警功能。 而Scout,Data Dog,Sysdig Cloud虽然都提供了教完善的服务,但是它们都是托管的服务且都是收费的,Sensu Monitoring Framework集成度较高,也免费,但是部署过于复杂,综合考虑选择CAdvisor做监控工具。 CAdvisor出自Google

InfluxDB

 ̄綄美尐妖づ 提交于 2019-12-19 19:17:25
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> InfluxDB简介 InfluxDB 是一个 Go 语言开发的开源(MIT)分布式时间序列数据库。 下载 https://www.influxdata.com/ https://portal.influxdata.com/downloads 安装启动 解压 启动 服务器端 ./influxd 客户端 ./influx 简单实践 create database meng show databases use meng insert weather,altitude=1000,area=北 temperature=11,humidity=-4 SELECT * FROM weather 参考资料 https://github.com/influxdata/influxdb http://wiki.huihoo.com/wiki/InfluxDB 官方文档 https://github.com/influxdata/docs.influxdata.com https://docs.influxdata.com/ 网上教程 https://xtutu.gitbooks.io/influxdb-handbook/content/ 教程 第一章:InfluxDB介绍 InfluxDB用Go语言编写的一个开源分布式时序

How to show “33 minutes ago” on Grafana dashboard with InfluxDB?

Deadly 提交于 2019-12-18 16:49:31
问题 I have recently set up Grafana with InfluxDB. I'd like to show a panel that indicates how long it has been since an event took place. Examples: Server last reported in: 33 minutes ago Last user sign up: 17 minutes ago I can get a single metric pretty easily with the following code: SELECT time, last("duration") as last_duration FROM custom_events ORDER BY time DESC But I can't seem to get Grafana to do what I want with the time field. Any suggestions? 回答1: Since Grafana(4.6.0) this is now

Delete points with unwanted field values from InfluxDB measurement

假如想象 提交于 2019-12-18 03:58:08
问题 InfluxDB lets you delete points based on WHERE tag='value' conditions, but not by field value. For example, if you have accidentally stored a measurement with a value of -1 in a series of positive floats (e.g. CPU utilization), DELETE FROM metrics WHERE cpu=-1 will return this error: fields not supported in WHERE clause during deletion 回答1: This is not possible in InfluxDB - see ticket 3210. You could overwrite the point with some other values by inserting in the measurement a point with the

使用 Rancher 管理 AWS EKS 集群

拜拜、爱过 提交于 2019-12-17 20:51:38
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> James Sun AWS解决方案架构师。James 拥有超过 15 年的信息技术行业从业经验。加入 AWS 前,他曾在 MapR、惠普、NetApp、雅虎和 EMC 等公司担任多个高级技术职位。他拥有斯坦福大学博士学位。 本文原发于亚马逊AWS官方博客。 Rancher 是一个流行的开源企业级Kubernetes管理平台,许多组织使用它来管理混合部署的Kubernetes 集群。Rancher 支持 Amazon Elastic Container Service for Kubernetes (Amazon EKS) ,借助此功能,Rancher用户可以直接通过Rancher平台来对AWS EKS进行直接纳管。 Amazon EKS 与 Rancher 结合后,使用方便,可兼具您在 Rancher 中养成的使用习惯与期望从 AWS 获得的功能、可靠性和性能。Amazon 的托管 Kubernetes 解决方案 EKS,可以让您 在云中快速创建可扩展的 Kubernetes 实例,而Rancher拥有简洁易用的UI和针对Kubernetes的更多拓展功能,强强组合将带来企业Kubernetes使用的操作体验和性能的极大提升。 不论你是EKS和Rancher的新手用户,还是对EKS或Rancher都有所了解

prometheus远程存储之influxdb和timescaledb对比测试

有些话、适合烂在心里 提交于 2019-12-17 11:09:52
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 写在最前面 看了timescaledb官方的测试文章 TimescaleDB比拼InfluxDB:如何选择合适的时序数据库? ,发现差异较大的只在存储, 就准备用timescaledb,因为公司有专门的数据库小组,可以对pg进行维护。但测试发现openstack监控一天的写入数据空间在150G左右,面对服务器那可怜的600G存储,明显是不够的。因此才有了influxdb和timescaledb的对比测试,结果发现在我司环境,timescaledb各方面均被influxdb超越。 背景 目前prometheus的监控数据存储使用自带的tsdb时序数据库,将数据存储在本地磁盘;没有接口对存储的数据进行管理,只能按存储块删除;由于抓取量大、频率高,占用的磁盘空间高,无法满足长时间存储的需求。 poc项目 对比目前流行的tsdb:timescaledb、influxdb,通过对接我司测试云环境openstack监控。一台物理机通过docker部署influxdb(1.7.6),一台物理机通过docker部署prometheus-postgresql-adapter(0.4.1)、pg_prometheus(0.2.1,timescaledb:1.2.0) 并从以下几方面进行对比: 1、性能 (1)Cpu、内存

grafana+cadvisor+influxdb 使用docker-compose实现监控

依然范特西╮ 提交于 2019-12-14 23:38:58
//以下内容直接复制到 docker-compose.yml 文件中。执行命令docker-compose up -d 之后访问 http://ip:3000 剩下的之后的测试连接数据库和监控自己百度 version: '3' services: influxdb: image: tutum/influxdb:0.9 container_name: influxdb restart: always environment: PRE_CREATE_DB=cadvisor ports: "8083:8083" "8086:8086" expose: "8090" "8099" volumes: influxdbData:/data cadvisor: image: google/cadvisor container_name: cadvisor links: influxdb:influxsrv command: -storage_driver=influxdb -storage_driver_db=cadvisor -storage_driver_host=influxsrv:8086 restart: always ports: "8080:8080" volumes: /:/rootfs:ro /var/run:/var/run:rw /sys:/sys:ro /var/lib