feat: add status label#624
Conversation
Codecov Report
@@ Coverage Diff @@
## master #624 +/- ##
==========================================
- Coverage 92.31% 92.22% -0.09%
==========================================
Files 177 183 +6
Lines 8728 9118 +390
Branches 758 798 +40
==========================================
+ Hits 8057 8409 +352
- Misses 671 709 +38
|
|
Actually something is wrong, requests that should be Please do not merge. returns a counts it as a |
dyladan
left a comment
There was a problem hiding this comment.
If you are going to modify the getting started code, make sure you add a line in the guide itself explaining why.
Will do! Any idea as to why every status label gets a 200 value despite of actual response status code? |
|
Could you please add some description explaining why is this needed ? |
Yes, my mistake, initial post updated now. |
Yes. The issue is that this middleware is too early in the process and the response code has not been set yet. The default is 200. |
Hmm I was suspecting something of the sort, thanks for confirming. Is there an easy approach to get the actual response code? |
Not really an "easy" approach. |
|
Ah shucks, ok then. Thanks! |
|
Maybe you could use the |
|
I'll look into that as being able to count the # of errored requests will probably be something most users want. |
Add getIdGeneratorFromConfiguration helper in sdk-node that maps the config model's tracer_provider.id_generator to an SDK IdGenerator instance. Currently only `random` is supported per the spec; unknown types warn and fall back to the SDK default (RandomIdGenerator). Export IdGenerator as IdGeneratorConfigModel from the configuration package so downstream consumers can reference the type. Based on mike/bump-config-schema-prometheus-rename which bumps the schema to a SHA on main that includes IdGenerator (open-telemetry#624 upstream). Closes open-telemetry#6616 Assisted-by: Claude Opus 4.6
Add getIdGeneratorFromConfiguration helper in sdk-node that maps the config model's tracer_provider.id_generator to an SDK IdGenerator instance. Currently only `random` is supported per the spec; unknown types warn and fall back to the SDK default (RandomIdGenerator). Export IdGenerator as IdGeneratorConfigModel from the configuration package so downstream consumers can reference the type. Based on mike/bump-config-schema-prometheus-rename which bumps the schema to a SHA on main that includes IdGenerator (open-telemetry#624 upstream). Closes open-telemetry#6616 Assisted-by: Claude Opus 4.6
Add getIdGeneratorFromConfiguration helper in sdk-node that maps the config model's tracer_provider.id_generator to an SDK IdGenerator instance. Currently only `random` is supported per the spec; unknown types warn and fall back to the SDK default (RandomIdGenerator). Export IdGenerator as IdGeneratorConfigModel from the configuration package so downstream consumers can reference the type. Based on mike/bump-config-schema-prometheus-rename which bumps the schema to a SHA on main that includes IdGenerator (open-telemetry#624 upstream). Closes open-telemetry#6616 Assisted-by: Claude Opus 4.6
Which problem is this PR solving?
To help users getting started to have a status label for requests when using metrics. This is a very useful label to have when counting requests as to calculate error ratios.
ref.: https://landing.google.com/sre/workbook/chapters/alerting-on-slos/
Short description of the changes
statuslabel that comes fromres.statusCodeto all counted requests