Add support for DD_VERSION and DD_ENV variables#803
Conversation
morrisonlevi
left a comment
There was a problem hiding this comment.
This looks good to me, but I am surprised that tests did not fail.
|
@brettlangdon thanks for the work on this. I can download it tomorrow first thing in the morning and play with it to understand why it is not failing, as I am surprised as well |
|
well, by default it won't add actually modify anything, if no env variables are provided, then no changes to spans. |
…ngdon/dd.version.env
…nctions dual approach
| $this->assertTrue(empty($traces[0][0]['meta']['env'])); | ||
| } | ||
|
|
||
| public function testDDEnvHasPrecendenceOverGlobalTags() |
| $this->assertTrue(empty($traces[0][0]['meta']['version'])); | ||
| } | ||
|
|
||
| public function testDDVersionHasPrecendenceOverGlobalTags() |
SammyK
left a comment
There was a problem hiding this comment.
Excellent work @brettlangdon! 🔝
|
|
||
| // Application version | ||
| if (null !== $this->serviceVersion) { | ||
| $span->setTag(Tag::VERSION, $this->serviceVersion); |
There was a problem hiding this comment.
Just want to confirm that it was intentional to not use Tag::SERVICE_VERSION here, correct?
There was a problem hiding this comment.
That's correct. Tag::SERVICE_VERSION =service.version is only there for compatibility for OpenTelemetry. What we want to set is version.
Description
Adding support for
DD_VERSIONandDD_ENVenvironment variables.These variables should set default global tags of
versionandenvon every span generated.Readiness checklist
Reviewer checklist