Question
I am trying to make use of OverOps API to pull certain metrics for a certain server:
like
- Total number of exceptions occurred
- Total number of unique exceptions
- Highest occurring exception
Answer
The data can be retrieved via our “overops-as-influx API” which uses our standard Rest APIs to retrieve the information.
Note the overops-as-influx API is accessed via the prefix /api/v1/oo-as-influx
as a distinction:
Here is an example (remember to update the api key, environments, applications, servers, deployments for your query) of using the overops-as-influx API:
Sample
Request
curl -H 'x-api-key: fP5********************************Jq2++' -G https://api.overops.com/api/v1/oo-as-influx/query?pretty=true --data-urlencode "db=telegraf" --data-urlencode 'q=events({"view":"All Events","timeFilter":"time >= now() - 24h","environments":"OverOps Play: S37777","applications":"All","servers":"All","deployments":"All","volumeType":"all","types":"All","pointsWanted":"24","transactions":"*", "searchText":"<term>", "outputMode":"SingleStat"})
Response
121 is the number of unique errors, titled “Errors: All” on the errors dashboard.
{"results":[{"statement_id":0,"series":[{"name":"","columns":["time","sum"],"values":[[1579214061903,121]]}]}]}
Examples
Here are some additional examples for the attached screenshot that I hope should help for what you are trying to achieve:
APIKEY='REPLACE_ME_WITH_YOUR_API_KEY_HERE'
EXAMPLE 1
Unique event counts for all servers ; here server is “All”
curl -H "x-api-key: $APIKEY" -G https://api.overops.com/api/v1/oo-as-influx/query?pretty=true --data-urlencode "db=telegraf" --data-urlencode 'q=events({"view":"All Events","timeFilter":"time >= now() - 30d","
environments":"OverOps Play: S40367","applications":"All","servers":"All","deployments":"All","volumeType":"all","types":"All","pointsWanted":"24","transactions":"*", "searchText":"<term>", "outputMode":"SingleStat"})'
EXAMPLE 2
Unique event counts for single server ; here server is the id for a single server taken from the GUI (in this case the server is known as “389964215b7d”)
curl -H "x-api-key: $APIKEY" -G https://api.overops.com/api/v1/oo-as-influx/query?pretty=true --data-urlencode "db=telegraf" --data-urlencode 'q=events({"view":"All Events","timeFilter":"time >= now() - 30d","
environments":"OverOps Play: S40367","applications":"All","servers":"389964215b7d","deployments":"All","volumeType":"all","types":"All","pointsWanted":"24","transactions":"*", "searchText":"<term>", "outputMode":"SingleStat"})'
EXAMPLE 3
Non-unique event counts for all servers
curl -H "x-api-key: $APIKEY" \
-G 'https://api.overops.com/api/v1/oo-as-influx/query?pretty=true' \
--data-urlencode "db=mydb" \
--data-urlencode 'q=regressionReport({ "timeFilter":"time >= now() - 30d", "environments":"OverOps Play: S40367", "applications":"All", "servers":"All", "deployments":"All", "view":"All Events", "pointsWanted":"24", "types":"All", "render":"Grid" })'
EXAMPLE 4
Non-unique event counts for single server
curl -H "x-api-key: $APIKEY" \
-G 'https://api.overops.com/api/v1/oo-as-influx/query?pretty=true' \
--data-urlencode "db=mydb" \
--data-urlencode 'q=regressionReport({ "timeFilter":"time >= now() - 30d", "environments":"OverOps Play: S40367", "applications":"All", "servers":"389964215b7d", "deployments":"All", "view":"All Events", "pointsWanted":"24", "types":"All", "render":"Grid" })'
Here’s the output:
EXAMPLE 1
Unique event counts for all servers ; here server is “All”
Value in this example is 2
{"results":[{"statement_id":0,"series":[{"name":"","columns":["time","sum"],"values":[[1579291731615,2]]}]}]}
EXAMPLE 2
Unique event counts for single server ; here server is the id for a single server taken from the GUI (in this case 389964215b7d)
Value in this example is 1
{"results":[{"statement_id":0,"series":[{"name":"","columns":["time","sum"],"values":[[1579291731837,1]]}]}]}
EXAMPLE 3
Non-unique event counts for all servers
Value in this example is 996
{"results":[{"statement_id":0,"series":[{"name":"reliability_report","type":"reliability_report","columns":["from","to","timeRange","Service","Key","ReliabilityState","NewIssuesDesc","RegressionsDesc","SlowdownsDesc","ScoreDesc","FailureDesc","RelabilityDesc","AlertDesc","TransactionFailureCountDesc","ErrorCountDesc","TransactionVolumeDesc","ConnectedClientsDesc","ServiceId","AlertViewId","Name","StatusName","AlertStatus","Score","NewIssues","Regressions","TransactionFailures","TransactionFailureCount","Slowdowns","TransactionFailRate","TransactionFailRateDelta","ErrorVolume","ErrorCount","TransactionCount","TransactionVolume","TransactionAvgResponse","ConnectedClients"],"values":[["now-720h","now","720h","v8_vm1: S40367","",0,"NullPointerException in GreetingImpl$MockitoMock$1479298321, NullPointerException in GreetingImpl$MockitoMock$1835147743","","","Score for \u003d 100 - (2 severe new issues * 2) * 2.5, avg over 1 month \u003d 99.67","996 failures in 2K calls (50.25%) compared to 0 in 0 (0%) in the preceeding 4 months baseline ","OK for : Score \u003d 99.7",null,"Volume \u003d 996. NullPointerException(100%)","Volume \u003d 996. NullPointerException(100%)","Volume \u003d 2K. Top 2 Time Consuming: GreetingImpl$MockitoMock$1835147743(65.76%), GreetingImpl$MockitoMock$1479298321(34.24%)",null,"S40367",null,"","",null,99.66666666666667,"2","",996,"2","",0.5025227043390514,"",996,"2","2","2K","0ms",null]]}]}]}
EXAMPLE 4
Non-unique event counts for single server
Value in this example is 498
{"results":[{"statement_id":0,"series":[{"name":"reliability_report","type":"reliability_report","columns":["from","to","timeRange","Service","Key","ReliabilityState","NewIssuesDesc","RegressionsDesc","SlowdownsDesc","ScoreDesc","FailureDesc","RelabilityDesc","AlertDesc","TransactionFailureCountDesc","ErrorCountDesc","TransactionVolumeDesc","ConnectedClientsDesc","ServiceId","AlertViewId","Name","StatusName","AlertStatus","Score","NewIssues","Regressions","TransactionFailures","TransactionFailureCount","Slowdowns","TransactionFailRate","TransactionFailRateDelta","ErrorVolume","ErrorCount","TransactionCount","TransactionVolume","TransactionAvgResponse","ConnectedClients"],"values":[["now-720h","now","720h","v8_vm1: S40367","",0,"NullPointerException in GreetingImpl$MockitoMock$1479298321","","","Score for \u003d 100 - (1 severe new issue * 2) * 2.5, avg over 1 month \u003d 99.83","498 failures in 990 calls (50.3%) compared to 0 in 0 (0%) in the preceeding 4 months baseline ","OK for : Score \u003d 99.8",null,"Volume \u003d 498. NullPointerException(100%)","Volume \u003d 498. NullPointerException(100%)","Volume \u003d 990. Top 1 Time Consuming: GreetingImpl$MockitoMock$1479298321(100%)",null,"S40367",null,"","",null,99.83333333333333,"1","",498,"1","",0.503030303030303,"",498,"1","1","990","0ms",null]]}]}]}