Bug 1321349

Summary: OpenShift nodes metrics missing machine prefix
Product: OpenShift Container Platform Reporter: Federico Simoncelli <fsimonce>
Component: HawkularAssignee: Matt Wringe <mwringe>
Status: CLOSED CURRENTRELEASE QA Contact: chunchen <chunchen>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: agoldste, aos-bugs, fsimonce, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 17:13:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Federico Simoncelli 2016-03-25 17:31:09 UTC
Description of problem:
The id of the nodes metrics is missing the 'machine' prefix.

Version-Release number of selected component (if applicable):
Heapster version 0.20.0-alpha7

How reproducible:
100%

Steps to Reproduce:
1. Deploy metrics
2. Collect _system metrics (nodes)

Actual results:
The metrics id changed from 'machine/id/<node-name>' to '/id/<node-name>' (missing 'machine' prefix).

Expected results:
Unless there's a valid reason for this change, the metrics id should be consistent with previous versions.


Additional info:

# curl -s -k -H "Hawkular-Tenant: _system" -u hawkular:$PASSWORD https://$HOSTNAME/hawkular/metrics/metrics?tags=group_id:/cpu/usage | jq '.[].id'
"/vm-48-10.eng.lab.tlv.redhat.com/cpu/usage"
"/vm-48-13.eng.lab.tlv.redhat.com/cpu/usage"
"/vm-48-9.eng.lab.tlv.redhat.com/cpu/usage"
"/vm-48-6.eng.lab.tlv.redhat.com/cpu/usage"
"/vm-48-12.eng.lab.tlv.redhat.com/cpu/usage"
"/vm-48-7.eng.lab.tlv.redhat.com/cpu/usage"
"/vm-48-8.eng.lab.tlv.redhat.com/cpu/usage"
"/vm-48-11.eng.lab.tlv.redhat.com/cpu/usage"

Expected output (as for 3.1) was:

"machine/vm-48-10.eng.lab.tlv.redhat.com/cpu/usage"
"machine/vm-48-13.eng.lab.tlv.redhat.com/cpu/usage"
"machine/vm-48-9.eng.lab.tlv.redhat.com/cpu/usage"
"machine/vm-48-6.eng.lab.tlv.redhat.com/cpu/usage"
"machine/vm-48-12.eng.lab.tlv.redhat.com/cpu/usage"
"machine/vm-48-7.eng.lab.tlv.redhat.com/cpu/usage"
"machine/vm-48-8.eng.lab.tlv.redhat.com/cpu/usage"
"machine/vm-48-11.eng.lab.tlv.redhat.com/cpu/usage"

Comment 1 Matt Wringe 2016-03-28 13:43:51 UTC
@Federico is this really for OSE or origin?

Comment 2 Matt Wringe 2016-03-28 13:51:58 UTC
Also, can you please explain why you are directly trying to derive the resource id? The resource id should be opaque, you should not be directly trying to calculate them but instead be performing a query based on the criteria that you are wanting

Comment 3 Matt Wringe 2016-04-04 14:00:09 UTC
PR submitted: https://github.com/kubernetes/heapster/pull/1116

Will update origin-metrics once it is merged

Comment 4 Matt Wringe 2016-04-06 17:35:26 UTC
origin-metrics has been updated

Comment 5 chunchen 2016-04-07 10:22:43 UTC
It's fixed, the images built from the latest source repo, please refer to the below messages:

[chunchen@F17-CCY scripts]$ oc rsh hawkular-metrics-qxlh1
sh-4.2$ curl -k -H "Authorization: Bearer <user-token>" -H "Hawkular-Tenant: _system" https://172.30.37.211/hawkular/metrics/metrics?tags=group_id:/cpu/usage |python -mjson.tool
[
    {
        "dataRetention": 7,
        "id": "machine/ip-172-18-6-225.ec2.internal/cpu/usage",
        "tags": {
            "descriptor_name": "cpu/usage",
            "group_id": "/cpu/usage",
            "host_id": "ip-172-18-6-225.ec2.internal",
            "hostname": "ip-172-18-6-225.ec2.internal",
            "nodename": "ip-172-18-6-225.ec2.internal",
            "type": "node",
            "units": "ns"
        },
        "tenantId": "_system",
        "type": "counter"
    }
]