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.atlas;
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 Atlas metrics export.
026 *
027 * @author Jon Schneider
028 * @author Stephane Nicoll
029 * @since 2.0.0
030 */
031@ConfigurationProperties(prefix = "management.metrics.export.atlas")
032public class AtlasProperties extends StepRegistryProperties {
033
034        /**
035         * URI of the Atlas server.
036         */
037        private String uri = "http://localhost:7101/api/v1/publish";
038
039        /**
040         * Time to live for meters that do not have any activity. After this period the meter
041         * will be considered expired and will not get reported.
042         */
043        private Duration meterTimeToLive = Duration.ofMinutes(15);
044
045        /**
046         * Whether to enable streaming to Atlas LWC.
047         */
048        private boolean lwcEnabled;
049
050        /**
051         * Frequency for refreshing config settings from the LWC service.
052         */
053        private Duration configRefreshFrequency = Duration.ofSeconds(10);
054
055        /**
056         * Time to live for subscriptions from the LWC service.
057         */
058        private Duration configTimeToLive = Duration.ofSeconds(150);
059
060        /**
061         * URI for the Atlas LWC endpoint to retrieve current subscriptions.
062         */
063        private String configUri = "http://localhost:7101/lwc/api/v1/expressions/local-dev";
064
065        /**
066         * URI for the Atlas LWC endpoint to evaluate the data for a subscription.
067         */
068        private String evalUri = "http://localhost:7101/lwc/api/v1/evaluate";
069
070        public String getUri() {
071                return this.uri;
072        }
073
074        public void setUri(String uri) {
075                this.uri = uri;
076        }
077
078        public Duration getMeterTimeToLive() {
079                return this.meterTimeToLive;
080        }
081
082        public void setMeterTimeToLive(Duration meterTimeToLive) {
083                this.meterTimeToLive = meterTimeToLive;
084        }
085
086        public boolean isLwcEnabled() {
087                return this.lwcEnabled;
088        }
089
090        public void setLwcEnabled(boolean lwcEnabled) {
091                this.lwcEnabled = lwcEnabled;
092        }
093
094        public Duration getConfigRefreshFrequency() {
095                return this.configRefreshFrequency;
096        }
097
098        public void setConfigRefreshFrequency(Duration configRefreshFrequency) {
099                this.configRefreshFrequency = configRefreshFrequency;
100        }
101
102        public Duration getConfigTimeToLive() {
103                return this.configTimeToLive;
104        }
105
106        public void setConfigTimeToLive(Duration configTimeToLive) {
107                this.configTimeToLive = configTimeToLive;
108        }
109
110        public String getConfigUri() {
111                return this.configUri;
112        }
113
114        public void setConfigUri(String configUri) {
115                this.configUri = configUri;
116        }
117
118        public String getEvalUri() {
119                return this.evalUri;
120        }
121
122        public void setEvalUri(String evalUri) {
123                this.evalUri = evalUri;
124        }
125
126}