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/11/15 10:07:11 UTC

[GitHub] [openwhisk] neerajmangal opened a new pull request #4726: Recording metrics for action result response statusCode in user-events service.

neerajmangal opened a new pull request #4726: Recording metrics for action result response statusCode in user-events service. 
URL: https://github.com/apache/openwhisk/pull/4726
 
 
   <!--- Provide a concise summary of your changes in the Title -->
   This PR is the implementation of #4718, recording action's `statusCode` if it is set by the developer in action response in case of `error` in "Activation" `event` sent to Kafka. 
   
   
   ## Description
   Currently, we can capture the `error` based on `Application`, `Developer` and `System` error, which this change, one can get visibility of actual error sent by the developer, i.e. 4XX, 5XX, etc. 
    
   Action error `statusCode` will be added in "Activation" `event` as `actionStatusCode` and consumed by user-event service. 
   
   Note - For now `statusCode` present in `error` response is captured.    
   
   ```json
   "result": {
               "error": {
                   "body": "Authentication credentials are invalid.",
                   "statusCode": 401
               }
           }
   ```
   
   With this change `Activation event`will look like this - 
   
   ```json
   {
      "body": {
         "actionStatusCode": 404,
         "conductor": false,
         "duration": 46,
         "initTime": 34,
         "kind": "nodejs:10",
         "memory": 256,
         "name": "guest/helloWorld3",
         "size": 53,
         "statusCode": 1,
         "waitTime": 9
      },
      "eventType": "Activation",
      "namespace": "guest",
      "source": "invoker0",
      "subject": "guest",
      "timestamp": 1573811872958,
      "userId": "23bc46b1-71f6-4ed5-8c54-816aa4f8c502"
   }
   ```
   
   **Note** - `actionStatusCode` only present when - 
   
   - Activation response has `error` field
   - && Activation `error` has `statusCode` set by developer.  
    
   
   Sample Dashboard (added "Action Error Status Code" Panel) - 
   
   <img width="1598" alt="Screenshot 2019-11-15 at 3 34 39 PM" src="https://user-images.githubusercontent.com/20740788/68934882-8fbd9080-07bd-11ea-9f8e-33105a89d791.png">
   
   [ ] TODO
   - Add dashboard to default dashboards. 
   
   ## Related issue and scope
   <!--- Please include a link to a related issue if there is one. -->
   - [x]  I opened an issue to propose and discuss this change (#4718 )
   
   ## 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)
   - [x]  User events
   - [ ] 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. -->
   
   - [x] I signed an [Apache CLA](https://github.com/apache/openwhisk/blob/master/CONTRIBUTING.md).
   - [ ] I reviewed the [style guides](https://github.com/apache/openwhisk/wiki/Contributing:-Git-guidelines#code-readiness) and followed the recommendations (Travis CI will check :).
   - [x] 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