Metrics are by default disabled in integration tests, you have to enable them explicitly with @AutoConfigureMetrics. The same is not true for tracing at the moment. We should disable tracing in integration tests, too. Think about if we should rename the annotation to @AutoConfigureObservability which would enable metrics and tracing in the integration tests.

Comment From: wilkinsona

I like the renaming idea. I wonder if a user would ever want to only enable metrics or only enable tracing? If so, perhaps the annotation could have an attribute that allows you to control what's enabled.

Something like this (but with better names):

public @interface AutoConfigureObservability {

    Component[] value() default { Component.METRICS, Component.TRACING };

    enum Component {

        METRICS, TRACING;

    }

}

Or, given that observability's unlikely to expand much, if at all, in terms of the number of components, it could be two booleans:

public @interface AutoConfigureObservability {

    boolean metrics() default true;

    boolean tracing() default true;

}

We could keep @AutoConfigureMetrics in a deprecated form for backwards compatibility "delegating" to @AutoConfigureObservability:

@AutoConfigureObservability(tracing = false)
public @interface AutoConfigureMetrics {

}

Comment From: mhalbritter

I really like this, thanks Andy!

Comment From: mhalbritter

I've implemented the @AutoConfigureObservability annotation, deprecated the @AutoConfigureMetrics one, updated the docs, and all our tracing auto-configurations now back off in tests. I will add the deprecation of @AutoConfigureMetrics to the release notes.