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

[receiver/filestats] promote to alpha #21257

Merged
merged 2 commits into from
May 1, 2023
Merged
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
16 changes: 16 additions & 0 deletions .chloggen/filestats-alpha.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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: filestatsreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Promote filestats receiver to alpha, add to the otelcontribcol tests.

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

# (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:
2 changes: 2 additions & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ receivers:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver v0.76.1
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/expvarreceiver v0.76.1
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.76.1
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver v0.76.1
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver v0.76.1
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.76.1
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver v0.76.1
Expand Down Expand Up @@ -375,6 +376,7 @@ replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/parquetexporter => ../../exporter/parquetexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver => ../../extension/observer/ecstaskobserver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver => ../../receiver/lokireceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver => ../../receiver/filestatsreceiver
# see https://github.com/mattn/go-ieproxy/issues/45
- github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1
- github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest
Expand Down
2 changes: 2 additions & 0 deletions cmd/otelcontribcol/components.go

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

3 changes: 3 additions & 0 deletions cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver v0.76.1
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/expvarreceiver v0.76.1
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.76.1
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver v0.76.1
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver v0.76.1
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.76.1
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver v0.76.1
Expand Down Expand Up @@ -1035,6 +1036,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/obse

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver => ../../receiver/lokireceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver => ../../receiver/filestatsreceiver

replace github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest
Expand Down
3 changes: 3 additions & 0 deletions cmd/otelcontribcol/receivers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ func TestDefaultReceivers(t *testing.T) {
return cfg
},
},
{
receiver: "filestats",
},
{
receiver: "flinkmetrics",
},
Expand Down
4 changes: 2 additions & 2 deletions receiver/filestatsreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<!-- status autogenerated section -->
| Status | |
| ------------------------ |-----------|
| Stability | [development] |
| Stability | [alpha] |
| Supported pipeline types | metrics |
| Distributions | [contrib] |

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

Expand Down
8 changes: 2 additions & 6 deletions receiver/filestatsreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver/internal/metadata"
)

const (
typeStr = "filestats"
)

// NewFactory creates a new HAProxy receiver factory.
// NewFactory creates a new filestats receiver factory.
func NewFactory() receiver.Factory {
return receiver.NewFactory(
typeStr,
metadata.Type,
newDefaultConfig,
receiver.WithMetrics(newReceiver, metadata.Stability))
}
Expand Down
6 changes: 4 additions & 2 deletions receiver/filestatsreceiver/filestats_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func collectStats(now pcommon.Timestamp, fileinfo os.FileInfo, metricsBuilder *m
stat := fileinfo.Sys().(*syscall.Stat_t)
atime := stat.Atim.Sec
ctime := stat.Ctim.Sec
metricsBuilder.RecordFileAtimeDataPoint(now, atime)
metricsBuilder.RecordFileCtimeDataPoint(now, ctime, fileinfo.Mode().Perm().String())
//nolint
metricsBuilder.RecordFileAtimeDataPoint(now, int64(atime))
//nolint
metricsBuilder.RecordFileCtimeDataPoint(now, int64(ctime), fileinfo.Mode().Perm().String())
}

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

2 changes: 1 addition & 1 deletion receiver/filestatsreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type: filestats

status:
class: receiver
stability: development
stability: alpha
pipelines: [metrics]
distributions: [contrib]

Expand Down