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

feat: Use OTel distro class to configure SDK - allow both programatic and auto-configure hooks #22

Merged
merged 3 commits into from
Dec 5, 2022

Conversation

emilyashley
Copy link
Contributor

@emilyashley emilyashley commented Dec 2, 2022

Which problem is this PR solving?

Updates the distro to introduce a the HoneycombDistro class which introduces the hook for auto configuration via BaseDistro. Also exposes the configure_opentelemetry function that can be used programatically to configure the SDK.

Short description of the changes

  • Adds new HoneycombDistro class that depends on BaseDistro
  • Adds configure_opentelemetry function that sets up the OTel SDK via environment variables
  • Adds unit tests for the distro to verify API key, endpoint and service name can be set via parameter or env var

NOTE: env vars are used over parameters

…uration

Co-authored-by: Mike Goldsmth <goldsmith.mike@gmail.com>
## Which problem is this PR solving?

Updates the module to not include the `-python` suffix in the module
name and updates project structure to follow poetry defaults which
improves import paths.

For example, `import honeycomb.opentelemetry` vs `import
src.honeycomb.opentelemetry`

## Short description of the changes
- Rename module in pyproject.toml
- Move honeycomb dir from src to root
- Update flask app to use new import paths

NOTE: This is a PR into #22 not main
@MikeGoldsmith MikeGoldsmith added the type: enhancement New feature or request label Dec 5, 2022
@MikeGoldsmith MikeGoldsmith changed the title wip: add base distro class to the project and set some default config Use OTel distro class to configure SDK - allow both programatic and auto-configure hooks Dec 5, 2022
@MikeGoldsmith MikeGoldsmith marked this pull request as ready for review December 5, 2022 13:11
@MikeGoldsmith MikeGoldsmith requested a review from a team December 5, 2022 13:11
Copy link
Contributor

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

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

disco-minion

@MikeGoldsmith MikeGoldsmith changed the title Use OTel distro class to configure SDK - allow both programatic and auto-configure hooks feat: Use OTel distro class to configure SDK - allow both programatic and auto-configure hooks Dec 5, 2022
@emilyashley emilyashley merged commit 845508c into main Dec 5, 2022
@emilyashley emilyashley deleted the emash-base-distro branch December 5, 2022 18:26
emilyashley added a commit that referenced this pull request Dec 5, 2022
## Which problem is this PR solving?
Adds basic Honeycomb options class that can detect and use env vars and
passed in parameters

## Short description of the changes
- Add HoneycombOptions class
- Add unit tests to verify parameters can be set with env var and
parameters

NOTE: This is based on the branch from #22 - it will automatically
rebase when that PR is merged

Co-authored-by: Emily Ashley <15912063+emilyashley@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement base distro class
2 participants