This repository was archived by the owner on Oct 3, 2023. It is now read-only.
Metrics: Add specs on Gauge APIs#248
Open
mayurkale22 wants to merge 8 commits intocensus-instrumentation:masterfrom
Open
Metrics: Add specs on Gauge APIs#248mayurkale22 wants to merge 8 commits intocensus-instrumentation:masterfrom
mayurkale22 wants to merge 8 commits intocensus-instrumentation:masterfrom
Conversation
songy23
reviewed
Mar 14, 2019
bogdandrutu
reviewed
Mar 15, 2019
e4b773d to
be2cd5e
Compare
songy23
reviewed
Mar 18, 2019
|
|
||
| ## Derived Gauge API | ||
|
|
||
| The value that is published for gauges is an instantaneous measurement of an `int64` or `double` value. This gauge is self sufficient once created, so users should never need to interact with it. The value of the gauge is observed from the `object` and a `callback function`. The callback function is invoked whenever metrics are collected, meaning the reported value is up-to-date. The implementation should keep a `WeakReference` to the object and it is the user's responsibility to manage the lifetime of the object. |
Member
There was a problem hiding this comment.
this should explain behavior of a derived gauge in case when object was garbage collected since it's talking about WeakReference.
Member
Author
There was a problem hiding this comment.
This is the language (in this case Java) specific details, removed from the specs.
Member
Author
|
@bogdandrutu @SergeyKanzhelev PTAL once you have time. |
|
|
||
| The following general operations MUST be provided by the API: | ||
| * Defining a `name`, `description`, `unit`, `labelKeys`, `resource` and `constantLabels` which are fixed labels that always apply to a gauge. This should give back the gauge object to get or create time series, remove time series and clear all time series. | ||
| * `name`: a string describing the name of the metric, e.g. "vm_cpu_cycles" or "queue_size". Names MUST be unique within the library. It is recommended to use names compatible with the intended end usage. |
There was a problem hiding this comment.
Any restriction on the formatting of a name?
Member
Author
There was a problem hiding this comment.
AFAIK there is no restriction on the length and it may contain any Unicode characters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #240