Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including inventoryItemId in an IMG payload causes metrics to not arrive at the Metrics Bolts #4

Open
whaley opened this issue Dec 18, 2012 · 1 comment

Comments

@whaley
Copy link
Contributor

whaley commented Dec 18, 2012

From an earlier email from Vasil

We're still digging into the exact details as to why this happens but i have been able to reproduce the issue and also figure out that the workaround seems to be to simply not include the "inventoryItemId" : "Customer1" in the JSON payload. Also, please include "name":"Customer 1 Traffic" instead. Though i'm not sure that part is vital, i haven't tested the combination without it.

@vasil9v
Copy link
Member

vasil9v commented Dec 18, 2012

From SOBA-2093

Reproduced a problem "" had in production on trunk using a new account i made for "[email protected]".

Short of it is:

This doesn't work:

vasil@app-02:~$ curl -i -X POST "https://trunk.nodeable.com/gateway/generic/" -H "X-Auth-API-Key: P2qCT2sgcXC2trVjhKXxV6hXjvphnfvu6lU9mC4GF+4=" -H "Content-Type: application/json" -d '{ "message" : "Latest Traffic for Customer", "metrics" : [{ "name" : "c2e_hits", "value" : 65830, "type" : "ABSOLUTE" },{ "name" : "c2e_bits", "value" : 7505641, "type" : "ABSOLUTE" },{ "name" : "e2st_hits", "value" : 1921, "type" : "ABSOLUTE" },{ "name" : "e2st_bits", "value" : 63002, "type" : "ABSOLUTE" },{ "name" : "st2ns_hits", "value" : 0, "type" : "ABSOLUTE" },{ "name" : "st2ns_bits", "value" : 11, "type" : "ABSOLUTE" }], "inventoryItemId" : "Customer1", "name":"Customer 1 Traffic"}' 

But this does:

vasil@app-02:~$ curl -i -X POST "https://trunk.nodeable.com/gateway/generic/" -H "X-Auth-API-Key: P2qCT2sgcXC2trVjhKXxV6hXjvphnfvu6lU9mC4GF+4=" -H "Content-Type: application/json" -d '{ "message" : "Latest Traffic for Customer", "metrics" : [{ "name" : "c2e_hits", "value" : 65830, "type" : "ABSOLUTE" },{ "name" : "c2e_bits", "value" : 7505641, "type" : "ABSOLUTE" },{ "name" : "e2st_hits", "value" : 1921, "type" : "ABSOLUTE" },{ "name" : "e2st_bits", "value" : 63002, "type" : "ABSOLUTE" },{ "name" : "st2ns_hits", "value" : 0, "type" : "ABSOLUTE" },{ "name" : "st2ns_bits", "value" : 11, "type" : "ABSOLUTE" }], "name":"Customer 1 Traffic"}' 

Here's the account and connection info i was using on trunk:

PRIMARY> db.users.find({"username":"[email protected]"})[0] 
{ 
"_id" : ObjectId("504a3dcdc8f2a902b6eae5b7"), 
"username" : "[email protected]", 
"fullname" : "VasilA1", 
"fuid" : "vasila1nodeablecom_1347042765063", 
"accountOriginator" : true, 
"roles" : [ 
{ 
"$ref" : "roles", 
"$id" : ObjectId("4ef4daf9c8f2272da4d8c118") 
}, 
{ 
"$ref" : "roles", 
"$id" : ObjectId("4ef4daf8c8f2272da4d8c116") 
} 
], 
"userLocked" : false, 
"userConfig" : { 
"commentNotifications" : true, 
"has_connected_personal_data_source" : true, 
"lastReadTS" : NumberLong("1347634102629"), 
"gravatarHash" : "ba42ded31fd14acf1a1aff3db1a22581", 
"newMessageNotifications" : true 
}, 
"userStatus" : "ACTIVATED", 
"alias" : "VasilA1", 
"account" : { 
"$ref" : "accounts", 
"$id" : ObjectId("505343b6c8f2a19dacea78e0") 
}, 
"visibility" : "ACCOUNT", 
"created" : NumberLong("1347042765063"), 
"modified" : NumberLong("1347634117811"), 
"version" : 4 
} 
PRIMARY> db.connections.find({"account":{"$ref" : "accounts","$id" : ObjectId("505343b6c8f2a19dacea78e0")}})[0] 
{ 
"_id" : ObjectId("505343fdc8f2a19dacea795c"), 
"providerId" : "custom", 
"type" : "gateway", 
"credentials" : { 
"identity" : "P2qCT2sgcXC2trVjhKXxV6hXjvphnfvu6lU9mC4GF+4=" 
}, 
"authType" : "API_KEY", 
"pollingInProgress" : false, 
"pollingLastExecutionTime" : NumberLong(0), 
"pollingFailedCount" : NumberLong(0), 
"broken" : false, 
"disabled" : false, 
"alias" : "Customer 1 Traffic", 
"account" : { 
"$ref" : "accounts", 
"$id" : ObjectId("505343b6c8f2a19dacea78e0") 
}, 
"user" : { 
"$ref" : "users", 
"$id" : ObjectId("504a3dcdc8f2a902b6eae5b7") 
}, 
"visibility" : "ACCOUNT", 
"hashtags" : [ 
"#custom" 
], 
"created" : NumberLong("1347634173358"), 
"modified" : NumberLong("1347634175546"), 
"version" : 2 
} 


