Skip to content

Commit

Permalink
feat: readme update for nrql query
Browse files Browse the repository at this point in the history
  • Loading branch information
norbertsuski committed Jul 16, 2020
1 parent 9641982 commit 0bc175b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,22 @@ Example hostnames:

- [https://ezidebit.status.io/pages/history/598a973f96a8201305000142](https://ezidebit.status.io/pages/history/598a973f96a8201305000142)
- [https://status.docker.com/pages/history/533c6539221ae15e3f000031](https://status.docker.com/pages/history/533c6539221ae15e3f000031)
=======

### NRQL query

NRQL query requires three fields/aliases to be returned: *EventTimeStamp, EventStatus, EventName*.

Example NRQL query:

```sql
FROM AlertViolationsSample SELECT timestamp as EventTimeStamp, priority as EventStatus, condition_name as EventName, entity.name LIMIT 50
```

or

```sql
SELECT timestamp as EventTimeStamp, priority as EventStatus, condition_name as EventName, entity.name FROM AlertViolationsSample LIMIT 50
```

## Open Source License

Expand Down
6 changes: 2 additions & 4 deletions utilities/formatters/nrql.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ const NRQLSeverityToKnown = {
};

export const nrqlFormatter = data => {
let statusCode;
let statusCode = NRQLSeverityToKnown.None;
let status = 'All Systems Operational';

if (data.raw.results[0].events.length === 0) {
statusCode = NRQLSeverityToKnown.None;
} else {
if (data.raw.results[0].events.length > 0) {
const incident = data.raw.results[0].events[0];
statusCode = NRQLSeverityToKnown[incident.EventStatus];

Expand Down

0 comments on commit 0bc175b

Please sign in to comment.