import * as tsplus_module_1 from "@tsplus/stdlib/collections/HashSet/union";
import * as tsplus_module_2 from "@effect/core/io/Metrics/definition";
import * as tsplus_module_3 from "@effect/core/io/Metrics/operations/map";
import { constVoid } from "@tsplus/stdlib/data/Function";
/**
 * Returns a new metric, which is identical in every way to this one, except
 * dynamic tags are added based on the update values. Note that the metric
 * returned by this method does not return any useful information, due to the
 * dynamic nature of the added tags.
 *
 * @tsplus fluent ets/Metrics/Metric taggedWith
 */

export function taggedWith_(self, f) {
  return tsplus_module_3.map_(tsplus_module_2.Metric(self.keyType, (input, extraTags) => self.unsafeUpdate(input, tsplus_module_1.union_(f(input), extraTags)), self.unsafeValue), constVoid);
}
/**
 * Returns a new metric, which is identical in every way to this one, except
 * dynamic tags are added based on the update values. Note that the metric
 * returned by this method does not return any useful information, due to the
 * dynamic nature of the added tags.
 *
 * @tsplus static ets/Metrics/Metric/Aspects taggedWith
 */

export const taggedWith = f => self => taggedWith_(self, f);
//# sourceMappingURL=taggedWith.mjs.map