db.Metric_505343b6c8f2a19dacea78e0.find(); 
{ "_id" : ObjectId("50534494c8f2710f7ea50cfe"), "metricName" : "CONNECTION_ACTIVITY_COUNT", "metricType" : "ABSOLUTE", "metricTimestamp" : NumberLong("1347634309760"), "metricValue" : 1, "metricGranularity" : NumberLong(60000), "metricCriteria" : { "PROVIDER_TYPE" : "gateway" }, "metricAVGY" : 1.9333332777023315, "metricSTDDEV" : 0, "metricDIFF" : 1, "metricMIN" : 1, "metricMAX" : 1, "metricIsAnomaly" : false } 
{ "_id" : ObjectId("505345a8c8f2710f7ea5111b"), "metricName" : "CONNECTION_ACTIVITY_COUNT", "metricType" : "ABSOLUTE", "metricTimestamp" : NumberLong("1347634590055"), "metricValue" : 2, "metricGranularity" : NumberLong(60000), "metricCriteria" : { "PROVIDER_TYPE" : "gateway" }, "metricAVGY" : 2.8677778244018555, "metricSTDDEV" : 0.23648151755332947, "metricDIFF" : 1, "metricMIN" : 1, "metricMAX" : 2, "metricIsAnomaly" : false } 
{ "_id" : ObjectId("505345d5c8f2710f7ea5134f"), "metricName" : "CONNECTION_RESOURCE_USAGE", "metricType" : "ABSOLUTE", "metricTimestamp" : NumberLong("1347634638178"), "metricValue" : 7505641, "metricGranularity" : NumberLong(60000), "metricCriteria" : { "OBJECT_ID" : "505343fdc8f2a19dacea795c", "RESOURCE_ID" : "c2e_bits" }, "metricAVGY" : 14510906, "metricSTDDEV" : 0, "metricDIFF" : 7505641, "metricMIN" : 7505641, "metricMAX" : 7505641, "metricIsAnomaly" : false } 
{ "_id" : ObjectId("505345d5c8f2710f7ea51350"), "metricName" : "CONNECTION_RESOURCE_USAGE", "metricType" : "ABSOLUTE", "metricTimestamp" : NumberLong("1347634638178"), "metricValue" : 1921, "metricGranularity" : NumberLong(60000), "metricCriteria" : { "OBJECT_ID" : "505343fdc8f2a19dacea795c", "RESOURCE_ID" : "e2st_hits" }, "metricAVGY" : 3713.93310546875, "metricSTDDEV" : 0, "metricDIFF" : 1921, "metricMIN" : 1921, "metricMAX" : 1921, "metricIsAnomaly" : false } 
{ "_id" : ObjectId("505345d5c8f2710f7ea51352"), "metricName" : "CONNECTION_RESOURCE_USAGE", "metricType" : "ABSOLUTE", "metricTimestamp" : NumberLong("1347634638178"), "metricValue" : 65830, "metricGranularity" : NumberLong(60000), "metricCriteria" : { "OBJECT_ID" : "505343fdc8f2a19dacea795c", "RESOURCE_ID" : "c2e_hits" }, "metricAVGY" : 127271.328125, "metricSTDDEV" : 0, "metricDIFF" : 65830, "metricMIN" : 65830, "metricMAX" : 65830, "metricIsAnomaly" : false } 
{ "_id" : ObjectId("505345d5c8f2710f7ea51353"), "metricName" : "CONNECTION_RESOURCE_USAGE", "metricType" : "ABSOLUTE", "metricTimestamp" : NumberLong("1347634638178"), "metricValue" : 63002, "metricGranularity" : NumberLong(60000), "metricCriteria" : { "OBJECT_ID" : "505343fdc8f2a19dacea795c", "RESOURCE_ID" : "e2st_bits" }, "metricAVGY" : 121803.859375, "metricSTDDEV" : 0, "metricDIFF" : 63002, "metricMIN" : 63002, "metricMAX" : 63002, "metricIsAnomaly" : false } 
{ "_id" : ObjectId("505345d5c8f2710f7ea51354"), "metricName" : "CONNECTION_RESOURCE_USAGE", "metricType" : "ABSOLUTE", "metricTimestamp" : NumberLong("1347634638178"), "metricValue" : 0, "metricGranularity" : NumberLong(60000), "metricCriteria" : { "OBJECT_ID" : "505343fdc8f2a19dacea795c", "RESOURCE_ID" : "st2ns_hits"}, "metricAVGY" : 0, "metricSTDDEV" : 0, "metricDIFF" : 0, "metricMIN" : 0, "metricMAX" : 0, "metricIsAnomaly" : false } 
{ "_id" : ObjectId("505345d5c8f2710f7ea51356"), "metricName" : "CONNECTION_RESOURCE_USAGE", "metricType" : "ABSOLUTE", "metricTimestamp" : NumberLong("1347634638178"), "metricValue" : 11, "metricGranularity" : NumberLong(60000), "metricCriteria" : { "OBJECT_ID" : "505343fdc8f2a19dacea795c", "RESOURCE_ID" : "st2ns_bits"}, "metricAVGY" : 21.266666412353516, "metricSTDDEV" : 0, "metricDIFF" : 11, "metricMIN" : 11, "metricMAX" : 11, "metricIsAnomaly" : false } 

Note that the records with "CONNECTION_RESOURCE_USAGE" were only created the time i used the curl command without the inventoryItemId.

Jeremy suggests it could be an issue with the whitelist. Maybe inventoryItemId changes the metricCriteria that gets used in the whitelist check.

Nick assigning to you for now as you have a unique intersection of expertise between IMG and JL :) But i'm glad to help more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants