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

Support output value in AttributeSetter #6543

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SodaDev
Copy link

@SodaDev SodaDev commented Jan 2, 2025

Reasoning:
Add AttributeBuilder, which will extend the AttributeSetter contract with output value. Thanks to that, users can instrument attributes based on the AWS SDK responses.

@SodaDev SodaDev requested a review from a team as a code owner January 2, 2025 15:06
Copy link

linux-foundation-easycla bot commented Jan 2, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: SodaDev / name: Marcin Sodkiewicz (6e05dfc)

@github-actions github-actions bot requested a review from akats7 January 2, 2025 15:06
@SodaDev SodaDev force-pushed the support-output-in-attributesetter branch 4 times, most recently from ae8c6cb to a976877 Compare January 2, 2025 15:19
Copy link
Member

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

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

This will need a changelog entry.

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 3 lines in your changes missing coverage. Please review.

Project coverage is 68.5%. Comparing base (00786cc) to head (6e05dfc).
Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
...github.com/aws/aws-sdk-go-v2/otelaws/attributes.go 66.6% 1 Missing ⚠️
...hub.com/aws/aws-sdk-go-v2/otelaws/snsattributes.go 50.0% 1 Missing ⚠️
...hub.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go 50.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #6543   +/-   ##
=====================================
  Coverage   68.5%   68.5%           
=====================================
  Files        200     200           
  Lines      16768   16800   +32     
=====================================
+ Hits       11490   11519   +29     
- Misses      4933    4937    +4     
+ Partials     345     344    -1     
Files with missing lines Coverage Δ
...tation/github.com/aws/aws-sdk-go-v2/otelaws/aws.go 95.8% <100.0%> (+0.1%) ⬆️
...ion/github.com/aws/aws-sdk-go-v2/otelaws/config.go 100.0% <100.0%> (ø)
...om/aws/aws-sdk-go-v2/otelaws/dynamodbattributes.go 100.0% <100.0%> (ø)
...github.com/aws/aws-sdk-go-v2/otelaws/attributes.go 89.4% <66.6%> (+7.1%) ⬆️
...hub.com/aws/aws-sdk-go-v2/otelaws/snsattributes.go 81.4% <50.0%> (-6.6%) ⬇️
...hub.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go 94.4% <50.0%> (-5.6%) ⬇️

... and 3 files with indirect coverage changes

@SodaDev SodaDev force-pushed the support-output-in-attributesetter branch from a976877 to e8d0895 Compare January 6, 2025 12:53
…with output value. Thanks to that, users can instrument attributes based on the AWS SDK responses.
@SodaDev SodaDev force-pushed the support-output-in-attributesetter branch from e8d0895 to 6e05dfc Compare January 6, 2025 15:44
Comment on lines +18 to +19
- `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` change: Use of `AttributeBuilder` interface instead of `AttributeSetter`. Previous usage of `AttributeSetter` were backward compatibly changed to use `AttributeBuilder` interface.
- `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` change: Attributes are added to the span after the execution instead of before the execution of AWS SDK
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` change: Use of `AttributeBuilder` interface instead of `AttributeSetter`. Previous usage of `AttributeSetter` were backward compatibly changed to use `AttributeBuilder` interface.
- `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` change: Attributes are added to the span after the execution instead of before the execution of AWS SDK
- Deprecated the `AttributeSetter` interface, in favor of `AttributeSetter` in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` (#6543)
- Added custom attribute to the span after execution of the SDK rather than before in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws`. (#6543)

@@ -11,6 +11,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Added

- Generate server metrics with semantic conventions v1.26 in `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` when `OTEL_SEMCONV_STABILITY_OPT_IN` is set to `http/dup`. (#6411)
- `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` change: Added new `AttributeBuilder` interface to support adding attributes based on input and output instead of input only. It is also now possible to provide a custom function to set attributes using `WithAttributeBuilder`
Copy link
Member

@dmathieu dmathieu Jan 7, 2025

Choose a reason for hiding this comment

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

Suggested change
- `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` change: Added new `AttributeBuilder` interface to support adding attributes based on input and output instead of input only. It is also now possible to provide a custom function to set attributes using `WithAttributeBuilder`
- Added new `AttributeBuilder` interface to support adding attributes based on SDK input and output in `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws`. (#6543)

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.

3 participants