@Override
  public void encode(Object object, Type bodyType, RequestTemplate template)
      throws EncodeException {
    try (final Timer.Context classTimer =
        metricRegistry
            .timer(
                metricName.metricName(template.methodMetadata(), template.feignTarget()),
                metricSuppliers.timers())
            .time()) {
      encoder.encode(object, bodyType, template);
    }

    if (template.body() != null) {
      metricRegistry
          .histogram(
              metricName.metricName(
                  template.methodMetadata(), template.feignTarget(), "request_size"),
              metricSuppliers.histograms())
          .update(template.body().length);
    }
  }
Warp feign {@link Encoder} with metrics.
dropwizard-metrics4/src/main/java/feign/metrics4/MeteredEncoder.java