micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

Observation "granularity"

Open jonatan-ivanov opened this issue 3 years ago • 3 comments

We received some feedback from users who instrument components that in some cases it would be useful to conditionally create Observations based on configuration. Something similar to log levels, e.g.: let's say we have two "levels" BASIC and DETAILED, if the config is set to DETAILED/ALL, all observations are created, if the config is set to BASIC, only those Observations are created that have BASIC as their level and DETAILED goes to noop.

/cc @jzheaux

jonatan-ivanov avatar Sep 28 '22 21:09 jonatan-ivanov

We had some discussions internally, what do you think about having these levels: OFF, BASIC, DETAILED, FULL? (OFF would not make sense from instrumentation perspective but only for filtering by the end-users) Or would you prefer two levels instead of three during instrumentation, like: OFF, BASIC, DETAILED?

@bclozel, @jzheaux, @ttddyy, @mhalbritter @marcingrzejszczak

jonatan-ivanov avatar Jan 30 '24 19:01 jonatan-ivanov

So, if I map them to logging level, would FULL=trace, DETAILED=debug, BASIC=info appropriate?

For JDBC instrumentation, I have connection, query, and result-set observations, all of which I believe fall into BASIC. For Spring Security, it seems that most observations would align with the DETAILED level. As for Boot/Framework observations, they would likely be BASIC.

I wonder what would be the best fit for FULL level observation if we have it.

ttddyy avatar Jan 31 '24 03:01 ttddyy

I'm fine with the 4 levels. FULL would give implementors, like @ttddyy said, a "trace" level if needed.

mhalbritter avatar Jan 31 '24 07:01 mhalbritter