Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Metrics prototype scenario #146

Merged
merged 20 commits into from
Feb 25, 2021
Merged

Metrics prototype scenario #146

merged 20 commits into from
Feb 25, 2021

Conversation

reyang
Copy link
Member

@reyang reyang commented Feb 18, 2021

Follow up on the 02/11/2021 #108 Metrics API/SDK SIG Mtg, I've created this OTEP which has described two scenarios for the metrics prototyping work.

The actual prototype will be submitted as PR(s) to the language client repo, for example:

@reyang reyang marked this pull request as ready for review February 18, 2021 04:58

The application owner (developer Y) would only want the following metrics:

* [System CPU Usage](#system-cpu-usage) reported every 5 seconds
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this is something we want in initial stage, but i'd like to add a requirement of same metric being reported with different interval, potentially with diff. dimensions.
For example, the app owner wants to see HTTP Server Duration metric exported every 1 second with only HttpStatusCode dimension, and HTTP Server Duration metric exported every 30 seconds with dimensions {hostname, HTTP Method, Host, Status Code, Client Type}. The former is typically used for near-real-time dashboards, and the latter for more permanent storage.

Copy link
Member Author

Choose a reason for hiding this comment

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

In your example - I guess normally people would only report the 1 second one from the SDK pre-aggregation, and rely on the metrics backend to aggregate the 30 seconds one (and daily/weekly/monthly summary if there is a need).

* HTTP request counters, reported every 5 seconds:
* Total number of received HTTP requests
* Total number of finished HTTP requests
* Number of currently-in-flight HTTP requests (concurrent HTTP requests)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like how this example asks for three counters, because it seems possible to achieve with two instruments: a count of received requests and a histogram of response durations (i.e., seems to call for either a view or a 3rd instrument).

Copy link
Member Author

Choose a reason for hiding this comment

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

And it might affect the semantic convention open-telemetry/opentelemetry-specification#1378 (comment).

Copy link
Contributor

Choose a reason for hiding this comment

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

store.process_order("customerA", {"tomato": 1})
```

When the store is closed, we will report the following metrics:
Copy link
Contributor

Choose a reason for hiding this comment

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

I see (1) and (2) as good use-cases for monitoring using a metrics API, but maybe not (3). Although the example feels like it fell out of a textbook, you could re-imagine the store as a Message-Queue consumer processing orders in a horizontally scalable store. Can we ask another form of query: "how many stores were in operation at a given time?"

The application owner (developer Y) would only want the following metrics:

* Server temperature - reported every 5 seconds
* Server humidity - reported every minute
Copy link

Choose a reason for hiding this comment

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

AFAIK, we need to have multiple "pipelines" for different configurations. This may include...

  • Reporting period which is related to Collection rate, Export rate, etc...
  • Selection / grouping of desired metrics for this pipeline

Copy link
Contributor

Choose a reason for hiding this comment

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

These are all SDK configuration topics, to me. The use-cases in this document are about how code is instrumented, I think, and what the API looks like.

OpenCensus had a programmatic API for configuring the kinds of variables you mentioned. I'm not sure if a programmatic API or a configuration file is what user's want, but I'd argue to keep this setup out of the instrumentation API.

Copy link
Contributor

@jsuereth jsuereth left a comment

Choose a reason for hiding this comment

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

My main comment, thinking deeper on this, is whether or not "external annotation" needs to be called out specifically as a non-goal.

Specifically, should we call out a use case where an DevOps wants to add metric labels POST DEVELOPMENT to the API. I think this is an SDK concern and should be called out there (e.g. how you can add annotations to Resource via ENV, which would then influence metrics), but I think the scenarios listed here are sufficient for API discussions.

Copy link

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @reyang!

@jmacd
Copy link
Contributor

jmacd commented Feb 25, 2021

I reviewed the open comments and believe that @reyang has addressed them all. Thank you!

@jmacd jmacd merged commit c187e32 into open-telemetry:main Feb 25, 2021
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
* metrics prototype scenario

* rename

* fix typo

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* clarify GA/stable

* add example to exemplar

* adjust the proposed timeline considering most folks will be on vacation in Dec.

* fix nits

* adjust the ToC

* fix nits

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Leighton Chen <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Leighton Chen <[email protected]>

* adjust wording

* fix typo

* address review comment

* address comments

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

Co-authored-by: Cijo Thomas <[email protected]>
Co-authored-by: Leighton Chen <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
* metrics prototype scenario

* rename

* fix typo

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* clarify GA/stable

* add example to exemplar

* adjust the proposed timeline considering most folks will be on vacation in Dec.

* fix nits

* adjust the ToC

* fix nits

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Leighton Chen <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Leighton Chen <[email protected]>

* adjust wording

* fix typo

* address review comment

* address comments

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

Co-authored-by: Cijo Thomas <[email protected]>
Co-authored-by: Leighton Chen <[email protected]>
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 30, 2024
* metrics prototype scenario

* rename

* fix typo

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* clarify GA/stable

* add example to exemplar

* adjust the proposed timeline considering most folks will be on vacation in Dec.

* fix nits

* adjust the ToC

* fix nits

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Leighton Chen <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Leighton Chen <[email protected]>

* adjust wording

* fix typo

* address review comment

* address comments

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

Co-authored-by: Cijo Thomas <[email protected]>
Co-authored-by: Leighton Chen <[email protected]>
carlosalberto pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Nov 8, 2024
* metrics prototype scenario

* rename

* fix typo

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

* clarify GA/stable

* add example to exemplar

* adjust the proposed timeline considering most folks will be on vacation in Dec.

* fix nits

* adjust the ToC

* fix nits

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Leighton Chen <[email protected]>

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Leighton Chen <[email protected]>

* adjust wording

* fix typo

* address review comment

* address comments

* Update text/metrics/0146-metrics-prototype-scenarios.md

Co-authored-by: Cijo Thomas <[email protected]>

Co-authored-by: Cijo Thomas <[email protected]>
Co-authored-by: Leighton Chen <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants