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