Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observation text publisher #3034

Merged

Conversation

jonatan-ivanov
Copy link
Member

Example output:

START - name='sample.operation', contextualName='CALL sampleOperation', error='null', lowCardinalityTags=[a='1'], highCardinalityTags=[time='2022-02-19T00:29:08.937229Z'], map=[class io.micrometer.api.instrument.Timer$Sample='io.micrometer.api.instrument.Timer$Sample@2a18f23c']
 OPEN - name='sample.operation', contextualName='CALL sampleOperation', error='null', lowCardinalityTags=[a='1'], highCardinalityTags=[time='2022-02-19T00:29:08.937229Z'], map=[class io.micrometer.api.instrument.Timer$Sample='io.micrometer.api.instrument.Timer$Sample@2a18f23c']
ERROR - name='sample.operation', contextualName='CALL sampleOperation', error='java.io.IOException: simulated', lowCardinalityTags=[a='1'], highCardinalityTags=[time='2022-02-19T00:29:08.937229Z'], map=[class io.micrometer.api.instrument.Timer$Sample='io.micrometer.api.instrument.Timer$Sample@2a18f23c']
CLOSE - name='sample.operation', contextualName='CALL sampleOperation', error='java.io.IOException: simulated', lowCardinalityTags=[a='1'], highCardinalityTags=[time='2022-02-19T00:29:08.937229Z'], map=[class io.micrometer.api.instrument.Timer$Sample='io.micrometer.api.instrument.Timer$Sample@2a18f23c']
 STOP - name='sample.operation', contextualName='CALL sampleOperation', error='java.io.IOException: simulated', lowCardinalityTags=[a='1', className='CustomContext', localClassName='CustomContext'], highCardinalityTags=[time='2022-02-19T00:29:08.937229Z', userId='55d37607-6db0-4e36-a2f2-e7978906de8a', localUserId='55d37607-6db0-4e36-a2f2-e7978906de8a'], map=[class io.micrometer.api.instrument.Timer$Sample='io.micrometer.api.instrument.Timer$Sample@2a18f23c']

---

sample.operation(TIMER)[a='1', className='CustomContext', error='simulated', localClassName='CustomContext']; count=1.0, total_time=1.036482778 seconds, max=1.036482778 seconds

So that it is easy to publish the text representation of the context to somewhere (e.g.: stdout)
@jonatan-ivanov jonatan-ivanov added the enhancement A general enhancement label Feb 19, 2022
@jonatan-ivanov jonatan-ivanov added this to the 2.0.0-M3 milestone Feb 19, 2022
@jonatan-ivanov jonatan-ivanov changed the base branch from main to 2.0.x February 19, 2022 00:32
Copy link
Contributor

@marcingrzejszczak marcingrzejszczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, I've added a small remark

*
* @param key key by which to remove an entry
*/
public void remove(Object key) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should return the removed object?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 I just moved this method, did not change the signature but we should definitely do this.

Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a pretty awesome debugging tool to me. Maybe we want to consider some kind of debug option that registers this.

@shakuzen shakuzen merged commit d27b45e into micrometer-metrics:2.0.x Feb 21, 2022
@jonatan-ivanov jonatan-ivanov deleted the observation-text-publisher branch February 21, 2022 21:47
@jonatan-ivanov
Copy link
Member Author

@shakuzen 👍🏼 I'm going to implement this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants