You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -131,6 +133,7 @@ A more detailed specification of the features can be found in [Dynatrace OneAgen
131
133
|Set result data on SQL database requests |>=1.1.0 |
132
134
|Set custom request attributes |>=1.2.0 |
133
135
|Trace Messaging |>=1.3.0 |
136
+
|Metrics (preview only) |>=1.4.0 |
134
137
135
138
### Trace incoming and outgoing remote calls
136
139
@@ -297,7 +300,7 @@ If the specific information like host/socketPath/... is not available, the prope
297
300
298
301
The result of `traceIncomingMessage()` is a tracer object to be used for further operations related to this trace (see [Tracers](#tracers) for details).
299
302
300
-
Besides the common APIs for outgoing tracers this tracer offers the additional methods `setVendorMessageId()` and `setCorrelationId()` which may be used to set more details about the message sent. Both APIs receive a `string` as parameter to pass the `correlationId` or `vendorMessageId` provided by messaging system.
303
+
Besides the common APIs for incoming tracers this tracer offers the additional methods `setVendorMessageId()` and `setCorrelationId()` which may be used to set more details about the message sent. Both APIs receive a `string` as parameter to pass the `correlationId` or `vendorMessageId` provided by messaging system.
301
304
302
305
**Example (see [MessagingSample.js](samples/Messaging/MessagingSample.js) for more details):**
**The metrics API is currently part of a preview program and will not work for users outside of the preview program. Visit [Dynatrace Help](https://www.dynatrace.com/support/help/whats-new/preview-and-early-adopter-releases/) for details.**
415
+
416
+
The SDK supports two **metric value types**: `Integer` and `Float` (double precision floating point).
417
+
You should prefer integer metrics as they are more efficient, unless the loss of precision is unacceptable (but
418
+
consider using a different unit, e.g. integer microseconds instead of floating point seconds).
419
+
420
+
There are these different **kinds of metrics**:
421
+
422
+
***Counter**: For all metrics that are counting something like sent/received bytes to/from network.
423
+
Counters should only be used when tracking things in flow, as opposed to state. It reports the `sum`
424
+
only and is the most lightweight metric kind.
425
+
***Gauge**: For metrics that periodically sample a current state, e.g. temperatures, total number
426
+
of bytes stored on a disk. Gauges report a `min`, `max` and `average` value (but no `sum`).
427
+
***Statistics**: For event-driven metrics like the packet size of a network interface. The most
428
+
heavyweight metric. Reports `min`, `max`, `average` and `count`.
429
+
430
+
Each combination of metric value type and kind has its own create-function, named `create<ValueType><MetricKind>Metric`.
431
+
432
+
When creating a metric following information needs to be provided:
433
+
434
+
*`metricName` Mandatory - a string identifying the metric. Maximum size is 100 bytes.
435
+
Although it is not recommended, you may create multiple metric instances with the same name, as long as you use the same creation function (metric value type and kind are the same) and the same options.
436
+
Otherwise, using the same metric name multiple times is an error. All metrics with the same name will be aggregated together as if you used only one metric instance.
437
+
438
+
*`MetricOptions` Optional - an `object` with following properties:
439
+
*`unit` Optional - a string that will be displayed when browsing for metrics in the Dynatrace UI.
440
+
*`dimensionName` Optional - a `string` specifying the name of the dimension added to the metric.
441
+
If a name is given here it's required to set a dimension value during booking samples on the metric. A dimension is like an additional label attached to values, for example a "disk.written.bytes" metric could have a dimension name of "disk-id" and when adding values to it a dimension value would be "/dev/sda1".
442
+
443
+
**Example (see [MetricsSample.js](samples/Metrics/MetricsSample.js) for more details):**
0 commit comments