Commit Graph

144 Commits (b5b86d07bad11f6739b371ce75510f1ede38344a)

Author SHA1 Message Date
Phillip Webb 6b3e79e693 Polish 11 years ago
Phillip Webb 1bcd3de7b5 Polish 11 years ago
Dave Syer aa2b020660 Refactor metrics to expose richer feature set
Main user-facing interface is still Counter/GaugeService but the
back end behind that has more options. The Default*Services write
metrics to a MetricWriter and there are some variants of that, and
also variants of MetricReader (basic read-only actions).

MetricRepository is now a combination of MetricReader, MetricWriter
and some more methods that make it a bit more repository like.

There is also a MultiMetricReader and a MultiMetricRepository for
the common case where metrics are stored in related (often open
ended) groups. Examples would be complex metrics like histograms
and "rich" metrics with averages and statistics attached (which
are both closed) and "field counters" which count the occurrences
of values of a particular named field or slot in an incoming message
(e.g. counting Twitter hastags, open ended).

In memory and redis implementations are provided for the repositories.
Generally speaking the in memory repository should be used as a
local buffer and then scheduled "exports" can be executed to copy
metric values accross to a remote repository for aggregation.
There is an Exporter interface to support this and a few implementations
dealing with different strategies for storing the results (singly or
grouped).

Codahale metrics are also supported through the MetricWriter interface.
Currently implemented through a naming convention (since Codahale has
a fixed object model this makes sense): metrics beginning with "histogram"
are Histograms, "timer" for Timers, "meter" for Meters etc.

Support for message driven metric consumption and production are provided
through a MetricWriterMessageHandler and a MessageChannelMetricWriter.

No support yet for pagination in the repositories, or for HATEOAS style
HTTP endpoints.
11 years ago
Christian Dupuis 384dfc91e3 Fix some tests to prevent JMX registration issues 11 years ago
Christian Dupuis 4ed4ed905d Make EndpointMBeanExportAutoConfiguration public 11 years ago
Christian Dupuis 06ffcdd3cc Change configuration to use ConfigurationProperties instead of direct access to environment for MBean export 11 years ago
Christian Dupuis 65d6757a10 Rework EndpointMBeanExporter to prevent name clashes and to provide more flexibility in naming of endpoint MBeans 11 years ago
Dave Syer 8e2a6eec2a Add database query defaults in SimpleHealthManager 11 years ago
Dave Syer 063403a043 Close connection properly in /health
Fixes gh-181
11 years ago
Dave Syer fa507005cd Use ServletWrappingController for jolokia instead of Servlet
We get more control over the handling and in particular the registration
of the endpoint this way. It was practically impossible to disable the
AgentServlet bean when in a parent context of the management server
because of lifecyce issues - you don't know that the user wants a
separate management server until too late.

This approach also makes it possible to test with spring-test MVC
support.
11 years ago
Christian Dupuis 72ae5d5a97 Rename invoke JMX operation
Rename invoke JMX operation to getData for endpoints that provide actuator data. Special case for ShutdownEndpoint to provide a shutdown method.
11 years ago
Christian Dupuis 31f7807acf Change naming strategy for endpoint mbeans 11 years ago
Dave Syer e2c962ac28 Switch to thymeleaf-spring4 11 years ago
Phillip Webb d6dbbebc88 Polish 11 years ago
Phillip Webb 7c78b74a76 Minor polish 11 years ago
Phillip Webb 43b820a7d3 Rename Endpoint path to ID 11 years ago
Dave Syer 451acb5679 Move JolokiaEndpoint so it is not an Endpoint 11 years ago
Dave Syer 7f1264bb65 Replace @FrameworkEndpoint with MvcEndpoint interface 11 years ago
Dave Syer 87e00cfae9 Extract MVC concerns completely from Endpoint implementations 11 years ago
Dave Syer 6443800038 Add actuator-noweb sample 11 years ago
Dave Syer 332f23a0ee Add parent properties to config props endpoint 11 years ago
Dave Syer bbac4ea9fb @FrameworkEndpoint replaces EndpointHandlerAdapter 11 years ago
Christian Dupuis 5a978e2f31 Change strategy from ApplicationListener to SmartLifecycle to avoid multiple registration attempts for the same beans
When running with parent/child application contexts the previous implementation was trying to re-register the same beans with JMX which led to errors.
11 years ago
Christian Dupuis 0a04b74379 Allow configuration of domainName and key for endpoint JMX export 11 years ago
Christian Dupuis cd1a228210 Allow Endpoint JMX export to be switched off 11 years ago
Christian Dupuis 32818515b7 Expose endpoints via JMX
Actuator endpoints are now being exposed over JMX.
11 years ago
Phillip Webb 513c6a1de2 Polish 11 years ago
Phillip Webb 85fb1cba0b Rework HttpMessageConverters 11 years ago
Dave Syer b72002142d Split MessageConverters auto config out into separate class 11 years ago
Dave Syer c78973e375 MessageConverters -> HttpMessageConverters 11 years ago
Dave Syer c2b499c775 Support for @Beans of type HttpMessageConverter, and Jackson specific details
You can contribute additional HttpMessageConverters
by simply adding beans of that type in a Spring Boot
context. If a bean you add is of a type that would have been included
by default anyway (like MappingJackson2HttpMessageConverter for JSON
conversions) then it will replace the default value. A convenience
bean is provided of type MessageConverters (always available if you
use the default MVC configuration) which has some useful methods to
access the default and user-enhanced message converters (useful, for
example if you want to manually inject them into a custom
RestTemplate).

There are also some convenient configuration shortcuts for Jackson2.
The smallest change that might work is to just add beans of type
Module to your context. They will be registered with the default
ObjectMapper and then injected into the default message
converter. In addition, if your context contains any beans of type
ObjectMapper then all of the Module beans will be registered with
all of the mappers.
11 years ago
Dave Syer beef5cfd31 Prevent type not present exception when no security on classpath 11 years ago
Dave Syer b05ffd1164 Add extra condition to security properties config 11 years ago
Dave Syer 1db28e5b92 Prevent cryptic exception if SecurityProperties not created
Previously if a user happened to provide an @EnableWebSecurity bean
the SecurityProperties would not be created, which is fine until you
add the Actuator (which needs them). Fixed by adding an explicit
SecurityProperties @Bean if not already present.
11 years ago
Dave Syer 023faf092f Fix broken test 11 years ago
Dave Syer bcae284dd9 Add a shim Endpoint if management context is child
When management endpoints are on a different port the HandlerMappings
are restricted to a single EndpointHandlerMapping, so the error
controller (which is a normal @Controller with @RequestMappings) does
not get mapped.

Fixed by addinga shim Endpoint on "/error" that delegates to the
ErrorController (which interface picks up an extra method).
11 years ago
Dave Syer 884fd0125a Add some handler adapter tests 11 years ago
Dave Syer 2104d9a1e2 Prevent failure of web app with parent context
ServerProperties formerly had an @OnMissingBeanCondition
that didn't restrict the hierarchy. It also asserts that
the current context (not including parents) contains such
a bean. This led to an inevitable failure when there was
an existing instance in the parent context.

Fixed by a) searching only the current context, b) not
adding a ServerProperties bean if the context is not a
web app.
11 years ago
Christian Dupuis 5661f8fc28 Test key/value sanitization 11 years ago
Christian Dupuis 078933c8fd Add actuator endpoint to expose ConfigurationProperties
This information should probably be also available from the console and log similar to AutoConfigurationReport.
11 years ago
Christian Dupuis 00c8633597 Add missing new exception class 11 years ago
Christian Dupuis 2c67e06b47 Move enablement of endpoints into AbstractEndpoint 11 years ago
Dave Syer e74da3fa73 FIXME test additions 11 years ago
Dave Syer 3e6c1b435f Add @SpringApplicationConfiguration (for integration testing)
Example:

    @RunWith(SpringJUnit4ClassRunner.class)
    @SpringApplicationConfiguration(classes = SampleDataJpaApplication.class)
    public class CityRepositoryIntegrationTests {

    	@Autowired
    	CityRepository repository;

Fixes gh-66.
11 years ago
Dave Syer 3e5e058b02 Ensure /error view is available 11 years ago
Dave Syer 8c9b7bd406 Use SimpleHealthIndicator if DataSource present 11 years ago
Dave Syer 20bede21ad Add support for parent hierarchy in AUtoConfigurationReport 11 years ago
Dave Syer b74a9b2d06 Add tests to FIXME 11 years ago
Dave Syer 171c1366f9 Move shutdown enable flag to the endpoint 11 years ago
Dave Syer 94e2f90793 Ensure endpoints.jolokia.enabled=false switches off jolokia 11 years ago