Skip to content

Conversation

@tigrannajaryan
Copy link
Member

@tigrannajaryan tigrannajaryan commented Jun 18, 2020

This is a breaking OTLP change.

  • Use AnyValue introduced in recent change to OTLP.
    Changes are encapsulated in AttributeValue and most of the codebase is
    unaffected, which proves the wrappers are very useful.

  • Rename AttributeKeyValue to KeyValue (the change comes from OTLP).

  • Use local protoc to compile ProtoBufs. Previously used znly/protoc
    docker image is outdated and results in incorrect code for gRPC-Gateway.

TODO:

  • Need to add support for ARRAY value type. This is not urgent since
    there are no known data sources that use the ARRAY type yet.

  • Use Gogoproto (gogoproto.nullable) = false annotation for AnyValue
    to possibly improve performance further.

@codecov
Copy link

codecov bot commented Jun 18, 2020

Codecov Report

Merging #1142 into master will decrease coverage by 0.01%.
The diff coverage is 93.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1142      +/-   ##
==========================================
- Coverage   87.49%   87.48%   -0.02%     
==========================================
  Files         202      202              
  Lines       14525    14641     +116     
==========================================
+ Hits        12709    12808      +99     
- Misses       1376     1388      +12     
- Partials      440      445       +5     
Impacted Files Coverage Δ
consumer/pdata/common.go 95.07% <90.90%> (-3.51%) ⬇️
internal/data/testdata/common.go 100.00% <100.00%> (ø)
internal/data/testdata/log.go 100.00% <100.00%> (ø)
internal/goldendataset/generator_commons.go 88.46% <100.00%> (-0.83%) ⬇️
internal/goldendataset/span_generator.go 98.85% <100.00%> (ø)
translator/internaldata/resource_to_oc.go 81.39% <100.00%> (+4.92%) ⬆️
exporter/fileexporter/file_exporter.go 70.08% <0.00%> (-1.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3253955...f75fb2f. Read the comment docs.

@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/anyvalue branch 4 times, most recently from e50951d to 211b5c9 Compare June 22, 2020 21:27
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/anyvalue branch 5 times, most recently from f84fbe7 to b746b29 Compare June 23, 2020 17:11
@tigrannajaryan tigrannajaryan changed the title [WIP] [DON'T REVIEW] Use AnyValue introduced in recent change to OTLP Update OTLP to v0.4.0 Jun 23, 2020
@tigrannajaryan tigrannajaryan changed the title Update OTLP to v0.4.0 Update OTLP to v0.4.0 [Breaking change] Jun 23, 2020
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/anyvalue branch from b746b29 to 2a20003 Compare June 23, 2020 17:15
@tigrannajaryan
Copy link
Member Author

@bogdandrutu please review especially the AttributeValue/AttributeMap changes.

@tigrannajaryan
Copy link
Member Author

@keitwb Body of logs proto can be now updated to AnyValue in a future PR.

@tigrannajaryan
Copy link
Member Author

@kbrockhoff there are some minor changes to golden data generator in this PR. You may want to review.

m.ForEach(func(k string, v pdata.AttributeValue) {
kvs = append(kvs, fmt.Sprintf("%q:%s", k, attributeValueToString(v, true)))
})
return "{" + strings.Join(kvs, ",") + "}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is there any need to worry about escaping , in the key or value or are these "JSON-like strings" not meant to be strictly parsed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Changed to strings.Builder.

  2. Escaping is handled correctly by %q formatter for the key and by recursive call to attributeValueToString for the values. Updated the tests to include backslash and double quote in the key and in the value.

This is a breaking OTLP change.

- Use AnyValue introduced in recent change to OTLP.
  Changes are encapsulated in AttributeValue and most of the codebase is
  unaffected, which proves the wrappers are very useful.

- Rename AttributeKeyValue to KeyValue (the change comes from OTLP).

- Use local protoc to compile ProtoBufs. Previously used znly/protoc
  docker image is outdated and results in incorrect code for gRPC-Gateway.

TODO:

- Need to add support for ARRAY value type. This is not urgent since
  there are no known data sources that use the ARRAY type yet.

- Use Gogoproto `(gogoproto.nullable) = false` annotation for AnyValue
  to possibly improve performance further.
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/anyvalue branch from a39bb23 to f75fb2f Compare June 24, 2020 18:21
}

func attributeValueToString(attr pdata.AttributeValue) string {
func attributeValueToString(attr pdata.AttributeValue, jsonLike bool) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we even translate this back from string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand the question.


case pdata.AttributeValueMAP:
// OpenCensus attributes cannot represent maps natively. Convert the
// map to a JSON-like string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not JSON? Do we want this to be just human-readable representation or do we expect someone to attempt to translate it back?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a stringified JSON. I think it is a good compromise since it preserves the full information and can be translated back, yet it is also more or less human readable.
I am open to other suggestions on how else we can translate this.

@bogdandrutu bogdandrutu merged commit 4777e91 into open-telemetry:master Jun 25, 2020
@tigrannajaryan tigrannajaryan deleted the feature/tigran/anyvalue branch June 25, 2020 21:46
@flands flands added this to the Beta 0.5 milestone Jun 28, 2020
wyTrivail pushed a commit to mxiamxia/opentelemetry-collector that referenced this pull request Jul 13, 2020
This is a breaking OTLP change.

- Use AnyValue introduced in recent change to OTLP.
  Changes are encapsulated in AttributeValue and most of the codebase is
  unaffected, which proves the wrappers are very useful.

- Rename AttributeKeyValue to KeyValue (the change comes from OTLP).

- Use local protoc to compile ProtoBufs. Previously used znly/protoc
  docker image is outdated and results in incorrect code for gRPC-Gateway.

TODO:

- Need to add support for ARRAY value type. This is not urgent since
  there are no known data sources that use the ARRAY type yet.

- Use Gogoproto `(gogoproto.nullable) = false` annotation for AnyValue
  to possibly improve performance further.
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
* Rename 'correlation' to 'baggage'

* Rename CorrelationContext progator to Baggage

* Update CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants