Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#869 - export array attributes to OTLP #992

Merged
merged 8 commits into from
Aug 4, 2020

Conversation

stefanprisca
Copy link
Contributor

@stefanprisca stefanprisca commented Jul 30, 2020

PR to resolve issue #869

  • create new toArrayAttribute(v kv.KeyValue) function which converts each accepted array type to the otel-common equivalent
  • added new test case for array attributes, covering the currently accepted array types: "bool", "int", "int32", "int64", "float32", "float64", "string", "uint", "uint32", "uint64"

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 30, 2020

CLA Check
The committers are authorized under a signed CLA.

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

Looks good overall. Minor follow up questions.

exporters/otlp/internal/transform/attribute.go Outdated Show resolved Hide resolved
exporters/otlp/internal/transform/attribute_test.go Outdated Show resolved Hide resolved
exporters/otlp/internal/transform/attribute_test.go Outdated Show resolved Hide resolved
@stefanprisca
Copy link
Contributor Author

I tried to see how this change looks when exporting traces with array attributes through the collector and visualizing them from Jaeger (using the otel-collector example).
Without the change, the attributes would appear as "INVALID" strings. But with this change, the attributes appear as empty strings. This is a bit weird, as I'd expect them to actually contain the array values.

Could this be an error on the go-sdk side, the collector or on jaeger? Or is this expected given this combination? What do you think?

@MrAlias
Copy link
Contributor

MrAlias commented Jul 31, 2020

I tried to see how this change looks when exporting traces with array attributes through the collector and visualizing them from Jaeger (using the otel-collector example).
Without the change, the attributes would appear as "INVALID" strings. But with this change, the attributes appear as empty strings. This is a bit weird, as I'd expect them to actually contain the array values.

Could this be an error on the go-sdk side, the collector or on jaeger? Or is this expected given this combination? What do you think?

It looks like the Jaeger translator in the collector doesn't have a translation for an Array type yet. Though, it looks like the collector's internal representation doesn't support this yet either.

I think the level of testing you have done seems reasonable enough from a client perspective. It would be cool to include some integration testing when the support is added.

@MrAlias
Copy link
Contributor

MrAlias commented Aug 4, 2020

@stefanprisca is this ready to merge, or did you want to continue investigating the integration story?

@stefanprisca
Copy link
Contributor Author

@stefanprisca is this ready to merge, or did you want to continue investigating the integration story?

Sorry, I didn't realize you were waiting for an answer from me.

There seems to be an integration test already, covering attributes as well: otel_integration_tests. Although it just tests integers, the others should work also, since it's the same code path.

Maybe it would be interesting to create more use-cases for the attributes, by testing the other types (string, bool, array, etc) as well. But I'm not sure how many benefits it would bring.

Either way, I think this should be merged. Integration tests can be covered in a different issue, since we might want to have more than just for arrays. What do you think?

@MrAlias MrAlias merged commit db2faf3 into open-telemetry:master Aug 4, 2020
@MrAlias
Copy link
Contributor

MrAlias commented Aug 4, 2020

Sorry, I didn't realize you were waiting for an answer from me.

No worries. I figured as much, just wanted to be sure.

Integration tests can be covered in a different issue, since we might want to have more than just for arrays. What do you think?

Sounds good to me 👍

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.

4 participants