Skip to content

Commit e9a73ad

Browse files
author
Anuraag Agrawal
authored
Update jmx metrics README for 1.5 (#74)
1 parent efc9952 commit e9a73ad

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

jmx-metrics/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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
4747
def 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.
5252
otel.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

142142
These methods will return a new or previously registered instance of the applicable metric
143143
instruments. 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

164164
These methods will return a new or previously registered instance of the applicable metric
165165
instruments. 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,
173173
the JMX Metric Gatherer asynchronous instrument helpers allow using the specified updater Closure for
174174
each instrument as run on the desired interval:
175175

176176
```groovy
177177
def 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

Comments
 (0)