[ 
https://issues.apache.org/jira/browse/KUDU-3775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18101035#comment-18101035
 ] 

ASF subversion and git services commented on KUDU-3775:
-------------------------------------------------------

Commit 1555eb8f00f70f362c73517328a73cfa482d4800 in kudu's branch 
refs/heads/master from Jeison Romero
[ https://gitbox.apache.org/repos/asf?p=kudu.git;h=1555eb8f0 ]

KUDU-3775: relax entity type restriction in Prometheus labels

BuildPrometheusLabels() previously DCHECKed that entity_type was one
of "server", "table", or "tablet", rejecting any other entity type
(e.g. synthetic test entities such as "test_entity"). This made it
impossible to use the entity-labels Prometheus format with anything
outside those three built-in types.

Remove the DCHECK and rename the internal helper from
BuildTableTabletPrometheusLabels to BuildGenericPrometheusLabels,
reflecting that it now handles any entity type other than "server"
generically: it emits entity_type and entity_id as-is, along with
any recognized attributes, without asserting on the type value.

Convert MetricsTest.PrometheusFilterByEntityLevel from the legacy
Prometheus format (previously required as a workaround, since it
uses test_entity) to the entity-labels format now that this is
possible. Add a dedicated regression test,
PrometheusEntityLabelsArbitraryEntityType, that specifically
verifies correct label output for a non-standard entity type.

Change-Id: I23479bc3fb3c6f2ea81fd2b1727dd2bd1609a30c
Reviewed-on: http://gerrit.cloudera.org:8080/24646
Reviewed-by: Alexey Serbin <[email protected]>
Reviewed-by: Marton Greber <[email protected]>
Tested-by: Marton Greber <[email protected]>


> BuildPrometheusLabels DCHECK restricts new Prometheus label format to known 
> entity types
> ----------------------------------------------------------------------------------------
>
>                 Key: KUDU-3775
>                 URL: https://issues.apache.org/jira/browse/KUDU-3775
>             Project: Kudu
>          Issue Type: Improvement
>            Reporter: Marton Greber
>            Assignee: Jason Romero
>            Priority: Minor
>
> BuildPrometheusLabels() in prometheus_writer.cc contains a DCHECK that
> hard-codes the set of valid entity types to "server", "table", and "tablet":
>  
>  DCHECK(entity_type == "server" ||
>  entity_type == "table" ||
>  entity_type == "tablet")
>  
> This prevents enabling --metrics_prometheus_use_entity_labels=true for
> any entity type outside this set, including synthetic test entities
> (e.g. "test_entity"). As a result, unit tests for Prometheus filtering
> (KUDU-3690) cannot use the new label-based format and are forced to
> rely on the legacy format instead.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to