prometheus/web/api/v1
Arthur Silva Sens 2c04f2d7b1
PROM-39: Add type and unit labels to OTLP endpoint (#16630)
* PROM-39: Add type and unit labels to OTLP endpoint

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Extract label addition into helper function

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Wire feature flag and web handler configuration

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Use lowercase for units too

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Use otlptranslator.UnitNamer to build units

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Address copilot's comment

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Verify label presence before adding them

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Overwrite type/unit labels when already set

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* sed/addTypeAndUnitLabels/enableTypeAndUnitLabels/

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Reduce duplicated code

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-07-25 08:53:13 -03:00
..
api_test.go chore: enable gci linter (#16245) 2025-03-22 15:46:13 +00:00
api.go PROM-39: Add type and unit labels to OTLP endpoint (#16630) 2025-07-25 08:53:13 -03:00
codec_test.go Implement fully-featured content negotiation for API requests, and allow overriding the default API codec. 2023-03-09 12:02:45 +11:00
codec.go Implement fully-featured content negotiation for API requests, and allow overriding the default API codec. 2023-03-09 12:02:45 +11:00
errors_test.go PROM-39: Add type and unit labels to OTLP endpoint (#16630) 2025-07-25 08:53:13 -03:00
json_codec_test.go bugfix: add missing comma in vector/matrix array (#14047) 2024-05-03 14:07:49 -03:00
json_codec.go chore: fix some function names in comment 2025-06-27 15:34:53 +08:00
translate_ast.go Signed-off-by: Julius Volz <julius.volz@gmail.com> 2024-09-06 21:47:35 +02:00