Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/libertymutual/herman
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbatch committed Aug 31, 2018
2 parents e77377c + e1107c9 commit d34c6c5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/newRelic/New_Relic_Alert_Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,27 @@ For Example:
]
```

### Synthetics Monitors and Alerts
Synthetics should be a JSON Array. Each object in the array should match
the payload required by the [New Relic Synthetics API](https://docs.newrelic.com/docs/apis/synthetics-rest-api/monitor-examples/manage-synthetics-monitors-rest-api#create-monitor).
For Example:

```js
[
{
"type": "BROWSER",
"frequency": 10,
"uri": "https://google.com",
"locations": ["AWS_US_EAST_1", "AWS_US_WEST_2"],
"status": "ENABLED",
"slaThreshold": 1.0,
"options": {
"verifySSL": true
}
}
]
```

### Channels

Channels should be a JSON array. Each object in the array should match
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,20 @@ private NewRelicConfiguration getNewRelicConfiguration(NewRelicConfiguration new
.mapInProperties(fileUtil.findFile(newRelicConfigurationDefinition.getInfrastructureConditions(), false));
}

String synthetics = null;
if (StringUtils.isNotBlank(newRelicConfigurationDefinition.getSynthetics())) {
synthetics = propertyHandler
.mapInProperties(fileUtil.findFile(newRelicConfigurationDefinition.getSynthetics(), false));
}

newRelicConfiguration = new NewRelicConfiguration()
.withDbName(dbName)
.withChannels(channels)
.withConditions(conditions)
.withRdsPluginsConditions(rdsPluginsConditions)
.withNrqlConditions(nrqlConditions)
.withInfrastructureConditions(infrastructureConditions)
.withSynthetics(synthetics)
.withApdex(newRelicConfigurationDefinition.getApdex());
} else {
newRelicConfiguration = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class NewRelicConfiguration {
private String rdsPluginsConditions;
private String nrqlConditions;
private String infrastructureConditions;
private String synthetics;
private String dbName;
private String apdex;

Expand Down Expand Up @@ -71,6 +72,14 @@ public void setInfrastructureConditions(String infrastructureConditions) {
this.infrastructureConditions = infrastructureConditions;
}

public String getSynthetics() {
return synthetics;
}

public void setSynthetics(String synthetics) {
this.synthetics = synthetics;
}

public String getDbName() {
return dbName;
}
Expand All @@ -95,6 +104,7 @@ public String toString() {
", rdsPluginsConditions='" + rdsPluginsConditions + '\'' +
", nrqlConditions='" + nrqlConditions + '\'' +
", infrastructureConditions='" + infrastructureConditions + '\'' +
", synthetics='" + synthetics + '\'' +
", dbName='" + dbName + '\'' +
", apdex='" + apdex + '\'' +
'}';
Expand Down Expand Up @@ -125,6 +135,11 @@ public NewRelicConfiguration withInfrastructureConditions(final String infrastru
return this;
}

public NewRelicConfiguration withSynthetics(final String synthetics) {
this.synthetics = synthetics;
return this;
}

public NewRelicConfiguration withDbName(final String dbName) {
this.dbName = dbName;
return this;
Expand Down

0 comments on commit d34c6c5

Please sign in to comment.