@@ -46,13 +46,13 @@ $ java -Dotel.jmx.groovy.script=./script.groovy -jar opentelemetry-java-contrib-
4646// Query the target JMX server for the desired MBean and create a helper representing the first result
4747def loadMBean = otel.mbean("io.example.service:type=MyType,name=Load")
4848
49- // Create a LongValueObserver whose updater will set the instrument value to the
49+ // Create a LongValueCallback which will set the instrument value to the
5050// loadMBean's most recent `Count` attribute's long value. The instrument will have a
5151// name of "my.type.load" and the specified description and unit, respectively.
5252otel.instrument(
5353 loadMBean, "my.type.load",
5454 "Load, in bytes, of the service of MyType",
55- "By", "Count", otel.&longValueObserver
55+ "By", "Count", otel.&longValueCallback
5656)
5757```
5858
@@ -135,9 +135,9 @@ mutually exclusive with `otel.jmx.groovy.script`. The currently supported target
135135
136136- ` otel.longUpDownCounter(String name, String description, String unit) `
137137
138- - ` otel.doubleValueRecorder (String name, String description, String unit) `
138+ - ` otel.doubleHistogram (String name, String description, String unit) `
139139
140- - ` otel.longValueRecorder (String name, String description, String unit) `
140+ - ` otel.longHistogram (String name, String description, String unit) `
141141
142142These methods will return a new or previously registered instance of the applicable metric
143143instruments. Each one provides three additional signatures where unit and description
@@ -149,17 +149,17 @@ aren't desired upon invocation.
149149
150150### OpenTelemetry Asynchronous Instrument Helpers
151151
152- - ` otel.doubleSumObserver (String name, String description, String unit, Closure updater) `
152+ - ` otel.doubleCounterCallback (String name, String description, String unit, Closure updater) `
153153
154- - ` otel.longSumObserver (String name, String description, String unit, Closure updater) `
154+ - ` otel.longCounterCallback (String name, String description, String unit, Closure updater) `
155155
156- - ` otel.doubleUpDownSumObserver (String name, String description, String unit, Closure updater) `
156+ - ` otel.doubleUpDownCounterCallback (String name, String description, String unit, Closure updater) `
157157
158- - ` otel.longUpDownSumObserver (String name, String description, String unit, Closure updater) `
158+ - ` otel.longUpDownCounterCallback (String name, String description, String unit, Closure updater) `
159159
160- - ` otel.doubleValueObserver (String name, String description, String unit, Closure updater) `
160+ - ` otel.doubleValueCallback (String name, String description, String unit, Closure updater) `
161161
162- - ` otel.longValueObserver (String name, String description, String unit, Closure updater) `
162+ - ` otel.longValueCallback (String name, String description, String unit, Closure updater) `
163163
164164These methods will return a new or previously registered instance of the applicable metric
165165instruments. Each one provides two additional signatures where unit and description aren't
@@ -169,15 +169,15 @@ desired upon invocation.
169169
170170- ` otel.<meterMethod>(String name, Closure updater) ` - ` description ` is empty string and ` unit ` is "1".
171171
172- Though asynchronous instrument updaters are exclusively set by their builders in the OpenTelemetry API,
172+ Though asynchronous instrument callbacks are exclusively set by their builders in the OpenTelemetry API,
173173the JMX Metric Gatherer asynchronous instrument helpers allow using the specified updater Closure for
174174each instrument as run on the desired interval:
175175
176176``` groovy
177177def loadMBean = otel.mbean("io.example.service:type=MyType,name=Load")
178- otel.longValueObserver (
178+ otel.longValueCallback (
179179 "my.type.load", "Load, in bytes, of the service of MyType", "By",
180- { longResult -> longResult .observe(storageLoadMBean.getAttribute("Count")) }
180+ { measurement -> measurement .observe(storageLoadMBean.getAttribute("Count")) }
181181)
182182```
183183
0 commit comments