Skip to content

Commit

Permalink
Remove deprecated funcs form processorhelper.ObsReport
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed Sep 27, 2024
1 parent 431fd11 commit 628d39f
Show file tree
Hide file tree
Showing 13 changed files with 484 additions and 349 deletions.
25 changes: 25 additions & 0 deletions .chloggen/rm-deprecated-func.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

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

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note:

# One or more tracking issues or pull requests related to the change
issues: []

# (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:

# 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: []
55 changes: 55 additions & 0 deletions processor/memorylimiterprocessor/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)

# memory_limiter

## Internal Telemetry

The following telemetry is emitted by this component.

### otelcol_processor_accepted_log_records

Number of log records successfully pushed into the next component in the pipeline. [deprecated since v0.110.0]

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {records} | Sum | Int | true |

### otelcol_processor_accepted_metric_points

Number of metric points successfully pushed into the next component in the pipeline. [deprecated since v0.110.0]

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {datapoints} | Sum | Int | true |

### otelcol_processor_accepted_spans

Number of spans successfully pushed into the next component in the pipeline. [deprecated since v0.110.0]

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {spans} | Sum | Int | true |

### otelcol_processor_refused_log_records

Number of log records that were rejected by the next component in the pipeline. [deprecated since v0.110.0]

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {records} | Sum | Int | true |

### otelcol_processor_refused_metric_points

Number of metric points that were rejected by the next component in the pipeline. [deprecated since v0.110.0]

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {datapoints} | Sum | Int | true |

### otelcol_processor_refused_spans

Number of spans that were rejected by the next component in the pipeline. [deprecated since v0.110.0]

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {spans} | Sum | Int | true |
11 changes: 6 additions & 5 deletions processor/memorylimiterprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/pipeline"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/memorylimiterprocessor/internal/metadata"
"go.opentelemetry.io/collector/processor/processorhelper"
Expand Down Expand Up @@ -50,7 +51,7 @@ func (f *factory) createTracesProcessor(
cfg component.Config,
nextConsumer consumer.Traces,
) (processor.Traces, error) {
memLimiter, err := f.getMemoryLimiter(set, cfg)
memLimiter, err := f.getMemoryLimiter(set, cfg, pipeline.SignalTraces)
if err != nil {
return nil, err
}
Expand All @@ -67,7 +68,7 @@ func (f *factory) createMetricsProcessor(
cfg component.Config,
nextConsumer consumer.Metrics,
) (processor.Metrics, error) {
memLimiter, err := f.getMemoryLimiter(set, cfg)
memLimiter, err := f.getMemoryLimiter(set, cfg, pipeline.SignalMetrics)
if err != nil {
return nil, err
}
Expand All @@ -84,7 +85,7 @@ func (f *factory) createLogsProcessor(
cfg component.Config,
nextConsumer consumer.Logs,
) (processor.Logs, error) {
memLimiter, err := f.getMemoryLimiter(set, cfg)
memLimiter, err := f.getMemoryLimiter(set, cfg, pipeline.SignalLogs)
if err != nil {
return nil, err
}
Expand All @@ -97,15 +98,15 @@ func (f *factory) createLogsProcessor(

// getMemoryLimiter checks if we have a cached memoryLimiter with a specific config,
// otherwise initialize and add one to the store.
func (f *factory) getMemoryLimiter(set processor.Settings, cfg component.Config) (*memoryLimiterProcessor, error) {
func (f *factory) getMemoryLimiter(set processor.Settings, cfg component.Config, signal pipeline.Signal) (*memoryLimiterProcessor, error) {
f.lock.Lock()
defer f.lock.Unlock()

if memLimiter, ok := f.memoryLimiters[cfg]; ok {
return memLimiter, nil
}

memLimiter, err := newMemoryLimiterProcessor(set, cfg.(*Config))
memLimiter, err := newMemoryLimiterProcessor(set, cfg.(*Config), signal)
if err != nil {
return nil, err
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 628d39f

Please sign in to comment.