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

Add inherited attributes preview #1854

Merged
merged 2 commits into from
Aug 16, 2021
Merged

Conversation

trask
Copy link
Member

@trask trask commented Aug 16, 2021

Resolves #1743

"preview": {
"inheritedAttributes": [
{
"key": "tenant",
Copy link
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
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
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
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
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
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
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
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
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
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