You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/05/22 10:37:40 UTC

[GitHub] [incubator-openwhisk] chetanmeh opened a new pull request #4490: Track collection usage metrics for CosmosDB

chetanmeh opened a new pull request #4490: Track collection usage metrics for CosmosDB
URL: https://github.com/apache/incubator-openwhisk/pull/4490
 
 
   This PR enables support for #4489 by collecting and expose stats related collections in CosmosDB
   
   ## Description
   
   Now a new config option is exposed  which would allow collecting the collection stats at given frequency. By default this is set at 10 min frequency
   
   ```
   whisk {
     cosmosdb {
       # Frequency at which collection resource usage info like collection size, document count etc is recorded
       # and exposed as metrics. If any reindexing is in progress then its progress would be logged with this frequency
       record-usage-frequency = 10 m
     }
   }
   ```
   
   Once enabled it would do following things
   
   ### Expose stats in logs
   
   ```
   [2019-05-22T15:50:15.945Z] [INFO] [#tid_sid_unknown] [CosmosDBArtifactStore] Collection usage stats for [whisks] are documentSize: 380 KB,indexSize: 11 KB,documentsCount: 42,collectionSizeQuota: 10 GB
   [2019-05-22T15:50:23.869Z] [INFO] [#tid_sid_unknown] [CosmosDBArtifactStore] Collection usage stats for [subjects] are documentSize: 162 KB,indexSize: 0 bytes,documentsCount: 3,collectionSizeQuota: 10 GB
   [2019-05-22T15:50:34.354Z] [INFO] [#tid_sid_unknown] [CosmosDBArtifactStore] Collection usage stats for [activations] are documentSize: 192 MB,indexSize: 17 MB,documentsCount: 78961,collectionSizeQuota: 10 GB
   ```
   
   ### Expose index progress stats in logs
   
   if any index config change is then it would be recorded in the logs
   
   ```
   [2019-05-22T15:50:34.354Z] [INFO] [#tid_sid_unknown] [CosmosDBArtifactStore] Indexing for collection [activations] is at 73%
   ```
   
   ### Expose metrics 
   
   Expose gauges for 3 metrics `indexSize`, `documentsSize` and `documentCount`
   
   ```
   $ curl -sk https://localhost:10001/metrics | grep cosmos
   # TYPE counter_cosmosdb_ru_used_total counter
   counter_cosmosdb_ru_used_total{action="get",mode="read",collection="whisks"} 0.0
   counter_cosmosdb_ru_used_total{action="put",mode="write",collection="whisks"} 0.0
   # TYPE gauge_cosmosdb_indexSize_used_bytes gauge
   gauge_cosmosdb_indexSize_used_bytes{collection="subjects"} 0.0
   gauge_cosmosdb_indexSize_used_bytes{collection="activations"} 1920000.0
   gauge_cosmosdb_indexSize_used_bytes{collection="whisks"} 11264.0
   # TYPE gauge_cosmosdb_documentCount_used gauge
   gauge_cosmosdb_documentCount_used{collection="subjects"} 3.0
   gauge_cosmosdb_documentCount_used{collection="whisks"} 42.0
   gauge_cosmosdb_documentCount_used{collection="activations"} 78961.0
   # TYPE gauge_cosmosdb_documentsSize_used_bytes gauge
   gauge_cosmosdb_documentsSize_used_bytes{collection="activations"} 2060000.0
   gauge_cosmosdb_documentsSize_used_bytes{collection="whisks"} 389120.0
   gauge_cosmosdb_documentsSize_used_bytes{collection="subjects"} 165888.0
   ```
   
   ## Related issue and scope
   <!--- Please include a link to a related issue if there is one. -->
   - [ ] I opened an issue to propose and discuss this change (#4489)
   
   ## My changes affect the following components
   <!--- Select below all system components are affected by your change. -->
   <!--- Enter an `x` in all applicable boxes. -->
   - [ ] API
   - [ ] Controller
   - [ ] Message Bus (e.g., Kafka)
   - [ ] Loadbalancer
   - [ ] Invoker
   - [ ] Intrinsic actions (e.g., sequences, conductors)
   - [ ] Data stores (e.g., CouchDB)
   - [ ] Tests
   - [ ] Deployment
   - [ ] CLI
   - [ ] General tooling
   - [ ] Documentation
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Use `x` in all the boxes that apply: -->
   - [ ] Bug fix (generally a non-breaking change which closes an issue).
   - [ ] Enhancement or new feature (adds new functionality).
   - [ ] Breaking change (a bug fix or enhancement which changes existing behavior).
   
   ## Checklist:
   <!--- Please review the points below which help you make sure you've covered all aspects of the change you're making. -->
   
   - [ ] I signed an [Apache CLA](https://github.com/apache/incubator-openwhisk/blob/master/CONTRIBUTING.md).
   - [ ] I reviewed the [style guides](https://github.com/apache/incubator-openwhisk/wiki/Contributing:-Git-guidelines#code-readiness) and followed the recommendations (Travis CI will check :).
   - [ ] I added tests to cover my changes.
   - [ ] My changes require further changes to the documentation.
   - [ ] I updated the documentation where necessary.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services