Is there equivalent to InstrumentationAttachmentStrategy in EntLib 5?

Jul 6, 2010 at 5:19 AM
Edited Jul 6, 2010 at 5:20 AM

In project I used the following code to simplify Instrumentation development:

        public ClientInstrumentationProvider(IConfigurationSource configuration)
            InstrumentationAttachmentStrategy strategy = new InstrumentationAttachmentStrategy();
            strategy.AttachInstrumentation("MyPrivider", this, configuration, ConfigurationReflectionCache);

But when I upgraded my project from Ent Lib 4.1 to Ent Lib 5, I found InstrumentationAttachmentStrategy was removed from 5.

Anybody could help me? Thanks in advance.

Jul 6, 2010 at 2:32 PM

It seems this change was not documented in the change log for 5.0, we'll just inquire entlib team regarding this.

Gino Terrado
Global Technology and Solutions
Avanade, Inc.

Jul 7, 2010 at 7:02 PM

Basically, the instrumentation attachment stuff was ripped out completely; the previous instrumentation approach (separate listeners and providers) was overly complex, slow, and hard to understand for no real benefit. We didn't document every detailed change to the Entlib internals in the change log because: 1) Its was pretty much "we threw it out and started over", and 2) it wasn't visible to the vast majority of users anyway.

Instrumentation providers are now simple dependencies to the block objects. As such, no specific strategy is needed to connect them anymore. Just implement the appropriate instrumentation providers for the blocks you care about, register them in your DI container, and that should do it.