diff --git a/CHANGELOG.md b/CHANGELOG.md index f5b6d94a15d..1d49b2394dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - The `fromEnv` detector no longer throws an error when `OTEL_RESOURCE_ATTRIBUTES` environment variable is not set or empty. (#2138) - Setting the global `ErrorHandler` with `"go.opentelemetry.io/otel".SetErrorHandler` multiple times is now supported. (#2160, #2140) +- The `"go.opentelemetry.io/otel/attribute".Any` function now supports `int32` values. (#2169) ### Security diff --git a/attribute/kv.go b/attribute/kv.go index 2fcc8863f73..20cc29924a8 100644 --- a/attribute/kv.go +++ b/attribute/kv.go @@ -92,9 +92,7 @@ func Any(k string, value interface{}) KeyValue { return Array(k, value) case reflect.Bool: return Bool(k, rv.Bool()) - case reflect.Int, reflect.Int8, reflect.Int16: - return Int(k, int(rv.Int())) - case reflect.Int64: + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return Int64(k, rv.Int()) case reflect.Float64: return Float64(k, rv.Float())