Skip to content
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: Metrics API revision based on Specs and RFCs #259

Merged
merged 2 commits into from
Sep 13, 2019

Conversation

mayurkale22
Copy link
Member

@mayurkale22 mayurkale22 commented Sep 12, 2019

Which problem is this PR solving?

Short description of the changes

*/
export interface MetricOptions {
/** The description of the Metric. */
description?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be required?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so since this is different from name

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the spec description is an optional param and the default to "".

description?: string;

/** The unit of the Metric values. */
unit?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we specify the implied default unit if this is not specified? E.g. "count"? And should we specify canonical units for things like bytes, seconds, bytes/second, count/second, etc.?

Is there a formal spec for this? Should we adopt something like http://metrics20.org/spec/#tag-values-unit ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear(): void;

/**
* what should the callback signature be?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the signature is fine personally. But could you document what the callback does and when it gets called?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not 100% sure about this, @bg451 could you please handle this in your next PR?

* Creates and returns a new {@link Measure}.
* @param name the name of the metric.
* @param [options] the measure options.
*/
createMeasure(name: string, options?: MeasureOptions): Measure;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a stab at updates the other day, take a look at bg451#5. I think this should return Metric<MeasureHandle>, though I can apply the changes in a separate PR

Copy link
Member Author

@mayurkale22 mayurkale22 Sep 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bg451#5 lgtm, I will merge this one and wait for your PR for the next revision of metrics API (including counter -> cumulative).

export interface CounterTimeseries {
// Adds the given value to the current value. Values cannot be negative.
/** A Handle for Counter Metric. */
export interface CounterHandle {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to counter to cumulative

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, I thought we have decided to go with Counter instead of Cumulative

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool beans just saw the PR in the rfc section to change it back to counter

*/
export interface MetricOptions {
/** The description of the Metric. */
description?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so since this is different from name

@mayurkale22 mayurkale22 merged commit 12e0455 into open-telemetry:master Sep 13, 2019
@mayurkale22 mayurkale22 deleted the metrics_v2 branch September 13, 2019 21:46
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
…ore using it (open-telemetry#259)

* fix(plugin-document-load): check if
getEntriesByType is available before using it

* fix: lint

Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants