-
Notifications
You must be signed in to change notification settings - Fork 4k
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
LogGroup#extractMetric doesn't support '/' character or tokens/derived metric namespace or names. #1351
Comments
Interesting. there's an attempt of extractMetric to use the namespace as a construct name, but if the name includes a token, this whole idea kind of fails. |
I expected the namespace to be static while writing this, like |
Apparently the namespace in @sam-goodwin's case is not static. Even though, we should protect ourselves by checking if |
It also doesn't support static namespaces with a |
Agreed on both of those. |
What I ended up doing is basically allow "/"s to be included in construct IDs, but they are mangled to "--" as soon as the construct is created. I think in most cases that won't be horribly surprising or problematic because it's quite rare for people to actually want to find constructs by their ID. In the rare case, I've added some documentation to that effect. |
Relax construct ID constraints to allow "/" (path seprator) to be used in construct IDs, but convert it to "--" so it won't collide with path strings. It's quite rare for people to actually try to find a construct by their ID (it's mostly "write-only") and the logical ID is eventually mangled anyway when synthesized to CFN. Fails if the construct ID contains a token. This won't work because we mangle the IDs as strings when we generate the logical ID and the construct's unique ID, and stringified tokens won't be resolved. Fixes #1351 Fixes #1374
…1375) Relax construct ID constraints to allow "/" (path seprator) to be used in construct IDs, but convert it to "--" so it won't collide with path strings. It's quite rare for people to actually try to find a construct by their ID (it's mostly "write-only") and the logical ID is eventually mangled anyway when synthesized to CFN. Fails if the construct ID contains a token. This won't work because we mangle the IDs as strings when we generate the logical ID and the construct's unique ID, and stringified tokens won't be resolved. Fixes #1351 Fixes #1374
LogGroup.extractMetric includes the metric namespace and name in the underlying construct name. This prohibits valid namespaces such as those that contain a
/
, or any derived token values such as function names etc.Throws error:
The text was updated successfully, but these errors were encountered: