Skip to content

Commit

Permalink
[processor/cumulativetodelta] Update to use generated status (#20263)
Browse files Browse the repository at this point in the history
Updates cumulativetodeltaprocessor to use a generated status.

---------

Co-authored-by: Alex Boten <[email protected]>
  • Loading branch information
TylerHelmuth and codeboten authored Mar 23, 2023
1 parent 4c570f2 commit 39e5691
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
16 changes: 10 additions & 6 deletions processor/cumulativetodeltaprocessor/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Cumulative to Delta Processor

| Status | |
|--------------------------|---------------------------|
| Stability | [beta] |
| Supported pipeline types | metrics |
| Distributions | [contrib] |
<!-- status autogenerated section -->
| Status | |
| ------------------------ |-----------|
| Stability | [beta] |
| Supported pipeline types | metrics |
| Distributions | [contrib] |
| Warnings | [Statefulness](#warnings) |

[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
<!-- end autogenerated section -->

## Description

The cumulative to delta processor (`cumulativetodeltaprocessor`) converts monotonic, cumulative sum and histogram metrics to monotonic, delta metrics. Non-monotonic sums and exponential histograms are excluded.
Expand Down
2 changes: 2 additions & 0 deletions processor/cumulativetodeltaprocessor/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:generate mdatagen metadata.yaml

// package cumulativetodeltaprocessor implements a processor which
// converts cumulative sum metrics to cumulative delta.
package cumulativetodeltaprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor"
6 changes: 3 additions & 3 deletions processor/cumulativetodeltaprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/processorhelper"

"github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor/internal/metadata"
)

const (
// The value of "type" key in configuration.
typeStr = "cumulativetodelta"
// The stability level of the processor.
stability = component.StabilityLevelBeta
)

var processorCapabilities = consumer.Capabilities{MutatesData: true}
Expand All @@ -38,7 +38,7 @@ func NewFactory() processor.Factory {
return processor.NewFactory(
typeStr,
createDefaultConfig,
processor.WithMetrics(createMetricsProcessor, stability))
processor.WithMetrics(createMetricsProcessor, metadata.Stability))
}

func createDefaultConfig() component.Config {
Expand Down

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

8 changes: 8 additions & 0 deletions processor/cumulativetodeltaprocessor/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: cumulativetodelta

status:
type: processor
stability: beta
pipelines: [metrics]
distributions: [contrib]
warnings: [Statefulness]

0 comments on commit 39e5691

Please sign in to comment.