Skip to content

Tags concatenated #57

@VitoMakarevich

Description

@VitoMakarevich

I'm using an extension in Java 11 environment.
Lambda gradle part is: implementation 'com.datadoghq:datadog-lambda-java:1.4.3'
Here is the code I use to create metrics:

    final Map<String, Object> tags = Map.of(REQUEST_TYPE_TAG, queryType.getAlias(), CUSTOMER_TAG, customerUUID);
    this.datadogAgentSupplier.get().metric(METRIC_NAME, 1, tags);
    
    final Map<String, Object> tags = Map.of(CUSTOMER_TAG, customerUUID);
    this.datadogAgentSupplier.get().metric(METRIC_NAME, 1, tags);

I'm using Lambda with docker. The dockerfile part is:

FROM datadog/lambda-extension:21 as datadog-extension

# Building runtime container
FROM amazon/aws-lambda-java:11

COPY --from=datadog-extension /opt /opt

The lambda env variables are:

    DD_API_KEY : data.aws_ssm_parameter.datadog_secret.value
    DD_LOGS_INJECTION : "false"
    DD_JMXFETCH_ENABLED : "false"
    DD_TRACE_ENABLED : "false"
    DD_SERVERLESS_LOGS_ENABLED: "false"
    DD_ENV : var.environment_id
    DD_SERVICE : "querying"

The issue I have is that tags are concatenated, e.g. if I submit both customer and query-type, I receive query-type:incremental_querycustomer:x5ncbrfd54k8jka3hwij6ur, I've tried a couple of extension versions(17, 19, 21), unfortunately, it gives me the same result.

I've also tried to change the extension log level, here is what I see when it's set to debug:

"tags": [
                "env:staging-iad",
                "service:querying",
                "query-type:incremental_querycustomer:x5ncbrfd54k8jka3hwij6ur"

The debugger shows that {"m":"dap.request","v":1.0,"t":["query_type:incremental_query","customer:x5ncbrfd54k8jka3hwij6ur"],"e":1648642299} is written to stdout from datadog lambda java. I've seen this log in the production
2022-03-30T17:16:58.399+03:00 | {"level":"DEBUG","message":"datadog: Setting the writer to extension"} this means that extension is used.
I also tried with simple tag values like "1" and "2". Example

    final Map<String, Object> tags = Map.of(REQUEST_TYPE_TAG, "1", CUSTOMER_TAG, "2");
    this.datadogAgentSupplier.get().metric(METRIC_NAME, 1, tags);

unfortunately, the tags are still concatenated(group by customer_tag value is 2query-type:1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions