-
Notifications
You must be signed in to change notification settings - Fork 496
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
Move metric validation from api to sdk #1269
Move metric validation from api to sdk #1269
Conversation
83e10fc
to
5fa4c0b
Compare
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
5fa4c0b
to
75bb52e
Compare
if name.len() > 255 { | ||
return Err(MetricsError::InvalidInstrumentConfiguration( | ||
INSTRUMENT_NAME_LENGTH, | ||
)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why prefer a hardcoded 255
and a constant for the error string over a constant for the threshold value defined in the spec and a literal for the string?
* moved validation process for metrics instrument from api to sdk. * included hyphens in instrument names as valid values. * increase instrument name maximum length from 63 to 255 characters.
75bb52e
to
1c94f10
Compare
@shaun-cox @lalitb Thanks for the review! |
Not sure if I understand that. What error are you getting ? |
I have tried the following methods
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think it's worth the effort to format a constant string from another constant string. We keep them together and that should be good.
Thanks for working on it.
Changes
#1264
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes