-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
Component(s)
cmd/mdatagen
What happened?
Description
Defining an attribute in metadata.yaml with bytes type generates unit tests which do not compile. The schema defines bytes as a valid type for an attribute.
However, the unit tests tries to create byte arrays like:
mb.RecordMetric1(ts, bytes("attr1-val")However, I believe it should be:
mb.RecordMetric1(ts, []byte("attr1-val")Steps to Reproduce
Define an attribute in metadata.yaml as:
attributes:
attr1:
description: An attribute with type bytes
type: bytes
metrics:
metric1:
desciption: A metric
enabled: true
sum:
value_type: int
monotonic: true
unit: kg
attributes:
- attr1Expected Result
A compiling unit test
Actual Result
A not compiling unit test
Collector version
v0.90.0
Environment information
Environment
OS: Ubuntu v22.04
Compiler(if manually compiled): go 1.21.3 linux/amd64
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response