Thursday, 2019-04-18

*** irclogbot_3 has quit IRC01:05
*** irclogbot_3 has joined #openstack-vitrage01:06
*** bobh has joined #openstack-vitrage01:50
*** bobh has quit IRC01:51
*** ifat_afek has joined #openstack-vitrage05:24
*** e0ne has joined #openstack-vitrage06:17
*** e0ne has quit IRC06:18
*** e0ne has joined #openstack-vitrage08:33
*** e0ne has quit IRC08:34
*** e0ne has joined #openstack-vitrage08:45
*** e0ne has quit IRC08:47
*** e0ne has joined #openstack-vitrage08:59
*** e0ne has quit IRC09:54
*** e0ne has joined #openstack-vitrage10:00
*** hoa has joined #openstack-vitrage11:04
hoahi, i'm want to write unit test for kapacitor datasource but never do write it before.Have any document, or command for run that test???11:07
ifat_afekhoa: hi11:07
ifat_afekyou can see examples in other tests, like: vitrage/tests/unit/datasources/prometheus/test_prometheus_driver.py11:08
ifat_afekyou can run a specific test using:  tox -epy27 -- TestVitrageTemplate11:08
hoayeah, i saw, but how i run it?11:08
ifat_afekor you can run all tests using ‘tox -epy27’11:08
ifat_afekyou can also run it inside pycharm, if you are using it11:09
hoaand how that command work? little explain it :-)11:10
ifat_afektox is used to run tests on a specific project11:10
ifat_afek-e is for one of tox targets. we have: py27, py36, docs, releasenotes, pep811:11
ifat_afekand if you write the name of the test class, then it runs the test11:11
hoaso if i run 'tox -epy27 PrometheusDriverTest' it do Prometheus test right?11:12
ifat_afekyes, it should11:12
hoaand in that test, what mocks  module do?11:12
ifat_afekif you run it from pycharm, you will be able to debug too11:12
ifat_afekthe mocks module is used to create mock data. it means that you don’t really get events from Prometheus or Kapacitor, because it’s a unit test. the mock simulates these events11:13
ifat_afekit is not well documented, you’ll have to copy&paste from another datasource to make that part work11:13
ifat_afeksorry for that11:13
hoayeah, hope you help me for that doc. i'm bad in english and still not good in code too. :-)11:15
ifat_afeksorry :-(11:16
ifat_afekyour English is ok :-)11:16
hoai'm basically a sysadmin, nano editor seem familiar to me, not pycharm :-D11:16
ifat_afek:D11:17
hoaumm. that mock simulates event, any document can help me in that?11:18
ifat_afekno… it was written long ago and was not documented11:19
ifat_afekI think that you can just create a hard-coded event in your test class, instead of using the mock11:19
hoa. about the code i had push, in mapping betwent instance and host that kapacior alarm. i still don't get the ideal11:21
ifat_afekthe alarm is on a host or on an instance? or it can be both?11:21
hoacan be both11:21
ifat_afekok, so it’s a bit complicated. you don’t want to write an instance id in the conf file, because instances can be created/deleted all the time11:22
ifat_afekso we found a solution from Prometheus, and you may reuse it if it’s good for Kapacitor11:23
ifat_afekdid you read the spec?11:23
hoai did read. it point on domain of libvirt?  or???11:23
ifat_afekthe Prometheus alarm can point to a host or an instance. and they are identified by Prometheus labels. and the conf file defines the rules of how to translate them to Vitrage resources11:25
hoain resources section of the mapping file . i see  --- instance_name: "1.1.1.1:9999" host_id: "instance-00000004" ---- but  "1.1.1.1:9999" seem weird and host_id "instance-00000004" look weird too.11:32
ifat_afekinstance_name is just an example, it is not real11:33
ifat_afekhost_id is the libvirt name of the instance (I think)11:33
hoaex : my instance have name: "node1" and id "fdb0ccf1-4367-4bce-a8a0-9f15e2739224" ... strange....11:34
ifat_afekthese are the values that you get from Prometheus, I think11:34
ifat_afekthese are not Nova values11:34
ifat_afekPrometheus knows the ip and port of the instance, and also its libvirt name11:35
ifat_afekyou don’t need to care about it, it is relevant only to Prometheus11:35
ifat_afekthe important part is that you understand what are the Kapacitor fiels that identify the resource and how to tell Vitrage if it’s a host or an instance and the id11:35
hoaso let see . in TICK, each metric (or alert) alway have "host" tag (hostname) to tell where metric belong to11:40
hoai only see that field to identify the resource.11:40
ifat_afekbut how can you tell if it’s a host or an instance?11:40
hoacan't . telegraf agent install on host or instance to get metric. When hostname is point on alert. i map it to vitrage, tell that resource type is nova.instance or nova.host ?11:43
ifat_afekso you can’t know the type from the alarm fields?11:52
hoayeah. i don't see that way11:55
hoa*way to find it*11:57
*** bobh has joined #openstack-vitrage11:59
ifat_afekok. in that case, maybe you should define a conf file that is similar to Zabbix, and only maps hosts. and in the code you can decide that if the “host” is not mapped to anything, it means that it’s an instance12:04
ifat_afekcan it be something else? (like interface, switch)12:04
hoai just ask our expert, he say i can tag type of that resource . Of all . tag of alarm have basic tags is "host= {{hostname }}" . i can tag "type= {{instance}}"12:06
hoahttps://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md12:06
hoain section [golbal]12:06
hoamay it work12:06
ifat_afekit can work, but it’s problematic12:06
ifat_afekbecause it will work only in your environment12:07
ifat_afekother customers will not have the “type” tag12:07
ifat_afekusually we want the datasources to connect to *any* environment12:07
hoaum ok. TICK-telegraf can monitor switch too. https://lkhill.com/telegraf-influx-grafana-network-stats/12:09
ifat_afekI’m not sure what to say. If you have a host and a switch with the same name, how can Vitrage tell what resource it is?12:14
hoahttps://jsonblob.com/83e75e9c-61d4-11e9-a9df-ffa188c70e7d. it all i have on one alarm12:22
hoa...12:22
*** bobh has quit IRC12:23
hoai think in series field . the "name" - mean name-of-metric may useful12:23
ifat_afekhow can it help12:27
ifat_afek?12:27
hoayour can config that name in telegraft conf file . if a switch interface you can change it to "interface" or anything u want12:35
hoaseem like problematic too12:36
hoa:-)12:36
*** smrcascao has joined #openstack-vitrage12:38
ifat_afekyes, because again it requires some actions in Kapacitor in order to make it work12:42
ifat_afekwe prefer to just configure the datasource inside Vitrage and not touch Kapacitor12:42
hoai understand . so we skip on case monitor switch, mapping file like zabbix with resource.type chose betwent [nova.host or nova.instance ] ?12:45
ifat_afekin your environment, you only need host and instance?12:45
hoayes. we not monitor switch yet.12:46
ifat_afekso maybe you can start with a simple case and optionally change it in the future12:47
hoaif switch join in. maybe it will mess @@. but we just don't send it to vitrage is ok12:47
hoaok i fix code tomorrow . get_all() function seem complicated and maybe need touch to kapacitor , i may implement in another pull . Ok?12:53
*** hoa has quit IRC12:54
ifat_afeksure. you can also split the StoryBoard story to two stories. and implement the next one later12:58
*** ifat_afek has quit IRC13:10
*** e0ne has quit IRC15:08
*** e0ne has joined #openstack-vitrage15:09
*** e0ne has quit IRC15:16
*** bobh has joined #openstack-vitrage15:41
*** bobh has quit IRC16:16
*** bobh has joined #openstack-vitrage16:29
*** e0ne has joined #openstack-vitrage16:48
*** e0ne has quit IRC16:52
*** e0ne has joined #openstack-vitrage16:52
*** bobh has quit IRC16:57
*** e0ne has quit IRC16:58
*** e0ne has joined #openstack-vitrage19:14
*** e0ne has quit IRC19:18

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!