googleinterns / cloud-operations-api-mock

Apache License 2.0
5 stars 2 forks source link

Display name validation is misleading #56

Open nilebox opened 3 years ago

nilebox commented 3 years ago

There are a few issues with the display name validation:

  1. Display name must be prefixed with opentelemetry/ according to the regex https://github.com/googleinterns/cloud-operations-api-mock/blob/e8bcc34f971a612c9e598ce4c66c192448c7dac6/internal/validation/mock_metric_validation.go#L48 Why do we check for this? This is not documented in go/ot-gcp-requirements

  2. When display name doesn't match the regex mentioned above, mock server returns the error "displayName has max length of 128 bytes" (see https://github.com/googleinterns/cloud-operations-api-mock/blob/7216ea71824fc5232bfac8f328a11ed31724c0db/internal/validation/statuses.go#L40-L41), which is super misleading: we don't even check for the string length, and should have specified in the error that we expected it to be prefixed with opentelemetry/ or something more user friendly.

aabmass commented 3 years ago

I noticed the same