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
7234a997
Commit
7234a997
authored
Dec 18, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #735 from jkschneider/metrics-gauge-deconflict
* jkschneider-metrics-gauge-deconflict: Deconflict GaugeService provided by Servo/Spectator integration
parents
2bb6befb
33d65184
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
22 deletions
+9
-22
AtlasAutoConfiguration.java
...k/cloud/netflix/metrics/atlas/AtlasAutoConfiguration.java
+2
-9
AtlasMetricObserver.java
...work/cloud/netflix/metrics/atlas/AtlasMetricObserver.java
+2
-2
ServoMetricsAutoConfiguration.java
.../netflix/metrics/servo/ServoMetricsAutoConfiguration.java
+3
-6
SpectatorMetricsAutoConfiguration.java
.../metrics/spectator/SpectatorMetricsAutoConfiguration.java
+2
-5
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/metrics/atlas/AtlasAutoConfiguration.java
View file @
7234a997
...
...
@@ -27,7 +27,6 @@ import org.springframework.context.annotation.Import;
import
org.springframework.web.client.RestTemplate
;
import
com.netflix.servo.MonitorRegistry
;
import
com.netflix.servo.publish.MetricPoller
;
import
com.netflix.servo.publish.MonitorRegistryMetricPoller
;
import
com.netflix.servo.tag.BasicTagList
;
...
...
@@ -65,13 +64,7 @@ public class AtlasAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public
MetricPoller
metricPoller
(
MonitorRegistry
monitorRegistry
)
{
return
new
MonitorRegistryMetricPoller
(
monitorRegistry
);
}
@Bean
@ConditionalOnMissingBean
public
Exporter
exporter
(
AtlasMetricObserver
observer
,
MetricPoller
poller
)
{
return
new
AtlasExporter
(
observer
,
poller
);
public
Exporter
exporter
(
AtlasMetricObserver
observer
,
MonitorRegistry
monitorRegistry
)
{
return
new
AtlasExporter
(
observer
,
new
MonitorRegistryMetricPoller
(
monitorRegistry
));
}
}
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/metrics/atlas/AtlasMetricObserver.java
View file @
7234a997
...
...
@@ -81,12 +81,12 @@ public class AtlasMetricObserver implements MetricObserver {
protected
static
boolean
validTags
(
TagList
tags
)
{
for
(
Tag
tag
:
tags
)
{
if
(!
validAtlasTag
.
matcher
(
tag
.
getKey
()).
matches
())
{
logger
.
error
(
"Invalid tag key "
+
tag
.
getKey
());
logger
.
debug
(
"Invalid tag key "
+
tag
.
getKey
());
return
false
;
}
if
(!
validAtlasTag
.
matcher
(
tag
.
getValue
()).
matches
())
{
logger
.
error
(
"Invalid tag value "
+
tag
.
getValue
());
logger
.
debug
(
"Invalid tag value "
+
tag
.
getValue
());
return
false
;
}
}
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/metrics/servo/ServoMetricsAutoConfiguration.java
View file @
7234a997
...
...
@@ -13,10 +13,8 @@
package
org
.
springframework
.
cloud
.
netflix
.
metrics
.
servo
;
import
org.springframework.boot.actuate.autoconfigure.
Endpoint
AutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.
MetricRepository
AutoConfiguration
;
import
org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics
;
import
org.springframework.boot.actuate.metrics.CounterService
;
import
org.springframework.boot.actuate.metrics.GaugeService
;
import
org.springframework.boot.actuate.metrics.reader.MetricReader
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
...
...
@@ -43,7 +41,7 @@ import com.netflix.servo.monitor.Monitors;
@Configuration
@ConditionalOnClass
({
Monitors
.
class
,
MetricReader
.
class
})
@ConditionalOnMissingClass
(
"com.netflix.spectator.api.Registry"
)
@AutoConfigureBefore
(
Endpoint
AutoConfiguration
.
class
)
@AutoConfigureBefore
(
MetricRepository
AutoConfiguration
.
class
)
@Import
(
MetricsInterceptorConfiguration
.
class
)
public
class
ServoMetricsAutoConfiguration
{
@Bean
...
...
@@ -78,8 +76,7 @@ public class ServoMetricsAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean
({
ServoMetricServices
.
class
,
CounterService
.
class
,
GaugeService
.
class
})
public
ServoMetricServices
spectatorMetricServices
(
MonitorRegistry
monitorRegistry
)
{
public
ServoMetricServices
servoMetricServices
(
MonitorRegistry
monitorRegistry
)
{
return
new
ServoMetricServices
(
monitorRegistry
);
}
...
...
spring-cloud-netflix-spectator/src/main/java/org/springframework/cloud/netflix/metrics/spectator/SpectatorMetricsAutoConfiguration.java
View file @
7234a997
...
...
@@ -14,7 +14,7 @@
package
org
.
springframework
.
cloud
.
netflix
.
metrics
.
spectator
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.actuate.autoconfigure.
Endpoint
AutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.
MetricRepository
AutoConfiguration
;
import
org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics
;
import
org.springframework.boot.actuate.metrics.reader.MetricReader
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
...
...
@@ -30,8 +30,6 @@ import org.springframework.context.annotation.Import;
import
com.netflix.servo.DefaultMonitorRegistry
;
import
com.netflix.servo.MonitorRegistry
;
import
com.netflix.servo.publish.MetricPoller
;
import
com.netflix.servo.publish.MonitorRegistryMetricPoller
;
import
com.netflix.spectator.api.Registry
;
import
com.netflix.spectator.servo.ServoRegistry
;
...
...
@@ -46,7 +44,7 @@ import com.netflix.spectator.servo.ServoRegistry;
* @author Jon Schneider
*/
@Configuration
@AutoConfigureBefore
(
Endpoint
AutoConfiguration
.
class
)
@AutoConfigureBefore
(
MetricRepository
AutoConfiguration
.
class
)
@ConditionalOnClass
({
Registry
.
class
,
MetricReader
.
class
})
@Import
(
MetricsInterceptorConfiguration
.
class
)
public
class
SpectatorMetricsAutoConfiguration
{
...
...
@@ -73,7 +71,6 @@ public class SpectatorMetricsAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean
public
SpectatorMetricServices
spectatorMetricServices
(
Registry
metricRegistry
)
{
return
new
SpectatorMetricServices
(
metricRegistry
);
}
...
...
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