-
Notifications
You must be signed in to change notification settings - Fork 896
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
Aggregating async Counter with Views dropping some attribute #1874
Comments
Discussed during the 8/19 Metrics SIG meeting, the answer is 2. |
@victlu will follow up by putting a concrete example, if it turned out that we need to clarify the spec, we will turn this into a spec issue (rather than a question). |
SetupUsing an Asynchronous Counter instrument. A View configured with:
Report at T0:
Report at T1 from one callback:
Report at T2 from one callback:
Report at T3 from one callback:
Expected AnswerCollect after T1:
Collect after T2:
Collect after T3:
Because we, as instrumenter, know the total for "Get" is based on Currently, there is no way for SDK to know this fact. So, what do we do with the A possible approachCollect after T1:
Collect after T2:
Collect after T3:
We now have all the data in the "slices" of the total "pie". We can decide (SDK or downstream) what labels constitute the total,
This method can be extended to any number of label combination. ProblemThe current spec does not offer any clarification on this topic. My thoughts for solution to this problem are:
|
Based on SIG discussion on 8/24/2021, the guidance should be:
|
From Prometheus docs, this is summarized with an example that I like:
|
@cijothomas OK to resolve this issue? |
Yes! thank you. |
Lets say I have a AsyncCounter (requestCountAsync).
At time T1, its callback reported the following measurements
we export the following:
{{requestCountAsync{Verb="Get", success=true, "Sum:100", Temporality=Cumulative, {T0}, T1}}}
{{requestCountAsync{Verb="Get", success=false, "Sum:5", Temporality=Cumulative, {T0}, T1}}}
At T1+1
we export the following:
{{requestCountAsync{Verb="Get", success=true, "Sum:120", Temporality=Cumulative, {T0}, T1+1}}}
{{requestCountAsync{Verb="Get", success=false, "Sum:7", Temporality=Cumulative, {T0}, T1+1}}}
At T1+2
we export the following:
{{requestCountAsync{Verb="Get", success=true, "Sum:150", Temporality=Cumulative, {T0}, T1+2}}}
{{requestCountAsync{Verb="Get", success=false, "Sum:10", Temporality=Cumulative, {T0}, T1+2}}}
and so on.
Now I configured my SDK to have a View, which says "only pick "Verb" as an attribute, and drop everything else.
Repeating the same application:
At time T1, its callback reported the following measurements
What should we export?
{{requestCountAsync{Verb="Get", "Sum:5", Temporality=Cumulative, {T0}, T1}}}
OR
{{requestCountAsync{Verb="Get", "Sum:105", Temporality=Cumulative, {T0}, T1}}}
(Note: This is the "truth", as my web server has 105 requests total until now)
OR
This is undefined and upto languages..
The text was updated successfully, but these errors were encountered: