mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 12:29:04 +08:00
chore: skip showing metrics with dot in name (#6096)
This commit is contained in:
parent
d5c38ed0a4
commit
155a2ea557
@ -3595,7 +3595,11 @@ func (r *ClickHouseReader) QueryDashboardVars(ctx context.Context, query string)
|
|||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *ClickHouseReader) GetMetricAggregateAttributes(ctx context.Context, req *v3.AggregateAttributeRequest) (*v3.AggregateAttributeResponse, error) {
|
func (r *ClickHouseReader) GetMetricAggregateAttributes(
|
||||||
|
ctx context.Context,
|
||||||
|
req *v3.AggregateAttributeRequest,
|
||||||
|
skipDotNames bool,
|
||||||
|
) (*v3.AggregateAttributeResponse, error) {
|
||||||
|
|
||||||
var query string
|
var query string
|
||||||
var err error
|
var err error
|
||||||
@ -3622,6 +3626,10 @@ func (r *ClickHouseReader) GetMetricAggregateAttributes(ctx context.Context, req
|
|||||||
if err := rows.Scan(&metricName, &typ, &isMonotonic, &temporality); err != nil {
|
if err := rows.Scan(&metricName, &typ, &isMonotonic, &temporality); err != nil {
|
||||||
return nil, fmt.Errorf("error while scanning rows: %s", err.Error())
|
return nil, fmt.Errorf("error while scanning rows: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
if skipDotNames && strings.Contains(metricName, ".") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Non-monotonic cumulative sums are treated as gauges
|
// Non-monotonic cumulative sums are treated as gauges
|
||||||
if typ == "Sum" && !isMonotonic && temporality == string(v3.Cumulative) {
|
if typ == "Sum" && !isMonotonic && temporality == string(v3.Cumulative) {
|
||||||
typ = "Gauge"
|
typ = "Gauge"
|
||||||
|
@ -3783,7 +3783,7 @@ func (aH *APIHandler) autocompleteAggregateAttributes(w http.ResponseWriter, r *
|
|||||||
|
|
||||||
switch req.DataSource {
|
switch req.DataSource {
|
||||||
case v3.DataSourceMetrics:
|
case v3.DataSourceMetrics:
|
||||||
response, err = aH.reader.GetMetricAggregateAttributes(r.Context(), req)
|
response, err = aH.reader.GetMetricAggregateAttributes(r.Context(), req, true)
|
||||||
case v3.DataSourceLogs:
|
case v3.DataSourceLogs:
|
||||||
response, err = aH.reader.GetLogAggregateAttributes(r.Context(), req)
|
response, err = aH.reader.GetLogAggregateAttributes(r.Context(), req)
|
||||||
case v3.DataSourceTraces:
|
case v3.DataSourceTraces:
|
||||||
|
@ -52,7 +52,7 @@ type Reader interface {
|
|||||||
SetTTL(ctx context.Context, ttlParams *model.TTLParams) (*model.SetTTLResponseItem, *model.ApiError)
|
SetTTL(ctx context.Context, ttlParams *model.TTLParams) (*model.SetTTLResponseItem, *model.ApiError)
|
||||||
|
|
||||||
FetchTemporality(ctx context.Context, metricNames []string) (map[string]map[v3.Temporality]bool, error)
|
FetchTemporality(ctx context.Context, metricNames []string) (map[string]map[v3.Temporality]bool, error)
|
||||||
GetMetricAggregateAttributes(ctx context.Context, req *v3.AggregateAttributeRequest) (*v3.AggregateAttributeResponse, error)
|
GetMetricAggregateAttributes(ctx context.Context, req *v3.AggregateAttributeRequest, skipDotNames bool) (*v3.AggregateAttributeResponse, error)
|
||||||
GetMetricAttributeKeys(ctx context.Context, req *v3.FilterAttributeKeyRequest) (*v3.FilterAttributeKeyResponse, error)
|
GetMetricAttributeKeys(ctx context.Context, req *v3.FilterAttributeKeyRequest) (*v3.FilterAttributeKeyResponse, error)
|
||||||
GetMetricAttributeValues(ctx context.Context, req *v3.FilterAttributeValueRequest) (*v3.FilterAttributeValueResponse, error)
|
GetMetricAttributeValues(ctx context.Context, req *v3.FilterAttributeValueRequest) (*v3.FilterAttributeValueResponse, error)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user