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 DD_TRACE_OTEL_ENABLED support #159

Merged
merged 1 commit into from
Mar 1, 2024
Merged

add DD_TRACE_OTEL_ENABLED support #159

merged 1 commit into from
Mar 1, 2024

Conversation

joeyzhao2018
Copy link
Contributor

@joeyzhao2018 joeyzhao2018 commented Mar 1, 2024

What does this PR do?

To better support Open-telemetry syntax, initialize the tracer provider if DD_TRACE_OTEL_ENABLED is enabled.

With this change, users can directly import go.opentelemetry.io/otel and use

	tracer := otel.Tracer("customer-code") //otel
	_, span := tracer.Start(ctx, "hello-span")  //otel

Motivation

This is because we do initialize the tracer with a set of options in this library.

Testing Guidelines

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Checklist

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@joeyzhao2018 joeyzhao2018 requested a review from a team as a code owner March 1, 2024 16:24
@joeyzhao2018 joeyzhao2018 merged commit 9cba6a3 into main Mar 1, 2024
9 checks passed
@joeyzhao2018 joeyzhao2018 deleted the joey/otel-option branch March 1, 2024 18:32
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.

2 participants