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

[processor/filter] Add ability to filter out data points #16387

Closed
adam-kiss-sg opened this issue Nov 21, 2022 · 2 comments
Closed

[processor/filter] Add ability to filter out data points #16387

adam-kiss-sg opened this issue Nov 21, 2022 · 2 comments
Labels
enhancement New feature or request needs triage New item requiring triage processor/filter Filter processor

Comments

@adam-kiss-sg
Copy link
Contributor

adam-kiss-sg commented Nov 21, 2022

Component(s)

processor/filter

Is your feature request related to a problem? Please describe.

I would like to be able to drop specific datapoints from a metric.

To be more specifix, i would like to be able to only keep datapoints emitted from spanmetrics processor that has a span.kind: "SPAN_KIND_SERVER" attribute on the datapoints.

My current config:

  filter/spanmetrics: 
    metrics:
      include:
        match_type: expr
        expressions:
          - MetricName in ["calls_total", "latency"] && Label("span.kind") == "SPAN_KIND_SERVER"

Example metrics:

ResourceMetrics #0
Resource SchemaURL: 
ScopeMetrics #0
ScopeMetrics SchemaURL: 
InstrumentationScope spanmetricsprocessor 
Metric #0
Descriptor:
     -> Name: calls_total
     -> Description: 
     -> Unit: 
     -> DataType: Sum
     -> IsMonotonic: true
     -> AggregationTemporality: Cumulative
NumberDataPoints #0
Data point attributes:
     -> service.name: Str(dummy-service)
     -> operation: Str(middleware - query)
     -> span.kind: Str(SPAN_KIND_INTERNAL)
     -> status.code: Str(STATUS_CODE_UNSET)
     -> http.method: Str(UNKOWN)
StartTimestamp: 2022-11-21 09:37:33.646666564 +0000 UTC
Timestamp: 2022-11-21 09:38:23.476303012 +0000 UTC
Value: 6
NumberDataPoints #1
Data point attributes:
     -> service.name: Str(dummy-service)
     -> operation: Str(GET /healthz)
     -> span.kind: Str(SPAN_KIND_SERVER)
     -> status.code: Str(STATUS_CODE_UNSET)
     -> net.host.port: Int(80)
     -> http.method: Str(GET)
     -> http.status_code: Int(200)
StartTimestamp: 2022-11-21 09:37:33.646666564 +0000 UTC
Timestamp: 2022-11-21 09:38:23.476303012 +0000 UTC
Value: 6

Currently if at least 1 datapoint matches my expression, then the whole metric is kept, with all datapoints.

Describe the solution you'd like

Add an option to filter out individual datapoints with expr filter, instead of whole metrics.

Describe alternatives you've considered

see: #16388

Additional context

No response

@adam-kiss-sg adam-kiss-sg added enhancement New feature or request needs triage New item requiring triage labels Nov 21, 2022
@github-actions github-actions bot added the processor/filter Filter processor label Nov 21, 2022
@github-actions
Copy link
Contributor

Pinging code owners:

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

@adam-kiss-sg
Copy link
Contributor Author

Closed by #16369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage processor/filter Filter processor
Projects
None yet
Development

No branches or pull requests

1 participant