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 telemetry for dropped metrics, logs, and spans #29081

Merged
merged 22 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2a7e764
Add initial telemetry for filterprocessor metrics
MacroPower Nov 9, 2023
1c91896
Fix filterprocessor telemetry naming
MacroPower Nov 18, 2023
d26d745
Fix filterprocessor dropped telemetry, remove total metrics
MacroPower Nov 18, 2023
0b6cbe1
Create FilterMetricProcessor with processor.CreateSettings
MacroPower Nov 19, 2023
e6497ac
Add support for filterprocessor telemetry from logs, traces
MacroPower Nov 19, 2023
7137e77
Add filterprocessor log, trace telemetry
MacroPower Nov 19, 2023
b8d135e
Set filterprocessor typeStr from metadata.Type
MacroPower Nov 19, 2023
f369d41
Remove optional OTEL metrics from filterprocessor telemetry
MacroPower Nov 19, 2023
ceb5772
Merge branch 'main' into main
MacroPower Nov 19, 2023
1723cc4
Fix filterprocessor OC telemetry name, aggregation
MacroPower Nov 19, 2023
5fc1dbe
Add basic filterprocessor telemetry tests
MacroPower Nov 19, 2023
c7fafe4
Add changelog entry for new filterprocessor telemetry
MacroPower Nov 19, 2023
9cd8d28
Fix filterprocessor formatting/naming per linter
MacroPower Nov 19, 2023
fda6172
Merge remote-tracking branch 'upstream/main'
MacroPower Dec 18, 2023
17baacc
Count filterprocessor metric data points dropped
MacroPower Dec 18, 2023
e9c8424
Rename metrics.filtered to datapoints.filtered
MacroPower Dec 19, 2023
d3369ad
Merge branch 'main' into main
MacroPower Dec 19, 2023
91d1ab8
Merge remote-tracking branch 'upstream/main'
MacroPower Dec 19, 2023
4a300fd
Merge branch 'main' into main
MacroPower Dec 19, 2023
b7d2a42
Merge branch 'main' into main
TylerHelmuth Dec 19, 2023
6606f71
Merge branch 'main' into main
TylerHelmuth Dec 19, 2023
2f863ef
Merge branch 'main' into main
TylerHelmuth Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .chloggen/filterprocessor-telemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: filterprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add telemetry for metrics, logs, and spans that were intentionally dropped via filterprocessor.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [13169]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
6 changes: 3 additions & 3 deletions processor/filterprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func createMetricsProcessor(
cfg component.Config,
nextConsumer consumer.Metrics,
) (processor.Metrics, error) {
fp, err := newFilterMetricProcessor(set.TelemetrySettings, cfg.(*Config))
fp, err := newFilterMetricProcessor(set, cfg.(*Config))
if err != nil {
return nil, err
}
Expand All @@ -59,7 +59,7 @@ func createLogsProcessor(
cfg component.Config,
nextConsumer consumer.Logs,
) (processor.Logs, error) {
fp, err := newFilterLogsProcessor(set.TelemetrySettings, cfg.(*Config))
fp, err := newFilterLogsProcessor(set, cfg.(*Config))
if err != nil {
return nil, err
}
Expand All @@ -78,7 +78,7 @@ func createTracesProcessor(
cfg component.Config,
nextConsumer consumer.Traces,
) (processor.Traces, error) {
fp, err := newFilterSpansProcessor(set.TelemetrySettings, cfg.(*Config))
fp, err := newFilterSpansProcessor(set, cfg.(*Config))
if err != nil {
return nil, err
}
Expand Down
20 changes: 18 additions & 2 deletions processor/filterprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,41 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/filte
go 1.20

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.91.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.91.0
github.com/prometheus/client_golang v1.17.0
github.com/prometheus/client_model v0.5.0
github.com/prometheus/common v0.45.0
github.com/stretchr/testify v1.8.4
go.opencensus.io v0.24.0
go.opentelemetry.io/collector/component v0.91.0
go.opentelemetry.io/collector/confmap v0.91.0
go.opentelemetry.io/collector/consumer v0.91.0
go.opentelemetry.io/collector/pdata v1.0.0
go.opentelemetry.io/collector/processor v0.91.0
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/metric v1.21.0
go.opentelemetry.io/otel/sdk/metric v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.26.0
)

require (
github.com/alecthomas/participle/v2 v2.1.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/expr-lang/expr v1.15.7 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
Expand All @@ -34,26 +47,29 @@ require (
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
github.com/knadh/koanf/v2 v2.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opencensus.io v0.24.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
go.opentelemetry.io/collector v0.91.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect
go.opentelemetry.io/collector/featuregate v1.0.0 // indirect
go.opentelemetry.io/collector/semconv v0.91.0 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
Loading