import * as tsplus_module_1 from "@effect/core/io/Metrics/MetricKey";
import * as tsplus_module_2 from "@effect/core/io/Metrics/operations/registry";
import * as tsplus_module_3 from "@effect/core/io/Metrics/definition";
/**
 * @tsplus static ets/Metrics/Metric/Ops fromMetricKey
 */

export function fromMetricKey(key) {
  const hook = extraTags => {
    const fullKey = tsplus_module_1.taggedWithLabelSet(key, extraTags);
    return tsplus_module_2.metricRegistry.value.get(fullKey);
  };

  return tsplus_module_3.Metric(key.keyType, (input, extraTags) => hook(extraTags).update(input), extraTags => hook(extraTags).get());
}
//# sourceMappingURL=fromMetricKey.mjs.map