MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / createAttributedCounter

Function createAttributedCounter

source code/entrypoints/init.ts:316–333  ·  view source on GitHub ↗
(
      name: string,
      options: MetricOptions,
    )

Source from the content-addressed store, hash-verified

314 if (meter) {
315 // Create factory function for attributed counters
316 const createAttributedCounter = (
317 name: string,
318 options: MetricOptions,
319 ): AttributedCounter => {
320 const counter = meter?.createCounter(name, options)
321
322 return {
323 add(value: number, additionalAttributes: Attributes = {}) {
324 // Always fetch fresh telemetry attributes to ensure they're up to date
325 const currentAttributes = getTelemetryAttributes()
326 const mergedAttributes = {
327 ...currentAttributes,
328 ...additionalAttributes,
329 }
330 counter?.add(value, mergedAttributes)
331 },
332 }
333 }
334
335 setMeter(meter, createAttributedCounter)
336

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected