DataDog / kong-plugin-ddtrace

Datadog APM Plugin for Kong Gateway
Apache License 2.0
15 stars 7 forks source link

[Bug]: It limits the span to only 2 unlike OTEL #66

Open muthurathnamswamy-8451 opened 3 weeks ago

muthurathnamswamy-8451 commented 3 weeks ago

Kong Version

3.6.1.7

Plugin Version

v0.2.1

On which environment your Kong instance is running?

Kubernetes

Plugin Configuration

{
            "config": {
                "agent_endpoint": null,
                "agent_host": null,
                "environment": null,
                "extraction_propagation_styles": [
                    "tracecontext"
                ],
                "generate_128bit_trace_ids": true,
                "header_tags": null,
                "initial_sample_rate": 1,
                "initial_samples_per_second": 200,
                "injection_propagation_styles": [
                    "tracecontext"
                ],
                "max_header_size": 512,
                "resource_name_rule": null,
                "service_name": "kong-internal",
                "static_tags": null,
                "trace_agent_port": null,
                "trace_agent_url": null,
                "version": null
            },
            "created_at": 1724093686,
            "enabled": false,
            "id": "ac6252ab-9050-4dde-be18-8564e8e444b2",
            "name": "ddtrace",
            "protocols": [
                "http"
            ],
            "updated_at": 1724177689
        }

What happened?

I tried playing around with these parameters and note that DD_AGENT_HOST value is being obtained from the environment variable:

Extraction Propagation Style and Injection Propagation Styles to following values individually

  1. datadog
  2. tracecontext
  3. datadog and tracecontext

Increased the Initial samples per second value to 200, sent about 250 requests

image

May I know what config changes can be made to DDTRACE to have more spans similar to OTEL Plugin (OTEL Span screen shot shown below for reference), appreciate your inputs.

image

dmehala commented 3 weeks ago

Hi @muthurathnamswamy-8451

May I know what config changes can be made to DDTRACE to have more spans similar to OTEL Plugin

Currently, it is not possible to generate more spans similar to those create by Kong's OTEL plugin. This limitation is because Kong's tracer is used to instrument internal code, which is beyond the scope of what plugins, like DDTRACE, can access.

To achieve the desired outcome, Kong would need to expose a tracer interface that DDTRACE could implement. I have been considering suggesting a similar approach to Kong, but I haven't had the chance to fully articulate my thoughts yet.

In summary, I understand your concern and agree that there should be consistency between the two modules. I am actively working on addressing this issue.