-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api-metrics): async instruments spec compliance #2569
Changes from 3 commits
5fbb489
456f7f3
6b30d46
1f45e47
740ddc5
2063ccb
e996309
fa5c64c
0c3980d
d8a666b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,6 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
import { | ||
Observation, | ||
} from './Observation'; | ||
|
||
/** | ||
* Options needed for metric creation | ||
*/ | ||
|
@@ -112,13 +108,10 @@ export interface Histogram { | |
record(value: number, labels?: Labels): void; | ||
} | ||
|
||
// ObservableBase has to be an Object but for now there is no field or method | ||
// declared. | ||
/** Base interface for the Observable metrics. */ | ||
export interface ObservableBase { | ||
observation: ( | ||
value: number, | ||
labels?: Labels, | ||
) => Observation; | ||
} | ||
export type ObservableBase = Record<never, never>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It declares an object type, and it can be extended to have any keys. The reason I use |
||
|
||
/** Base interface for the ObservableGauge metrics. */ | ||
export type ObservableGauge = ObservableBase; | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does NoopMetric serve any purpose here or anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, the only use case can be
observable instanceof NoopMetric
. However, there are no API spec constraints on class hierarchy here, maybe we can remove it.