-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial timer listener proof-of-concept Adapts the `Timer.Sample` to make the callbacks on the `TimerRecordingListener` for `onStart`, `onError`, `onStop`. Being the initial pass, this tries to keep things as minimal as possible. Even the `onError` callback could probably have been initially omitted since we should work on making error tagging more of a first-class citizen in Micrometer. Then using an `onError` callback will be more natural. * Add a test with a listener implementation that makes Brave Spans Proves the listener with one implementation that makes spans from the timer recording. * Leave some TODO comments to consider * Runnable instrumentation test for TimerRecordingListenerTest Tests that the trace context is correct when a runnable is executed on another thread. * Add config to boot2-reactive sample using TimerRecordingListener Uses the BraveTimerRecordingListener previously used in a unit test in the boot2-reactive sample application. The current Spring Boot instrumentation for WebFlux does not use the Timer start/stop methods, so the instrumentation code was copied and modified with the corresponding auto-configuration excluded. With the change to use start/stop, the listener is making spans as expected. However, the trace context is not being propagated into or out of the process - trace headers passed to the application are not used, and trace headers are not sent on calls outside the application. * Assert parent context inside runnable test * Make TimerRecordingListener generic * ADded tracing stuff * Added cardinality and tracing contexts * Hacking Timer and MeterRegistry to store samples * Updated the context and setting of current samples * Tags provider WIP * Added simple test utility API * Made context a tags provider * Added support for TCKs for listeners * Reusing micrometer-metrics/tracing + polish * Listener -> Handler, Context -> HandlerContext * Added First and All matching composite timer recording handlers * Fixing build config so that we can resolve micrometer-tracing * Introduce timeout for Jersey tests There is some kind of locking/timing issue with the Jersey tests, this change introduces timeouts so the build will have a chance to fail. Without this the build never finishes. * Fix' * Guard against null currentSample Instrumentation may switch threads without updating the current sample. This avoids the NPE in that situation and instead issues a warning log on first occurrence. * Remove micrometer-tracing references * Always sets a context Co-authored-by: Tommy Ludwig <[email protected]> Co-authored-by: Jonatan Ivanov <[email protected]>
- Loading branch information
1 parent
f83cc85
commit 29c3400
Showing
41 changed files
with
2,557 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
micrometer-core/src/main/java/io/micrometer/core/instrument/TagsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright 2017 VMware, Inc. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* <p> | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micrometer.core.instrument; | ||
|
||
/** | ||
* A provider of tags. | ||
* | ||
* @author Marcin Grzejszczak | ||
*/ | ||
public interface TagsProvider { | ||
|
||
default Tags getLowCardinalityTags() { | ||
return Tags.empty(); | ||
} | ||
|
||
default Tags getHighCardinalityTags() { | ||
return Tags.empty(); | ||
} | ||
|
||
default Tags getAllTags() { | ||
return Tags.concat(getLowCardinalityTags(), getHighCardinalityTags()); | ||
} | ||
} |
Oops, something went wrong.