(
name: string,
options: MetricOptions,
)
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected