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

Support passing in a function to determine service name for mysql #2066

Merged
merged 6 commits into from
May 30, 2022

Conversation

jhatch
Copy link
Contributor

@jhatch jhatch commented May 19, 2022

What does this PR do?

Similar to the existing behavior of the OracleDB package and others - this PR adds support for passing in a function to dynamically set service for the mysql and mysql2 packages.

Motivation

We have a service that queries multiple databases owned by other services (has to do with outbox event propagation). Let's call this service "something-api". Currently the spans encompassing queries from "something-api" to ANY database is "something-api-mysql". To ease debugging, we'd like to have a unique name per DB-instance we're querying. We could achieve this on our end if service was definable via a function we pass in.

Plugin Checklist

Additional Notes

@jhatch jhatch requested a review from a team as a code owner May 19, 2022 16:35
@jhatch jhatch marked this pull request as draft May 19, 2022 16:35
@jhatch jhatch marked this pull request as ready for review May 19, 2022 18:21
@jhatch jhatch requested a review from rochdev May 20, 2022 20:35
@rochdev rochdev merged commit 87b47c2 into DataDog:master May 30, 2022
simon-id pushed a commit that referenced this pull request Jun 8, 2022
)

* Support passing in a function to determine service name for mysql

* update TS tests for mysql/2 service function change

* rebuild.

* pass in dbConfig to service function

* testing mysql and mysql2 service functions

* minor refactor
rochdev pushed a commit that referenced this pull request Jun 8, 2022
)

* Support passing in a function to determine service name for mysql

* update TS tests for mysql/2 service function change

* rebuild.

* pass in dbConfig to service function

* testing mysql and mysql2 service functions

* minor refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants