Skip to content

Commit

Permalink
[pdata] Update return value of pcommon.ValueType.String for ValueTypeStr
Browse files Browse the repository at this point in the history
Recently we updated all names related to pdata String value. It makes sense to update string returned by Value.String accordingly to avoid discrepancy with other value types
  • Loading branch information
dmitryax committed Oct 6, 2022
1 parent e0eea95 commit 964d308
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Delete deprecated `StringVal` and `SetStringVal` methods. (#6178)
- Delete deprecated `ValueTypeString` method. (#6178)
- Change AggregationTemporality.String to simpler, easier to read. (#6117)
- Update pcommon.ValueType.String to return "STR" for ValueTypeStr. (#6247)

### 🚩 Deprecations 🚩

Expand Down
4 changes: 2 additions & 2 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ With the modified configuration if you re-run the test above the log output shou
```
2020-11-11T04:08:17.344Z DEBUG loggingexporter/logging_exporter.go:353 ResourceSpans #0
Resource labels:
-> service.name: STRING(api)
-> service.name: STR(api)
ScopeSpans #0
Span #0
Trace ID : 5982fe77008310cc80f1da5e10147519
Expand All @@ -188,7 +188,7 @@ Span #0
Start time : 2018-01-24 08:16:15.726 +0000 UTC
End time : 2018-01-24 08:16:15.752 +0000 UTC
Attributes:
-> data.http_response_code: STRING(201)
-> data.http_response_code: STR(201)
```

### Health Check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestNestedMapSerializesCorrectly(t *testing.T) {
av.PutEmptyMap("zoo").PutInt("bar", 13)

expected := `{
-> foo: STRING(test)
-> foo: STR(test)
-> zoo: MAP({"bar":13})
}`

Expand Down
2 changes: 1 addition & 1 deletion pdata/pcommon/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (avt ValueType) String() string {
case ValueTypeEmpty:
return "EMPTY"
case ValueTypeStr:
return "STRING"
return "STR"
case ValueTypeBool:
return "BOOL"
case ValueTypeInt:
Expand Down
2 changes: 1 addition & 1 deletion pdata/pcommon/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestValue(t *testing.T) {

func TestValueType(t *testing.T) {
assert.EqualValues(t, "EMPTY", ValueTypeEmpty.String())
assert.EqualValues(t, "STRING", ValueTypeStr.String())
assert.EqualValues(t, "STR", ValueTypeStr.String())
assert.EqualValues(t, "BOOL", ValueTypeBool.String())
assert.EqualValues(t, "INT", ValueTypeInt.String())
assert.EqualValues(t, "DOUBLE", ValueTypeDouble.String())
Expand Down

0 comments on commit 964d308

Please sign in to comment.