dd-trace-py icon indicating copy to clipboard operation
dd-trace-py copied to clipboard

Set service name for boto3/botocore from env var

Open HoneyryderChuck opened this issue 1 year ago • 1 comments

Summary of problem

Several other client libs support service name overrides from env var (DD_AREDIS_SERVICE, DD_PSYCOPG_SERVICE, DD_HTTPX_SERVICE), but there's no such env var support for overriding botocore service name (currently it's "aws.sqs", "aws.s3"...)

In fact, patching

Which version of dd-trace-py are you using?

I've searched on "latest" docs, and found nothing. But I'm using boto3-1.33.13 and botocore-1.33.13.

How can we reproduce your problem?

import ddtrace
ddtrace.config.botocore["service_name"] = "bang"
ddtrace.patch(botocore=True)
# now try sending a message with SQS or smth..

What is the result that you get?

service name was not overridden (still "aws.sqs").

What is the result that you expected?

service name "bang".

HoneyryderChuck avatar Apr 18 '24 17:04 HoneyryderChuck

cc @tabgok

emmettbutler avatar Apr 18 '24 17:04 emmettbutler

Any update on this?

joshverma avatar Jul 08 '24 22:07 joshverma

Hi @HoneyryderChuck ,

Thanks for submitting this issue! Could you provide more information as to why you want to override the service name for botocore? Generally the different botocore services have different functionality (between aws.sqs or aws.s3) so we haven't provided a setting for global override.

quinna-h avatar Jul 17 '24 21:07 quinna-h

Most other integrations allow changing the service name. In the use case of managing multiple services, it makes it easier to narrow down which traces belong to which service.

HoneyryderChuck avatar Jul 17 '24 21:07 HoneyryderChuck

Hi @HoneyryderChuck ,

Thanks for raising this issue! We created the fix as part of the latest 2.10.0 release (link)

quinna-h avatar Jul 29 '24 19:07 quinna-h