001/* 002 * Copyright 2012-2018 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.boot.actuate.autoconfigure.metrics.export.appoptics; 018 019import java.time.Duration; 020 021import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryProperties; 022import org.springframework.boot.context.properties.ConfigurationProperties; 023 024/** 025 * {@link ConfigurationProperties} for configuring AppOptics metrics export. 026 * 027 * @author Stephane Nicoll 028 * @since 2.1.0 029 */ 030@ConfigurationProperties(prefix = "management.metrics.export.appoptics") 031public class AppOpticsProperties extends StepRegistryProperties { 032 033 /** 034 * URI to ship metrics to. 035 */ 036 private String uri = "https://api.appoptics.com/v1/measurements"; 037 038 /** 039 * AppOptics API token. 040 */ 041 private String apiToken; 042 043 /** 044 * Tag that will be mapped to "@host" when shipping metrics to AppOptics. 045 */ 046 private String hostTag = "instance"; 047 048 /** 049 * Number of measurements per request to use for this backend. If more measurements 050 * are found, then multiple requests will be made. 051 */ 052 private Integer batchSize = 500; 053 054 /** 055 * Connection timeout for requests to this backend. 056 */ 057 private Duration connectTimeout = Duration.ofSeconds(5); 058 059 public String getUri() { 060 return this.uri; 061 } 062 063 public void setUri(String uri) { 064 this.uri = uri; 065 } 066 067 public String getApiToken() { 068 return this.apiToken; 069 } 070 071 public void setApiToken(String apiToken) { 072 this.apiToken = apiToken; 073 } 074 075 public String getHostTag() { 076 return this.hostTag; 077 } 078 079 public void setHostTag(String hostTag) { 080 this.hostTag = hostTag; 081 } 082 083 @Override 084 public Integer getBatchSize() { 085 return this.batchSize; 086 } 087 088 @Override 089 public void setBatchSize(Integer batchSize) { 090 this.batchSize = batchSize; 091 } 092 093 @Override 094 public Duration getConnectTimeout() { 095 return this.connectTimeout; 096 } 097 098 @Override 099 public void setConnectTimeout(Duration connectTimeout) { 100 this.connectTimeout = connectTimeout; 101 } 102 103}