Commit 26c7166
api: add docstrings to core metrics instrument abstract methods (open-telemetry#4923)
* api: add docstrings to core metrics instrument abstract methods
Add missing docstrings to the abstract measurement methods on the four
core synchronous metric instruments:
- Counter.add – records a non-negative increment
- UpDownCounter.add – records a positive or negative delta
- Histogram.record – records an arbitrary statistical measurement
- Gauge.set – records the current (non-additive) value
Each docstring explains the intent of the method, any constraints on
the parameter, and documents all three parameters
(amount, attributes, context) using the existing Google-style format
already present in the codebase.
These methods are the primary interaction surface for developers using
the OpenTelemetry Metrics API; having no docstring on the abstract
definition makes generated API docs and IDE tooltips silent.
* Apply suggestion from @xrmx
* api: remove CHANGELOG entry per reviewer request
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci: retrigger CI checks
---------
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent c17ba89 commit 26c7166
File tree
1 file changed
+46
-4
lines changed- opentelemetry-api/src/opentelemetry/metrics/_internal
1 file changed
+46
-4
lines changedLines changed: 46 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
| |||
234 | 241 | | |
235 | 242 | | |
236 | 243 | | |
237 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
238 | 256 | | |
239 | 257 | | |
240 | 258 | | |
| |||
376 | 394 | | |
377 | 395 | | |
378 | 396 | | |
379 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
380 | 411 | | |
381 | 412 | | |
382 | 413 | | |
| |||
486 | 517 | | |
487 | 518 | | |
488 | 519 | | |
489 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
490 | 532 | | |
491 | 533 | | |
492 | 534 | | |
| |||
0 commit comments