-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 collector version to xray exporter user agent #1730
Add collector version to xray exporter user agent #1730
Conversation
/cc @mxiamxia |
exporter/awsxrayexporter/conn.go
Outdated
@@ -53,6 +56,11 @@ const ( | |||
STSAwsCnPartitionIDSuffix = ".amazonaws.com.cn" // AWS China partition. | |||
) | |||
|
|||
var collectorUserAgentHandler = request.NamedHandler{ | |||
Name: "otel.collector.UserAgentHandler", | |||
Fn: request.MakeAddToUserAgentHandler("opentelemetry-collector-contrib", version.Version, version.GitHash), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Trying to have better understanding. where and who can set version.DistributionType = "opentelemetry-collector-contrib"
to replace the value? Just another thought, can we consider to use env variable to replace the default collector name "opentelemetry-collector-contrib
" and collector version? In that case, AWS OTel Collector can set customized value for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and added the distributionType
variable in this PR so that would be modifiable with ldflags
Codecov Report
@@ Coverage Diff @@
## master #1730 +/- ##
==========================================
+ Coverage 89.57% 89.58% +0.01%
==========================================
Files 375 375
Lines 18294 18299 +5
==========================================
+ Hits 16387 16394 +7
+ Misses 1413 1411 -2
Partials 494 494
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description: To provide support to customers using the otel collector, we need some more telemetry data from the collector. Adding the collector version to user agent is the first simple step.
As follow up, I would
Extract this into a shared package and use from all the AWS clients (probably a good time to extract all the STS copy-paste too)
Add
version.DistributionType = "opentelemetry-collector-contrib"
and add that too. Custom distributions can replace that with e.g.,aws-otel-collector
Testing: Unit tests