25
25
hostCPUModelAndFamilyAsStringID = "processor.resourcedetection.hostCPUModelAndFamilyAsString"
26
26
hostCPUModelAndFamilyAsStringFeatureGate = featuregate .GlobalRegistry ().MustRegister (
27
27
hostCPUModelAndFamilyAsStringID ,
28
- featuregate .StageAlpha ,
28
+ featuregate .StageBeta ,
29
29
featuregate .WithRegisterDescription ("Change type of host.cpu.model.id and host.cpu.model.family to string." ),
30
30
featuregate .WithRegisterFromVersion ("v0.89.0" ),
31
31
featuregate .WithRegisterReferenceURL ("https://github.com/open-telemetry/semantic-conventions/issues/495" ),
@@ -160,13 +160,13 @@ func setHostCPUInfo(d *Detector, cpuInfo cpu.InfoStat) error {
160
160
d .logger .Debug ("getting host's cpuinfo" , zap .String ("coreID" , cpuInfo .CoreID ))
161
161
d .rb .SetHostCPUVendorID (cpuInfo .VendorID )
162
162
if hostCPUModelAndFamilyAsStringFeatureGate .IsEnabled () {
163
- d .rb .SetHostCPUFamily (cpuInfo .Family )
164
- } else {
165
163
// https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/29025
166
- d .logger .Warn ("This attribute will change from int to string. Switch now using the feature gate." ,
164
+ d .logger .Info ("This attribute changed from int to string. Temporarily switch back to int using the feature gate." ,
167
165
zap .String ("attribute" , "host.cpu.family" ),
168
166
zap .String ("feature gate" , hostCPUModelAndFamilyAsStringID ),
169
167
)
168
+ d .rb .SetHostCPUFamily (cpuInfo .Family )
169
+ } else {
170
170
family , err := strconv .ParseInt (cpuInfo .Family , 10 , 64 )
171
171
if err != nil {
172
172
return fmt .Errorf ("failed to convert cpuinfo family to integer: %w" , err )
@@ -179,13 +179,13 @@ func setHostCPUInfo(d *Detector, cpuInfo cpu.InfoStat) error {
179
179
// ISSUE: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27675
180
180
if cpuInfo .Model != "" {
181
181
if hostCPUModelAndFamilyAsStringFeatureGate .IsEnabled () {
182
- d .rb .SetHostCPUModelID (cpuInfo .Model )
183
- } else {
184
182
// https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/29025
185
- d .logger .Warn ("This attribute will change from int to string. Switch now using the feature gate." ,
183
+ d .logger .Info ("This attribute changed from int to string. Temporarily switch back to int using the feature gate." ,
186
184
zap .String ("attribute" , "host.cpu.model.id" ),
187
185
zap .String ("feature gate" , hostCPUModelAndFamilyAsStringID ),
188
186
)
187
+ d .rb .SetHostCPUModelID (cpuInfo .Model )
188
+ } else {
189
189
model , err := strconv .ParseInt (cpuInfo .Model , 10 , 64 )
190
190
if err != nil {
191
191
return fmt .Errorf ("failed to convert cpuinfo model to integer: %w" , err )
0 commit comments