Skip to content

Feature/404 error reporting

Charles Francoise requested to merge feature/404-error-reporting into develop

Describe the MR

Adds a new "Error" state to results.

Pulse page:

Screen_Shot_2018-11-09_at_10.39.38

Slack notification:

Screen_Shot_2018-11-09_at_10.11.56

API:

POST /v1/organizations/cZhUTZTkTkq9dc3TuGc8Gg/results/query HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 180
Content-Type: application/json
Host: localhost:7576
User-Agent: HTTPie/0.9.9

{
    "order_by": "DESCENDING",
    "page_size": "1",
    "probe_configuration": "organizations/cZhUTZTkTkq9dc3TuGc8Gg/agents/_-JTsCdIR7eLDm7jKrrrEQ/probeconfigurations/E1tHOwFdR5mqLLulbV9FWg"
}

HTTP/1.1 200 OK
Content-Length: 664
Content-Type: application/json
Date: Fri, 09 Nov 2018 09:58:00 GMT
Grpc-Metadata-Content-Type: application/grpc
Vary: Origin

{
    "next_page_token": "mQEKJG9yZ2FuaXphdGlvbnMvY1poVVRaVGtUa3E5ZGMzVHVHYzhHZxJtb3JnYW5pemF0aW9ucy9jWmhVVFpUa1RrcTlkYzNUdUdjOEdnL2FnZW50cy9fLUpUc0NkSVI3ZUxEbTdqS3JyckVRL3Byb2JlY29uZmlndXJhdGlvbnMvRTF0SE93RmRSNW1xTEx1bGJWOUZXZzABOAEB",
    "results": [
        {
            "agent": "organizations/cZhUTZTkTkq9dc3TuGc8Gg/agents/_-JTsCdIR7eLDm7jKrrrEQ",
            "check": "organizations/cZhUTZTkTkq9dc3TuGc8Gg/checks/i3zBDz8YStWURqc8sp9B_w",
            "error": true,
            "error_message": "lookup G3JP68kr3Ew.xyz: no such host",
            "fields": {},
            "probe_configuration": "organizations/cZhUTZTkTkq9dc3TuGc8Gg/agents/_-JTsCdIR7eLDm7jKrrrEQ/probeconfigurations/E1tHOwFdR5mqLLulbV9FWg",
            "tags": {},
            "timestamp": "2018-11-09T09:57:31.207598Z"
        }
    ]
}
POST /v1/organizations/cZhUTZTkTkq9dc3TuGc8Gg/states/query HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 157
Content-Type: application/json
Host: localhost:7576
User-Agent: HTTPie/0.9.9

{
    "page_size": "1",
    "probe_configurations": [
        "organizations/cZhUTZTkTkq9dc3TuGc8Gg/agents/_-JTsCdIR7eLDm7jKrrrEQ/probeconfigurations/E1tHOwFdR5mqLLulbV9FWg"
    ]
}

HTTP/1.1 200 OK
Content-Length: 444
Content-Type: application/json
Date: Fri, 09 Nov 2018 09:57:51 GMT
Grpc-Metadata-Content-Type: application/grpc
Vary: Origin

{
    "next_page_token": "",
    "states": [
        {
            "agent": "organizations/cZhUTZTkTkq9dc3TuGc8Gg/agents/_-JTsCdIR7eLDm7jKrrrEQ",
            "check": "organizations/cZhUTZTkTkq9dc3TuGc8Gg/checks/i3zBDz8YStWURqc8sp9B_w",
            "children": null,
            "probe_configuration": "organizations/cZhUTZTkTkq9dc3TuGc8Gg/agents/_-JTsCdIR7eLDm7jKrrrEQ/probeconfigurations/E1tHOwFdR5mqLLulbV9FWg",
            "reason": "lookup G3JP68kr3Ew.xyz: no such host",
            "timestamp": "2018-11-09T09:57:31.207598Z",
            "type": "ERROR"
        }
    ]
}

Why was this MR needed?

To report when a probe failed executing and alert if needed.

Extra-care points?

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • CHANGELOG updated
  • Unit Tests added/updated

What are the relevant issue numbers?

Closes #404 (closed)

License and Developer Certificate of Origin

  • By contributing to Pantomath SAS, You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Pantomath SAS. Except for the license granted herein to Pantomath SAS and recipients of software distributed by Pantomath SAS, You reserve all right, title, and interest in and to Your Contributions. All Contributions are subject to the following Developer Certificate of Origin and License terms.

Merge request reports