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.wavefront; 018 019import java.net.URI; 020import java.time.Duration; 021 022import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryProperties; 023import org.springframework.boot.context.properties.ConfigurationProperties; 024 025/** 026 * {@link ConfigurationProperties} for configuring Wavefront metrics export. 027 * 028 * @author Jon Schneider 029 * @since 2.0.0 030 */ 031@ConfigurationProperties("management.metrics.export.wavefront") 032public class WavefrontProperties extends StepRegistryProperties { 033 034 /** 035 * Step size (i.e. reporting frequency) to use. 036 */ 037 private Duration step = Duration.ofSeconds(10); 038 039 /** 040 * URI to ship metrics to. 041 */ 042 private URI uri = URI.create("https://longboard.wavefront.com"); 043 044 /** 045 * Unique identifier for the app instance that is the source of metrics being 046 * published to Wavefront. Defaults to the local host name. 047 */ 048 private String source; 049 050 /** 051 * API token used when publishing metrics directly to the Wavefront API host. 052 */ 053 private String apiToken; 054 055 /** 056 * Global prefix to separate metrics originating from this app's white box 057 * instrumentation from those originating from other Wavefront integrations when 058 * viewed in the Wavefront UI. 059 */ 060 private String globalPrefix; 061 062 public URI getUri() { 063 return this.uri; 064 } 065 066 public void setUri(URI uri) { 067 this.uri = uri; 068 } 069 070 @Override 071 public Duration getStep() { 072 return this.step; 073 } 074 075 @Override 076 public void setStep(Duration step) { 077 this.step = step; 078 } 079 080 public String getSource() { 081 return this.source; 082 } 083 084 public void setSource(String source) { 085 this.source = source; 086 } 087 088 public String getApiToken() { 089 return this.apiToken; 090 } 091 092 public void setApiToken(String apiToken) { 093 this.apiToken = apiToken; 094 } 095 096 public String getGlobalPrefix() { 097 return this.globalPrefix; 098 } 099 100 public void setGlobalPrefix(String globalPrefix) { 101 this.globalPrefix = globalPrefix; 102 } 103 104}