Merge pull request #2 from hpcloud-mon/region-config
Add region configuration and use region as meta for all posted metrics.
This commit is contained in:
commit
64656670d8
@ -1,3 +1,6 @@
|
||||
# The region for which all metrics passing through this server will be persisted
|
||||
region: region-a
|
||||
|
||||
# Whether this server is running on a secure port
|
||||
accessedViaHttps: false
|
||||
|
||||
|
@ -28,6 +28,7 @@ import com.hpcloud.messaging.kafka.KafkaConfiguration;
|
||||
import com.hpcloud.mon.infrastructure.middleware.MiddlewareConfiguration;
|
||||
|
||||
public class MonApiConfiguration extends Configuration {
|
||||
@NotEmpty public String region;
|
||||
@NotNull public Boolean accessedViaHttps;
|
||||
@NotEmpty public String metricsTopic = "metrics";
|
||||
@NotEmpty public String eventsTopic = "events";
|
||||
|
@ -52,7 +52,7 @@ public class MetricService {
|
||||
|
||||
public void create(List<Metric> metrics, String tenantId, @Nullable String crossTenantId) {
|
||||
Builder<String, Object> metaBuilder = new ImmutableMap.Builder<String, Object>().put(
|
||||
"tenantId", tenantId);
|
||||
"tenantId", tenantId).put("region", config.region);
|
||||
if (crossTenantId != null)
|
||||
metaBuilder.put("crossTenantId", crossTenantId);
|
||||
ImmutableMap<String, Object> meta = metaBuilder.build();
|
||||
|
Loading…
Reference in New Issue
Block a user