-
Notifications
You must be signed in to change notification settings - Fork 71
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
[FEATURE] Rename metrics name to comply with feature flag semconv #712
Comments
@thisthat @toddbaert @beeme1mr appreciate feedback on this proposal |
Great summary @Kavindu-Dodan - the proposal makes a lot of sense. However, OTel suggests adding |
Hi! Here are a few thoughts, mainly looking at the spec you linked above:
|
Thanks @pirgeo! I would prefer to use |
Sounds good! I neither found any guidance on the spec nor do I have a strong opinion on this one. |
Apart from what @pirgeo already mentioned, here are my suggestions: About the units: It's a bit hidden but there's some extra guidance here: https://github.com/open-telemetry/semantic-conventions/blob/main/specification/metrics/semantic_conventions/README.md#instrument-units
If you want to capture more meaning, you could use
Is there a reason why the metric changed to "request_time"? I think the old name actually aligned better with the current HTTP semconv, such as http.server.duration. |
@thisthat @pirgeo @beeme1mr & @joaopgrassi for the feedback Thank you very much for taking the time to give your opinions.
Thank you for this input
Should be an oversight and the original description is meant to be changed.
Good point. I assume this allows us to remove the To summarise, can we agree on the following updated proposal? A new addition to the common rule,
And updated metrics chart,
Let me know your thoughts and if we agree, I will update the issue description and continue with the implementation. |
Are the metrics |
Just for clarification: Do Will the Finally: What are the Otel datatypes of these? I assume histograms for the first two, and counts for the last two? Both of these should only ever go up, I assume. |
Same for the other (depending on how you address @pirgeo comment above) About the |
No, this correlates to the flag evaluation time of flagd & the size of the payload of the evaluation And regarding
Yes, this is correct. http dureation & response size use histograms and reason & impression use counters
Thank you, I will update my proposal
Good suggesion, are you proposing to use [1] - https://github.com/open-feature/spec/blob/main/specification/types.md#resolution-details |
Ah no, I'm proposing that Flagd re-uses the HTTP metrics defined in https://github.com/open-telemetry/semantic-conventions/blob/main/specification/metrics/semantic_conventions/http-metrics.md#semantic-conventions-for-http-metrics. Not sure if that would be Essentially then you end up with only flagd specifc metrics such as |
Wouldn't this create metric name conflicts at OTel backend (ex:- Prometheus) 🤔 Or do they differentiate metrics based on service naming and other attributes ? |
When converting from OTLP to Prometheus, the spec offers guidance that should help in this case. Instrumentation scope and version become labels while resource attributes (e.g., So it should work just as fine - they will split by say instrumentation scope = flagd and get the metrics they are after. @pirgeo maybe you have more input here, in case I missed something? For Dynatrace for example, instrumentation scope+version and a few resource attributes (like |
@joaopgrassi thank you for the explanation. I think my doubt is clear and I learned a few more OTel details thanks to this discussion. For the reference of others, With this agreement and understanding, let's agree on the following metric naming & unit changes,
[1] - https://opentelemetry.io/docs/specs/otel/glossary/#instrumentation-scope |
## This PR Fixes #712 Refer the following table for metrics renames and their units, | Old | New | Unit | |---|---|---| | http_request_duration_seconds | http.server.duration | s | | http_response_size_bytes | http.server.response.size | By | | http_requests_inflight |http.server.active_requests | {request} | | impressions | feature_flag.flagd.impression| {impression} | | reasons | feature_flag.flagd.evaluation.reason| {reason} | ### Validation This change was validated against an OTel setup. Consider following screen captures, ![Screenshot 2023-07-04 at 1 16 02 PM](https://github.com/open-feature/flagd/assets/8186721/5aba3103-e3fc-42a7-a396-c78999d22b05) ![Screenshot 2023-07-04 at 1 15 41 PM](https://github.com/open-feature/flagd/assets/8186721/0ea196f8-fcb4-4e8c-86eb-c6774de3e2f3) ![Screenshot 2023-07-04 at 1 14 53 PM](https://github.com/open-feature/flagd/assets/8186721/c285d78d-525a-4e40-bfe2-895a85d96cd6) ![Screenshot 2023-07-04 at 1 14 40 PM](https://github.com/open-feature/flagd/assets/8186721/e826ed8c-6056-4fd4-b206-d76592d8d484) ![Screenshot 2023-07-04 at 1 14 18 PM](https://github.com/open-feature/flagd/assets/8186721/30c959af-197b-405c-b303-c4dd59807311) Signed-off-by: Kavindu Dodanduwa <[email protected]>
Requirements
Background
flagd comes with out of the box metrics support [1]. It currently expose the following metric names,
While these metrics serve a good purpose, the names do not comply with semantic conventions. For comparison, see how metrics are named for the metrics hook [2] (ex:- feature_flag.evaluation_requests_total, feature_flag.evaluation_success_total)
Proposal (updated 27/06/2023)
This issue focuses on renaming flagd metrics to comply with semantic conventions.
Common rules
flagd
feature_flag
prefix so that monitoring systems can aggregate feature flag related metricsflagd
phrase so that it is clear the metric belongs to flagd systemWith this background, consider the following proposals,
[1] - https://github.com/open-feature/flagd/blob/main/core/pkg/telemetry/metrics.go
[2] - https://github.com/open-feature/go-sdk-contrib/blob/main/hooks/open-telemetry/README.md#metric-hook
[3] - https://github.com/open-telemetry/semantic-conventions/blob/bef5a68c2f580e48334bfb2a118345808b2e2125/specification/metrics/semantic_conventions/http-metrics.md#metric-httpserverduration
[4] - https://github.com/open-telemetry/semantic-conventions/blob/bef5a68c2f580e48334bfb2a118345808b2e2125/specification/metrics/semantic_conventions/http-metrics.md#metric-httpserverrequestsize
[5] - https://github.com/open-telemetry/semantic-conventions/tree/bef5a68c2f580e48334bfb2a118345808b2e2125/specification/metrics/semantic_conventions#pluralization
The text was updated successfully, but these errors were encountered: