001package io.prometheus.client.spring.web; 002 003import org.springframework.context.annotation.Import; 004 005import java.lang.annotation.Documented; 006import java.lang.annotation.ElementType; 007import java.lang.annotation.Retention; 008import java.lang.annotation.RetentionPolicy; 009import java.lang.annotation.Target; 010 011/** 012 * Enable the use of {@link PrometheusTimeMethod} annotation on classes or methods. 013 * 014 * Usage: Add this annotation to any Spring {@link org.springframework.context.annotation.Configuration} class to enable 015 * the use of the {@link PrometheusTimeMethod} annotation. 016 * 017 * * <pre><code> 018 * {@literal @}Configuration 019 * {@literal @}EnablePrometheusEndpoint 020 * {@literal @}EnablePrometheusTiming 021 * public class MyAppConfig { 022 * // Other configuration items... 023 * } 024 * </code></pre> 025 * 026 * @author Andrew Stuart 027 */ 028@Retention(RetentionPolicy.RUNTIME) 029@Target(ElementType.TYPE) 030@Import(MethodTimer.class) 031@Documented 032public @interface EnablePrometheusTiming {}