)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"276f6f78684b7dbb4eb934e63b7597a58e4576bb","unresolved":false,"context_lines":[{"line_number":8383,"context_line":"                clean_expired_console_auths_for_host(context, self.host)"},{"line_number":8384,"context_line":""},{"line_number":8385,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.metrics.collection_interval,"},{"line_number":8386,"context_line":"                                 external_process_ok\u003dTrue)"},{"line_number":8387,"context_line":"    def _run_metrics_collection_pass(self, context):"},{"line_number":8388,"context_line":"        LOG.debug(\u0027Collecting operational metrics\u0027)"},{"line_number":8389,"context_line":"        start_time \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_01bb4c0e","line":8386,"updated":"2019-03-19 16:26:25.000000000","message":"we already emit event-based metrics thru our notifications bus, why do we need to have time-based metrics, which are actually not better (you could miss some event between two collecting intervals, right?) ?","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"0114188b52e8ecbde326637320a14493761d4d8d","unresolved":false,"context_lines":[{"line_number":8404,"context_line":"                    m[\u0027uuid\u003d\"%(uuid)s\",metric\u003d\"%(metric)s\"\u0027"},{"line_number":8405,"context_line":"                      % {\u0027uuid\u0027: instance[\u0027uuid\u0027],"},{"line_number":8406,"context_line":"                         \u0027metric\u0027: key}] \u003d info[key]"},{"line_number":8407,"context_line":"                "},{"line_number":8408,"context_line":"            except exception.InstanceNotFound:"},{"line_number":8409,"context_line":"                pass"},{"line_number":8410,"context_line":"        metrics.save(\u0027gauge\u0027, \u0027instance_info\u0027, m)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_6f54db53","line":8407,"range":{"start_line":8407,"start_character":0,"end_line":8407,"end_character":16},"updated":"2019-03-14 05:44:25.000000000","message":"nit: Unnecessary white spaces.","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2ee5df1226ebcc8de9aabbbcc145d8fb39d16dd7","unresolved":false,"context_lines":[{"line_number":8413,"context_line":"        expended_time \u003d time.time() - start_time"},{"line_number":8414,"context_line":"        metrics.save(\u0027gauge\u0027, \u0027collection_duration\u0027, expended_time)"},{"line_number":8415,"context_line":""},{"line_number":8416,"context_line":"        metrics.publish()"},{"line_number":8417,"context_line":"        LOG.debug(\u0027Metric collection complete\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_f15cc4f1","line":8416,"range":{"start_line":8416,"start_character":8,"end_line":8416,"end_character":25},"updated":"2019-03-04 17:57:34.000000000","message":"do these need to be reset after publish, or does the service know they\u0027re cumulative?","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"b83bf8cc66f25af300216bd273217763ababa91e","unresolved":false,"context_lines":[{"line_number":8413,"context_line":"        expended_time \u003d time.time() - start_time"},{"line_number":8414,"context_line":"        metrics.save(\u0027gauge\u0027, \u0027collection_duration\u0027, expended_time)"},{"line_number":8415,"context_line":""},{"line_number":8416,"context_line":"        metrics.publish()"},{"line_number":8417,"context_line":"        LOG.debug(\u0027Metric collection complete\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_8552d267","line":8416,"range":{"start_line":8416,"start_character":8,"end_line":8416,"end_character":25},"in_reply_to":"9fdfeff1_f15cc4f1","updated":"2019-03-04 21:36:19.000000000","message":"You don\u0027t do maths in exposed metrics for prometheus, prometheus does that for you. So counters only reset when they wrap.","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"}],"nova/conf/metrics.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2ee5df1226ebcc8de9aabbbcc145d8fb39d16dd7","unresolved":false,"context_lines":[{"line_number":37,"context_line":"* Any other value"},{"line_number":38,"context_line":"\"\"\"),"},{"line_number":39,"context_line":"    cfg.StrOpt(\u0027push_gateway\u0027,"},{"line_number":40,"context_line":"         default\u003d\u0027localhost:9091\u0027,"},{"line_number":41,"context_line":"         help\u003d\"\"\""},{"line_number":42,"context_line":"The hostname and port of a prometheus pushgateway service to push metrics to."},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_f197e49b","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":34},"updated":"2019-03-04 17:57:34.000000000","message":"Any chance of doing this with standard ksa adapter config?\n\nIf the service is always going to be a localhost port, that would probably be overkill. But I would have thought conceptually this could be done with a centralized service.\n\nOn that topic, *is* there an openstack service (existing or proposed) to gather this kind of information?","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"02f638a849d4489ca3a70e631ad09830c130e1ea","unresolved":false,"context_lines":[{"line_number":37,"context_line":"* Any other value"},{"line_number":38,"context_line":"\"\"\"),"},{"line_number":39,"context_line":"    cfg.StrOpt(\u0027push_gateway\u0027,"},{"line_number":40,"context_line":"         default\u003d\u0027localhost:9091\u0027,"},{"line_number":41,"context_line":"         help\u003d\"\"\""},{"line_number":42,"context_line":"The hostname and port of a prometheus pushgateway service to push metrics to."},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_39dc5d17","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":34},"in_reply_to":"5fc1f717_617c9072","updated":"2019-03-20 22:27:38.000000000","message":"\u003e FWIW, Nova also exposes some metrics thru an API [1] so a\n \u003e pull-based model like Prometheus would rather like to use it.\n \u003e \n \u003e [1] https://developer.openstack.org/api-ref/compute/#usage-reports-os-simple-tenant-usage\n\nI\u0027m glad you brought this up. The referenced API can\u0027t expose ANY of the metrics added in the PoC here. A consumer might be able to infer or calculate the number of instances spawned/destroyed, but that\u0027s it. It\u0027s also a terrible API that shouldn\u0027t be extended to do more things, IMHO. Someone asserting that an external tool could pull the info reported in this patch by polling Nova\u0027s current REST API would make me wonder if that person even read the whole patch.\n\nWe can surely punt on all of this by saying \"meh, consume notifications and do it yourself\" but I think that\u0027s basically akin to just telling people wanting this kind of thing to just go away. What is proposed here (even if incomplete) is pretty ridiculously lightweight and I have a hard time understanding why it\u0027d be overly offensive to anyone.","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"449843d9cf7b2f38a6ebd2f800a9df6d2c79fdfb","unresolved":false,"context_lines":[{"line_number":37,"context_line":"* Any other value"},{"line_number":38,"context_line":"\"\"\"),"},{"line_number":39,"context_line":"    cfg.StrOpt(\u0027push_gateway\u0027,"},{"line_number":40,"context_line":"         default\u003d\u0027localhost:9091\u0027,"},{"line_number":41,"context_line":"         help\u003d\"\"\""},{"line_number":42,"context_line":"The hostname and port of a prometheus pushgateway service to push metrics to."},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_547339e9","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":34},"in_reply_to":"9fdfeff1_458f0acd","updated":"2019-03-04 23:45:45.000000000","message":"Right, so if the gateway thingy is running somewhere else, how is it secured? What stops Joe Blow from chucking bogus stats at it, or DoSing it?\n\nKeystoneauth (ksa) is an openstacky way to authenticate and talk to http services that are set up in an openstacky way. So like, this wouldn\u0027t be a nova process/thread, especially since as you say it could be running anywhere and not tied to nova at all. It would be a service like cinder or neutron and we would talk to it the same way.\n\n(I\u0027m not asserting that that\u0027s necessary or appropriate or even feasible, just trying to understand how this could fit in.)","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"ada1255c1d0e32999bd3a2e2add82ce15be962c4","unresolved":false,"context_lines":[{"line_number":37,"context_line":"* Any other value"},{"line_number":38,"context_line":"\"\"\"),"},{"line_number":39,"context_line":"    cfg.StrOpt(\u0027push_gateway\u0027,"},{"line_number":40,"context_line":"         default\u003d\u0027localhost:9091\u0027,"},{"line_number":41,"context_line":"         help\u003d\"\"\""},{"line_number":42,"context_line":"The hostname and port of a prometheus pushgateway service to push metrics to."},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_5e5cb04b","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":34},"in_reply_to":"9fdfeff1_547339e9","updated":"2019-03-05 07:27:00.000000000","message":"The pushgateway is a standard service offered by the prometheus team. It is not an openstack project. Thus, it doesn\u0027t do keystone at all. I am not aware of any way to lock down who sends updates to the gateway, not that I\u0027ve really looked.\n\nYou can read more about pushgateway at https://github.com/prometheus/pushgateway\n\nFrom the prometheus docs:\n\n\"Any user with access to the Pushgateway HTTP endpoint can create, modify and delete the metrics contained within. As the Pushgateway is usually scraped with honor_labels enabled, this means anyone with access to the Pushgateway can create any time series in Prometheus.\"\n(https://prometheus.io/docs/operating/security/#pushgateway)","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"276f6f78684b7dbb4eb934e63b7597a58e4576bb","unresolved":false,"context_lines":[{"line_number":37,"context_line":"* Any other value"},{"line_number":38,"context_line":"\"\"\"),"},{"line_number":39,"context_line":"    cfg.StrOpt(\u0027push_gateway\u0027,"},{"line_number":40,"context_line":"         default\u003d\u0027localhost:9091\u0027,"},{"line_number":41,"context_line":"         help\u003d\"\"\""},{"line_number":42,"context_line":"The hostname and port of a prometheus pushgateway service to push metrics to."},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_617c9072","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":34},"in_reply_to":"9fdfeff1_5e5cb04b","updated":"2019-03-19 16:26:25.000000000","message":"To be clear, the Pushgateway is just here for exceptional situations as stated in the Prometheus docs.\nI don\u0027t think the nova-compute service corresponds to what the Prometheus community accepts as a \"batch job\".\n\nFWIW, Nova also exposes some metrics thru an API [1] so a pull-based model like Prometheus would rather like to use it.\n\n[1] https://developer.openstack.org/api-ref/compute/#usage-reports-os-simple-tenant-usage","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"b83bf8cc66f25af300216bd273217763ababa91e","unresolved":false,"context_lines":[{"line_number":37,"context_line":"* Any other value"},{"line_number":38,"context_line":"\"\"\"),"},{"line_number":39,"context_line":"    cfg.StrOpt(\u0027push_gateway\u0027,"},{"line_number":40,"context_line":"         default\u003d\u0027localhost:9091\u0027,"},{"line_number":41,"context_line":"         help\u003d\"\"\""},{"line_number":42,"context_line":"The hostname and port of a prometheus pushgateway service to push metrics to."},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_458f0acd","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":34},"in_reply_to":"9fdfeff1_f197e49b","updated":"2019-03-04 21:36:19.000000000","message":"What\u0027s a KSA adapter config?\n\nThere is no reason that the pushgateway is always local. It might make sense for it to be a sidecar to nova-compute in some deployments, but that is certainly not universally true. The pushgateway is a publication construction -- normally what you\u0027d do is add a web server to your binary that serves this information directly, pushgateway does that instead in a separate process. I\u0027m preferring that model at the moment because I\u0027m hesitant to make nova-compute\u0027s threading model any more complicated by adding another server for it to run.\n\nThe data is aggregated from the various things which expose metrics by a single central service, which is prometheus itself.\n\nI am unaware of an OpenStack service which attempts to do anything like prometheus. Notifications are quite different and started as a billing messaging system (although are sometimes misused for things like hash rings). Prometheus is more about underlying operational metrics like disk performance etc.","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"}],"nova/metrics.py":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"0114188b52e8ecbde326637320a14493761d4d8d","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    if not _METRICS:"},{"line_number":36,"context_line":"        _METRICS \u003d {}"},{"line_number":37,"context_line":"    _METRICS[name] \u003d (kind, value)"},{"line_number":38,"context_line":"    "},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def increment_counter(name):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_0f4d17c3","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":4},"updated":"2019-03-14 05:44:25.000000000","message":"ditto","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2ee5df1226ebcc8de9aabbbcc145d8fb39d16dd7","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    _METRICS[name] \u003d (kind, value + 1)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def publish():"},{"line_number":50,"context_line":"    global _METRICS"},{"line_number":51,"context_line":"    if not _METRICS:"},{"line_number":52,"context_line":"        _METRICS \u003d {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_9163f8dd","line":49,"updated":"2019-03-04 17:57:34.000000000","message":"This (at least) seems pretty prometheus-specific. Is it worth having a base class whose subclasses have the endpoint specifics in them?","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"b83bf8cc66f25af300216bd273217763ababa91e","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    _METRICS[name] \u003d (kind, value + 1)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def publish():"},{"line_number":50,"context_line":"    global _METRICS"},{"line_number":51,"context_line":"    if not _METRICS:"},{"line_number":52,"context_line":"        _METRICS \u003d {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_45a86a1f","line":49,"in_reply_to":"9fdfeff1_9163f8dd","updated":"2019-03-04 21:36:19.000000000","message":"Probably. I was going to write one but them I realised I couldn\u0027t be bothered. Its trivial to refactor into a base class later, but I feel like a concrete example of how something else does it is required first to avoid making weird assumptions in that base layer.","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2ee5df1226ebcc8de9aabbbcc145d8fb39d16dd7","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    LOG.debug(\u0027Pushing to %s data %s\u0027, url, data)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    r \u003d requests.post(url,"},{"line_number":83,"context_line":"                      data\u003d\u0027\\n\u0027.join(data),"},{"line_number":84,"context_line":"                      headers\u003d{\u0027X-Requested-With\u0027: \u0027OpenStack\u0027,"},{"line_number":85,"context_line":"                               \u0027Content-type\u0027: \u0027text/xml\u0027},"},{"line_number":86,"context_line":"                      timeout\u003d1)"},{"line_number":87,"context_line":"    LOG.debug(\u0027Push result: status \u003d %d, message \u003d %s\u0027,"},{"line_number":88,"context_line":"              r.status_code, r.text)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_b1539c16","line":85,"range":{"start_line":82,"start_character":0,"end_line":85,"end_character":59},"updated":"2019-03-04 17:57:34.000000000","message":"does this not require any kind of authentication?","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"b83bf8cc66f25af300216bd273217763ababa91e","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    LOG.debug(\u0027Pushing to %s data %s\u0027, url, data)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    r \u003d requests.post(url,"},{"line_number":83,"context_line":"                      data\u003d\u0027\\n\u0027.join(data),"},{"line_number":84,"context_line":"                      headers\u003d{\u0027X-Requested-With\u0027: \u0027OpenStack\u0027,"},{"line_number":85,"context_line":"                               \u0027Content-type\u0027: \u0027text/xml\u0027},"},{"line_number":86,"context_line":"                      timeout\u003d1)"},{"line_number":87,"context_line":"    LOG.debug(\u0027Push result: status \u003d %d, message \u003d %s\u0027,"},{"line_number":88,"context_line":"              r.status_code, r.text)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_0560220d","line":85,"range":{"start_line":82,"start_character":0,"end_line":85,"end_character":59},"in_reply_to":"9fdfeff1_b1539c16","updated":"2019-03-04 21:36:19.000000000","message":"Nope.","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5400ec5edfe9c6577b1adc2ec397ddd4b521a16f","unresolved":false,"context_lines":[{"line_number":1008,"context_line":"        self._destroy(instance)"},{"line_number":1009,"context_line":"        self.cleanup(context, instance, network_info, block_device_info,"},{"line_number":1010,"context_line":"                     destroy_disks)"},{"line_number":1011,"context_line":"        metrics.increment_counter(\u0027instance_destroys\u0027)"},{"line_number":1012,"context_line":""},{"line_number":1013,"context_line":"    def _undefine_domain(self, instance):"},{"line_number":1014,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_9bc1eee7","line":1011,"updated":"2019-03-19 15:00:41.000000000","message":"Why is this virt driver specific? Why not just handle this at the compute manager level so it wouldn\u0027t need to be plumbed into every driver - knowing that most (if any) probably would add it.\n\nWe also have instance actions records for this stuff as well which an external system could mine, and our notifications system (which ceilometer uses to pump metrics into a time-series DB yeah?).","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f114b29f2ccb5164422dee98e8908dfc9f726a25","unresolved":false,"context_lines":[{"line_number":1008,"context_line":"        self._destroy(instance)"},{"line_number":1009,"context_line":"        self.cleanup(context, instance, network_info, block_device_info,"},{"line_number":1010,"context_line":"                     destroy_disks)"},{"line_number":1011,"context_line":"        metrics.increment_counter(\u0027instance_destroys\u0027)"},{"line_number":1012,"context_line":""},{"line_number":1013,"context_line":"    def _undefine_domain(self, instance):"},{"line_number":1014,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_3b447a74","line":1011,"in_reply_to":"5fc1f717_9bc1eee7","updated":"2019-03-19 15:03:17.000000000","message":"I\u0027m guessing there is some reason like \"the libvirt driver would notice a crash and initiate a restart without compute\u0027s knowledge\", but I agree that it seems like virt-specific metrics would be rare and most of these would be in compute manager.","commit_id":"3d7d0616909aa0b7f0a5da4219b9eff424a8f19e"}]}
