Giter VIP home page Giter VIP logo

Comments (7)

jirikuncar avatar jirikuncar commented on August 25, 2024

@DataDog/agent-core should we escape or remove | in tag?

Is there any documentation which specifies valid tags? I have only found https://docs.datadoghq.com/developers/metrics/dogstatsd_metrics_submission/?tab=python#metric-tagging.

see also #517

from datadogpy.

arbll avatar arbll commented on August 25, 2024

@jirikuncar https://docs.datadoghq.com/tagging/#defining-tags defines valid characters for tags. AFAIK statsd/dogstatsd do not specify how to escape characters that conflict with the protocol or are invalid. It probably make sense to either strip them or replace them by a valid character like _.

In any case let's make sure we align with other clients if they have logic to escape tags / metric names.

from datadogpy.

jirikuncar avatar jirikuncar commented on August 25, 2024

@arbll thank you for the link. It doesn't say how the tags should be encoded in case of dogstatd. We can add a validation, but | seems like a valid character.

from datadogpy.

arbll avatar arbll commented on August 25, 2024

@jirikuncar | is invalid for all datadog tags, so it's also invalid for dogstatsd.
Again, I don't think dogstatsd/statsd escaping is defined anywhere. See statsd/statsd#585 for example

from datadogpy.

jirikuncar avatar jirikuncar commented on August 25, 2024

@arbll so basically a tag has to match ^[A-Za-z][A-Za-z0-9_\-:,/]{0,199}$ after re.sub('[^A-Za-z0-9_\-:,/]', '_', tag), right?


Playground: https://regex101.com/r/yJ8qva/1/tests

from datadogpy.

github-actions avatar github-actions commented on August 25, 2024

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

from datadogpy.

zippolyte avatar zippolyte commented on August 25, 2024

closed in #517

The library will now sanitize tags before sending them

from datadogpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.