@effect/opentelemetry 4.0.0-beta.7 → 4.0.0-beta.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,8 +11,8 @@ import type {
11
11
  import { AggregationTemporality, DataPointType, InstrumentType } from "@opentelemetry/sdk-metrics"
12
12
  import type { InstrumentDescriptor } from "@opentelemetry/sdk-metrics/build/src/InstrumentDescriptor.js"
13
13
  import * as Arr from "effect/Array"
14
+ import type * as Context from "effect/Context"
14
15
  import * as Metric from "effect/Metric"
15
- import type * as ServiceMap from "effect/ServiceMap"
16
16
  import type * as Metrics from "../Metrics.ts"
17
17
 
18
18
  const sdkName = "@effect/opentelemetry/Metrics"
@@ -37,7 +37,7 @@ interface PreviousSummaryState {
37
37
  /** @internal */
38
38
  export class MetricProducerImpl implements MetricProducer {
39
39
  resource: Resources.Resource
40
- services: ServiceMap.ServiceMap<never>
40
+ context: Context.Context<never>
41
41
  temporality: Metrics.TemporalityPreference
42
42
  startTimes: Map<string, HrTime>
43
43
  startTimeNanos: HrTime
@@ -49,11 +49,11 @@ export class MetricProducerImpl implements MetricProducer {
49
49
 
50
50
  constructor(
51
51
  resource: Resources.Resource,
52
- services: ServiceMap.ServiceMap<never>,
52
+ context: Context.Context<never>,
53
53
  temporality: Metrics.TemporalityPreference = "cumulative"
54
54
  ) {
55
55
  this.resource = resource
56
- this.services = services
56
+ this.context = context
57
57
  this.temporality = temporality
58
58
  this.startTimes = new Map()
59
59
  this.startTimeNanos = currentHrTime()
@@ -73,7 +73,7 @@ export class MetricProducerImpl implements MetricProducer {
73
73
  }
74
74
 
75
75
  collect(_options?: MetricCollectOptions): Promise<CollectionResult> {
76
- const snapshot = Metric.snapshotUnsafe(this.services)
76
+ const snapshot = Metric.snapshotUnsafe(this.context)
77
77
  const hrTimeNow = currentHrTime()
78
78
  const metricData: Array<MetricData> = []
79
79
  const metricDataByName = new Map<string, MetricData>()
@@ -111,7 +111,7 @@ export class MetricProducerImpl implements MetricProducer {
111
111
  if (typeof currentCount === "bigint" && typeof previousCount === "bigint") {
112
112
  reportValue = currentCount - previousCount
113
113
  // Handle reset: if current < previous, report current value
114
- if (reportValue < 0n) {
114
+ if (reportValue < BigInt(0)) {
115
115
  reportValue = currentCount
116
116
  }
117
117
  } else {