Skip to content
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

Metadata autogenerate creates invalid name when metrics attributes has a period #6896

Closed
JonathanWamsley opened this issue Dec 17, 2021 · 2 comments · Fixed by #6905
Closed
Labels
bug Something isn't working

Comments

@JonathanWamsley
Copy link
Contributor

Describe the bug
Unable to successfully autogenerate valid metadata using the //go:generate mdatagen --experimental-gen metadata.yaml tag in a codegen.go file. An invalid string name is created when a metrics attributes has a period within it (i.e. attributes: [ http.method ]) in the metadata.yaml file.

Steps to reproduce
Add a metric with an attribute with a period in a metadata.yaml file. Include a codegen.go file with the //go:generate mdatagen --experimental-gen metadata.yaml tag. Run make generate
Screen Shot 2021-12-17 at 1 58 20 PM

What did you expect to see?
No error.

What did you see instead?
An error
Screen Shot 2021-12-17 at 1 54 38 PM
Which led me to examine the generated file.

A generated function with an invalid string name http.methodAttributeValue string
Screen Shot 2021-12-17 at 1 42 48 PM

What version did you use?
Version: v0.41.0

What config did you use?
Config: metadata.yaml

Environment
MacOS

@JonathanWamsley JonathanWamsley added the bug Something isn't working label Dec 17, 2021
@JonathanWamsley
Copy link
Contributor Author

@dmitryax I noticed this while responding to your comment on my pr #6878 (review)

@dmitryax
Copy link
Member

Hi @JonathanWamsley, thank for reporting. Nice catch! Let me fix the builder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants