- Adds a ObservationRegistry bean
- Add support for ObservationRegistryCustomizers
- Enables timer creation for observations if micrometer-core is on
the classpath
- Registers ObservationPredicate, GlobalTagsProvider and
ObservationHandler on the MeterRegistry
- Applies grouping to the ObservationHandlers: MeterObservationHandler
are added to a FirstMatchingCompositeObservationHandler
- If micrometer-tracing is on the classpath, the
TracingObservationHandler are added to a
FirstMatchingCompositeObservationHandler
Closes gh-29666
Reduce the number of times capacity growth is needed inside the StringWriter.
A typical default SpringBoot Prometheus page has more than 11k characters.
Best performance results when no capacity growth is needed at all, so base
it on previous metrics page size plus some room for possible extra metric info.
See gh-30085
Reduce the number of times capacity growth is needed inside the StringWriter.
A typical default SpringBoot Prometheus page has more than 11k characters.
Best performance results when no capacity growth is needed at all, so base
it on previous metrics page size plus some room for possible extra metric info.
See gh-30085
Micrometer duplicated the binders in a separate module named
micrometer-binders, and marked the binders in the core module as
deprecated. This commit changes the imports to use the new binders in
the micrometer-binders module. Additionally, the auto-configurations
honor user-supplied beans which use the old binders in the
micrometer-core module.
See gh-30014
This commit makes @ConstructorBinding optional for a type
that has a single parameterized constructor. An @Autowired annotation
on any of the constructors indicates that the type should not be constructor
bound.
Since @ConstructorBinding is now deduced for a single parameterized constructor,
the annotation is no longer needed at the type level.
Closes gh-23216
As Spring Framework removed support for RxJava 1.x and 2.x, we should do
the same and only provide dependency management for RxJava 3.x.
Closes gh-28212
This commit adds the required infrastructure for instrumenting the
GraphQL engine and datafetchers in order to collect metrics.
With this infrastructure, we can collect metrics such as:
* "graphql.request", a timer for GraphQL query
* "graphql.datafetcher", a timer for GraphQL datafetcher calls
* "graphql.request.datafetch.count", a distribution summary of
datafetcher count per query
* "graphql.error", an error counter
See gh-29140
Previously the parameters were not ignored so */*;q=0.8 was not
identified as accepting */*. As a result, the most recent producible
content type was returned rather than the default.
This commit updates the argument resolver to ignore parameters.
The default content type is now produced in response to a request
that accepts */*, irrespective of its parameters.
Fixes gh-28446
Change the cache in `CachingOperationInvoker` to be a reference based
map and also clean stale entries when a specific threshold is met.
Fixes gh-28313
Update Prometheus `TextOutputFormat` so that OpenMetrics is used in
preference to text output when an appropriate accept header is found.
If the accept header contains `*/*` or is missing then the text format
will be used.
See gh-28130
Add an `isDefault()` method to `Producible` which can be used to
indicate which of the enum values should be used when the accept header
is `*/*` or `null`.
Prior to this commit, the last enum value was always used as the
default.
See gh-28130
Previously, the URI template handler installed by the client metrics
interceptor would always capture the URI template and push it onto the
deque, irrespective of whether auto timing was enabled. When
auto-timing is disabled the deque is never polled so this led to its
unrestricted growth.
This commit updates the URI template handler so that a URI template is
only pushed onto the deque when the auto timing configuration enables
the interceptor.
Fixes gh-26915
Change `CompositeHealth.getDetails()` to public so that it serializes
correctly when `MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS` is
disabled.
Fixes gh-26797
Rework existing `@Timer` annotation support to remove duplicate code
and offer general purpose utilities that can be used in future metrics
support.
See gh-23112
See gh-22217
Extract common method logic to a `HandlerMethodTimedAnnotations`
utility class and also add some caching. Also move the test code
into a single class.
See gh-23112
Fix package tangle in the actuator endpoint package by relocating a
few classes.
The `Producible` and `ProducibleOperationArgumentResolver` classes have
been moved from `endpoint.annotation` to `endpoint` since they aren't
directly tied to annotations.
The `ApiVersion` class has been moved from `endpoint.http` to
`endpoint` since it needs to implement `Producible` and isn't really
tied to HTTP.
Closes gh-25914
This commit reworks the initial proposal so that jobs and triggers are
treated as first class concepts.
`/actuator/quartz` now returns the group names for jobs and triggers.
`actuator/quartz/jobs` returns the job names, keyed by the available
group names, while `/actuator/quartz/triggers` does the same for
triggers.
`/actuator/jobs/{groupName}` provides an overview of a job group. It
provides a map of job names with the class name of the job.
implementation
`/actuator/triggers/{groupName}` provides an overview of a trigger
group. There are five supported trigger implementations: cron, simple,
daily time interval, calendar interval, and custom for any other
implementation. Given that each implementation has specific settings,
triggers are split in five objects.
`/actuator/jobs/{groupName}/{jobName}` provides the full details of a
particular job. This includes a sanitized data map and a list of
triggers ordered by next fire time.
`/actuator/triggers/{groupName}/{triggerName}` provides the full details
of a particular trigger. This includes the state, its type, and a
dedicate object containing implementation-specific settings.
See gh-10364
Prior to this commit, some exceptions handled at the controller or
handler function level would:
* not bubble up to the Spring Boot error handling support
* not be tagged as part of the request metrics
This situation is inconsistent because in general, exceptions handled at
the controller level can be considered as expected behavior.
Also, depending on how the exception is handled, the request metrics
might not be tagged with the exception.
This will be reconsidered in gh-23795.
This commit prepares a transition to the new situation. Developers can
now opt-in and set the handled exception as a request attribute. This
well-known attribute will be later read by the metrics support and used
for tagging the request metrics with the exception provided.
This mechanism is automatically used by the error handling support in
Spring Boot.
Closes gh-24028
Previously, would log an error for any exception and also stop
publishing for an UnknownHostException. By constrast, Micrometer's
PushMeterRegistry treats all exceptions the same, logging a warning
and continuing with subsequent push attempts.
This commit updates the push gateway manager's behaviour to match
PushMeterRegistry. UknownHostExceptions no longer receive special
treatment and push (and delete) failures are now logged as warnings
rather than errors.
Fixes gh-25804
Prior to this commit, the Actuator instrumentation for WebFlux servers
would not record metrics in two cases:
* the client disconnects before the response has been sent
* a server timeout is triggered before the response is sent
This commit improves the existing instrumentation to record metrics in
these cases. Since the causes of timeouts/disconnections can vary a lot,
the chosen "outcome" tag for metrics is "UNKNOWN".
Closes gh-23606