Skip to content

Add inherited attributes preview#1854

Merged
trask merged 2 commits into
mainfrom
add-inherited-attributes-preview
Aug 16, 2021
Merged

Add inherited attributes preview#1854
trask merged 2 commits into
mainfrom
add-inherited-attributes-preview

Conversation

@trask

@trask trask commented Aug 16, 2021

Copy link
Copy Markdown
Member

Resolves #1743

"preview": {
"inheritedAttributes": [
{
"key": "tenant",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you add tests for other data type supported? i am interested in seeing the structure of Array type, those a bit complicated ones.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think non-string attributes will be pretty rare for this feature

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if we expect string all the time, can you refactor SpanAttributeType and InheritedAttribute to support string only?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I want to leave open the possibility for others

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

at least remove the array types because Breeze won't accept array? we can add it back when it's supported? i just feel that this might never get used and become confusing later...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

arrays are converted to strings, see Exporter.getStringValue()

for (AttributeKey<?> inheritAttributeKey : inheritAttributeKeys) {
Object value = TempGetAttribute.getAttribute(parentReadableSpan, inheritAttributeKey);
if (value != null) {
span.setAttribute((AttributeKey<Object>) inheritAttributeKey, value);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are inheritAttributes part of the customDimensions in the payload?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes

case STRING:
return AttributeKey.stringKey(key);
case BOOLEAN:
return AttributeKey.booleanKey(key);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i checked out #1743, the way they send extra attributes are through part C. Breeze accepts key/value pair string only. how other datatypes here will get used?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

they are all converted to strings, see Exporter.getStringValue()

@trask trask merged commit 23f7b19 into main Aug 16, 2021
@trask trask deleted the add-inherited-attributes-preview branch August 16, 2021 23:28
@kryalama kryalama added this to the 3.2.0-BETA.3 milestone Sep 3, 2021
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.

Using Java Agent with AI SDK

3 participants