mirror of
https://github.com/google/nomulus.git
synced 2025-05-20 11:19:35 +02:00
Enforce very basic URL-like metric names
This change enforces URL-like metric names to match the behavior of Stackdriver. The StackdriverWriter no longer prepends a slash, which was a crutch. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130537347
This commit is contained in:
parent
b45c2ca2ee
commit
564bbdef83
2 changed files with 3 additions and 2 deletions
|
@ -45,7 +45,8 @@ public abstract class MetricSchema {
|
|||
checkArgument(!name.isEmpty(), "Name must not be blank");
|
||||
checkArgument(!description.isEmpty(), "Description must not be blank");
|
||||
checkArgument(!valueDisplayName.isEmpty(), "Value Display Name must not be empty");
|
||||
// TODO: strengthen metric name validation.
|
||||
checkArgument(name.startsWith("/"), "Name must be URL-like and start with a '/'");
|
||||
// TODO(b/30916431): strengthen metric name validation.
|
||||
|
||||
return new AutoValue_MetricSchema(name, description, valueDisplayName, kind, labels);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue