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 support for DD_VERSION and DD_ENV variables #803

Merged
merged 9 commits into from Jul 1, 2020

Conversation

brettlangdon
Copy link
Member

@brettlangdon brettlangdon commented Mar 25, 2020

Description

Adding support for DD_VERSION and DD_ENV environment variables.

These variables should set default global tags of version and env on every span generated.

Readiness checklist

  • Changelog has been added to the appropriate release draft. Create one if necessary.
  • Tests added for this feature/bug.

Reviewer checklist

  • Appropriate labels assigned.
  • Milestone is set.
  • Changelog has been added to the appropriate release draft. For community contributors the reviewer is in charge of this task.

Copy link
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I am surprised that tests did not fail.

@labbati
Copy link
Member

labbati commented Mar 26, 2020

@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

@brettlangdon
Copy link
Member Author

well, by default it won't add actually modify anything, if no env variables are provided, then no changes to spans.

@brettlangdon brettlangdon marked this pull request as ready for review April 1, 2020 13:44
$this->assertTrue(empty($traces[0][0]['meta']['env']));
}

public function testDDEnvHasPrecendenceOverGlobalTags()
Copy link
Member

Choose a reason for hiding this comment

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

Note, this would succeed in any case until the DD_TAG PR #920 is merged. After #920 is merged then it succeed only if the order it correct.

$this->assertTrue(empty($traces[0][0]['meta']['version']));
}

public function testDDVersionHasPrecendenceOverGlobalTags()
Copy link
Member

Choose a reason for hiding this comment

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

Note, this would succeed in any case until the DD_TAG PR #920 is merged. After #920 is merged then it succeed only if the order it correct.

@labbati labbati added this to the 0.47.0 milestone Jun 12, 2020
@SammyK SammyK added the 🏆 enhancement A new feature or improvement label Jun 15, 2020
Copy link
Contributor

@SammyK SammyK left a comment

Choose a reason for hiding this comment

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

Excellent work @brettlangdon! 🔝


// Application version
if (null !== $this->serviceVersion) {
$span->setTag(Tag::VERSION, $this->serviceVersion);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just want to confirm that it was intentional to not use Tag::SERVICE_VERSION here, correct?

Copy link
Member

Choose a reason for hiding this comment

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

That's correct. Tag::SERVICE_VERSION =service.version is only there for compatibility for OpenTelemetry. What we want to set is version.

@labbati labbati closed this Jun 19, 2020
@labbati labbati reopened this Jul 1, 2020
@labbati labbati merged commit b0ccf2f into master Jul 1, 2020
@labbati labbati deleted the brettlangdon/dd.version.env branch July 1, 2020 13:37
@morrisonlevi morrisonlevi mentioned this pull request Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏆 enhancement A new feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants