Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
b8f11e79
Commit
b8f11e79
authored
Mar 10, 2016
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Atlas no longer requires a RestTemplate bean.
fixes gh-881
parent
4f31596e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
AtlasConfiguration.java
...ework/cloud/netflix/metrics/atlas/AtlasConfiguration.java
+6
-1
AtlasExporterTests.java
...ework/cloud/netflix/metrics/atlas/AtlasExporterTests.java
+4
-4
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/metrics/atlas/AtlasConfiguration.java
View file @
b8f11e79
...
...
@@ -17,6 +17,7 @@ import java.util.Collection;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.actuate.metrics.export.Exporter
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
...
...
@@ -42,6 +43,10 @@ public class AtlasConfiguration {
@Autowired
(
required
=
false
)
private
Collection
<
AtlasTagProvider
>
tagProviders
;
@Autowired
(
required
=
false
)
@Qualifier
(
"atlasRestTemplate"
)
private
RestTemplate
restTemplate
=
new
RestTemplate
();
@Bean
public
AtlasMetricObserverConfigBean
atlasObserverConfig
()
{
return
new
AtlasMetricObserverConfigBean
();
...
...
@@ -49,7 +54,7 @@ public class AtlasConfiguration {
@Bean
@ConditionalOnMissingBean
public
AtlasMetricObserver
atlasObserver
(
AtlasMetricObserverConfigBean
atlasObserverConfig
,
RestTemplate
restTemplate
)
{
public
AtlasMetricObserver
atlasObserver
(
AtlasMetricObserverConfigBean
atlasObserverConfig
)
{
BasicTagList
tags
=
(
BasicTagList
)
BasicTagList
.
EMPTY
;
if
(
tagProviders
!=
null
)
{
for
(
AtlasTagProvider
tagProvider
:
tagProviders
)
{
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/metrics/atlas/AtlasExporterTests.java
View file @
b8f11e79
...
...
@@ -18,9 +18,9 @@ import java.util.Properties;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.cloud.client.loadbalancer.LoadBalanced
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.support.PropertySourcesPlaceholderConfigurer
;
...
...
@@ -41,10 +41,10 @@ import com.netflix.servo.monitor.DynamicCounter;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
public
class
AtlasExporterTests
{
@Autowired
RestTemplate
restTemplate
;
private
RestTemplate
restTemplate
;
@Autowired
AtlasExporter
atlasExporter
;
private
AtlasExporter
atlasExporter
;
@Test
public
void
exportMetricsAtPeriodicIntervals
()
{
...
...
@@ -68,7 +68,7 @@ public class AtlasExporterTests {
@EnableAtlas
class
AtlasExporterConfiguration
{
@
LoadBalanced
@
Qualifier
(
"atlasRestTemplate"
)
@Bean
public
RestTemplate
restTemplate
()
{
return
new
RestTemplate
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment