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

Add initial metricstarttimeprocessor skeleton #37464

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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/metricstarttime-skeleton.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: 'new_component'

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

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

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

# (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: The component is still in development and is not ready for use.

# 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, api]
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ processor/k8sattributesprocessor/ @open-telemetry
processor/logdedupprocessor/ @open-telemetry/collector-contrib-approvers @MikeGoldsmith @djaglowski
processor/logstransformprocessor/ @open-telemetry/collector-contrib-approvers @dehaansa
processor/metricsgenerationprocessor/ @open-telemetry/collector-contrib-approvers @Aneurysm9
processor/metricstarttimeprocessor/ @open-telemetry/collector-contrib-approvers @dashpole
processor/metricstransformprocessor/ @open-telemetry/collector-contrib-approvers @dmitryax
processor/probabilisticsamplerprocessor/ @open-telemetry/collector-contrib-approvers @jpkrohling @jmacd
processor/redactionprocessor/ @open-telemetry/collector-contrib-approvers @dmitryax @mx-psi @TylerHelmuth
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ body:
- processor/logdedup
- processor/logstransform
- processor/metricsgeneration
- processor/metricstarttime
- processor/metricstransform
- processor/probabilisticsampler
- processor/redaction
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ body:
- processor/logdedup
- processor/logstransform
- processor/metricsgeneration
- processor/metricstarttime
- processor/metricstransform
- processor/probabilisticsampler
- processor/redaction
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ body:
- processor/logdedup
- processor/logstransform
- processor/metricsgeneration
- processor/metricstarttime
- processor/metricstransform
- processor/probabilisticsampler
- processor/redaction
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/unmaintained.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ body:
- processor/logdedup
- processor/logstransform
- processor/metricsgeneration
- processor/metricstarttime
- processor/metricstransform
- processor/probabilisticsampler
- processor/redaction
Expand Down
1 change: 1 addition & 0 deletions processor/metricstarttimeprocessor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
10 changes: 10 additions & 0 deletions processor/metricstarttimeprocessor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [development]: metrics |
| Distributions | [] |
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Fmetricstarttime%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Fmetricstarttime) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Fmetricstarttime%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Fmetricstarttime) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dashpole](https://www.github.com/dashpole) |

[development]: https://github.com/open-telemetry/opentelemetry-collector#development
<!-- end autogenerated section -->
18 changes: 18 additions & 0 deletions processor/metricstarttimeprocessor/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package metricstarttimeprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstarttimeprocessor"

import (
"go.opentelemetry.io/collector/component"
)

// Config holds configuration of the metric start time processor.
type Config struct{}

var _ component.Config = (*Config)(nil)

// Validate checks the configuration is valid
func (cfg *Config) Validate() error {
return nil
}
7 changes: 7 additions & 0 deletions processor/metricstarttimeprocessor/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml

// Package metricstarttimeprocessor sets the start time of cumulative metric points when the start time is unknown.
package metricstarttimeprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstarttimeprocessor"
37 changes: 37 additions & 0 deletions processor/metricstarttimeprocessor/factory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package metricstarttimeprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstarttimeprocessor"

import (
"context"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"

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

// NewFactory creates a new metric start time processor factory.
func NewFactory() processor.Factory {
return processor.NewFactory(
metadata.Type,
createDefaultConfig,
processor.WithMetrics(createMetricsProcessor, metadata.MetricsStability))
}

func createDefaultConfig() component.Config {
return &Config{}
}

// createMetricsProcessor creates a metrics processor based on provided config.
func createMetricsProcessor(
ctx context.Context,
set processor.Settings,
cfg component.Config,
nextConsumer consumer.Metrics,
) (processor.Metrics, error) {
rCfg := cfg.(*Config)
return newMetricStartTimeProcessor(ctx, set, nextConsumer, rCfg)
}
135 changes: 135 additions & 0 deletions processor/metricstarttimeprocessor/generated_component_test.go

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

12 changes: 12 additions & 0 deletions processor/metricstarttimeprocessor/generated_package_test.go

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

55 changes: 55 additions & 0 deletions processor/metricstarttimeprocessor/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstarttimeprocessor

go 1.22.0

require (
github.com/stretchr/testify v1.10.0
go.opentelemetry.io/collector/component v0.118.0
go.opentelemetry.io/collector/component/componenttest v0.118.0
go.opentelemetry.io/collector/confmap v1.24.0
go.opentelemetry.io/collector/consumer v1.24.0
go.opentelemetry.io/collector/consumer/consumertest v0.118.0
go.opentelemetry.io/collector/pdata v1.24.0
go.opentelemetry.io/collector/processor v0.118.0
go.opentelemetry.io/collector/processor/processortest v0.118.0
go.uber.org/goleak v1.3.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
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.1.2 // indirect
github.com/mitchellh/copystructure v1.2.0 // 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/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/component/componentstatus v0.118.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.118.0 // indirect
go.opentelemetry.io/collector/consumer/xconsumer v0.118.0 // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.118.0 // indirect
go.opentelemetry.io/collector/pdata/testdata v0.118.0 // indirect
go.opentelemetry.io/collector/pipeline v0.118.0 // indirect
go.opentelemetry.io/collector/processor/xprocessor v0.118.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/metric v1.32.0 // indirect
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect
go.opentelemetry.io/otel/trace v1.32.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.4 // indirect
google.golang.org/protobuf v1.36.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading