@Override
  public DimensionData getDimensions(MetricRule rule, List<String> tagBasedResourceIds) {
    DimensionData cachedDimensions =
        this.cache.getIfPresent(new DimensionCacheKey(rule, tagBasedResourceIds));
    if (cachedDimensions != null) {
      return cachedDimensions;
    }
    DimensionData dimensions = delegate.getDimensions(rule, tagBasedResourceIds);
    this.cache.put(new DimensionCacheKey(rule, tagBasedResourceIds), dimensions);
    return dimensions;
  }
Create a new DimensionSource that will cache the results from another {@link DimensionSource}

@param source
@param config - config used to configure the expiry (ttl) for entries in the cache
@return a new CachingDimensionSource
src/main/java/io/prometheus/cloudwatch/CachingDimensionSource.java