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

Datadog Exporter - Accept attributes on scopeMetrics as tags. #37681

Open
brettplarson opened this issue Feb 4, 2025 · 5 comments
Open

Datadog Exporter - Accept attributes on scopeMetrics as tags. #37681

brettplarson opened this issue Feb 4, 2025 · 5 comments
Labels
data:metrics Metric related issues enhancement New feature or request exporter/datadog Datadog components

Comments

@brettplarson
Copy link

Component(s)

exporter/datadog

Describe the issue you're reporting

We are sending an OTLP Json payload that looks like the following as a minimal example:

{
    "resourceMetrics": [
        {
            "resource": {
                "attributes": [
                    {
                        "key": "service",
                        "value": {
                            "stringValue": "cool_app"
                        }
                    },
                    {
                        "key": "env",
                        "value": {
                            "stringValue": "prod"
                        }
                    },
                    {
                        "key": "version",
                        "value": {
                            "stringValue": "OtelMetrics_SW.1"
                        }
                    }
                ]
            },
            "scopeMetrics": [
                {
                    "metrics": [
                        {
                            "name": "message_count",
                            "sum": {
                                "aggregationTemporality": 2,
                                "dataPoints": [
                                    {
                                        "asDouble": 0,
                                        "startTimeUnixNano": "1738678910381833677",
                                        "timeUnixNano": "1738678930381833747"
                                    }
                                ],
                                "isMonotonic": true
                            }
                        },
                        {
                            "name": "bytes",
                            "sum": {
                                "aggregationTemporality": 2,
                                "dataPoints": [
                                    {
                                        "asDouble": 0,
                                        "startTimeUnixNano": "1738678910381833677",
                                        "timeUnixNano": "1738678930381833747"
                                    }
                                ],
                                "isMonotonic": true
                            }
                        },
                        {
                            "gauge": {
                                "dataPoints": [
                                    {
                                        "asDouble": 0,
                                        "attributes": [
                                            {
                                                "key": "percentile",
                                                "value": {
                                                    "stringValue": ""
                                                }
                                            }
                                        ],
                                        "timeUnixNano": "1738678930381833747"
                                    },
                                    {
                                        "asDouble": 0,
                                        "attributes": [
                                            {
                                                "key": "percentile",
                                                "value": {
                                                    "stringValue": ""
                                                }
                                            }
                                        ],
                                        "timeUnixNano": "1738678930381833747"
                                    },
                                ]
                            },
                        }
                    ],
                    "scope": {
                        "attributes": [
                            {
                                "key": "component",
                                "value": {
                                    "stringValue": "Utc_converter"
                                }
                            },
                            {
                                "key": "threadName",
                                "value": {
                                    "stringValue": "cool_thread"
                                }
                            }
                        ]
                    }
                },
            ]
        }
    ]
}

However the attributes scoped to the metric are just ignored, we'd like to use them as tags so that we can group them into a single scope with common tags as well as keep payload sizes small.

@brettplarson brettplarson added the needs triage New item requiring triage label Feb 4, 2025
@github-actions github-actions bot added the exporter/datadog Datadog components label Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@mx-psi
Copy link
Member

mx-psi commented Feb 4, 2025

👋 You may want to set metrics::instrumentation_scope_metadata_as_tags to true:

## @param instrumentation_scope_metadata_as_tags - string - optional - default: false
## Set to true to add metadata about the instrumentation scope that created a metric.
#
# instrumentation_scope_metadata_as_tags: false

Could you let us know if this solves your issue?

@mx-psi mx-psi added waiting for author and removed needs triage New item requiring triage labels Feb 4, 2025
@brettplarson
Copy link
Author

Thanks @mx-psi - I forgot to mention, I did try this, but after I just see these two tags that show n/a.
instrumentation_scope:n/a / instrumentation_scope_version:n/a
Image

@brettplarson
Copy link
Author

I also opened a DD support case of #2019134

@mx-psi
Copy link
Member

mx-psi commented Feb 4, 2025

Ah, right, you are not using the scope name or version, you are using scope attributes. I can confirm this is not supported at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:metrics Metric related issues enhancement New feature or request exporter/datadog Datadog components
Projects
None yet
Development

No branches or pull requests

2 participants