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

[chore] add promtail receiver to otelcontribcol #18225

Closed
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
2 changes: 1 addition & 1 deletion cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver v0.70.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusexecreceiver v0.70.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.70.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/promtailreceiver v0.0.0-00010101000000-000000000000 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/promtailreceiver v0.70.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver v0.70.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/purefareceiver v0.70.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/purefbreceiver v0.70.0 // indirect
Expand Down
1 change: 1 addition & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ receivers:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver v0.70.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver v0.70.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.70.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/promtailreceiver v0.70.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/purefareceiver v0.70.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/purefbreceiver v0.70.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/rabbitmqreceiver v0.70.0
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.

76 changes: 66 additions & 10 deletions cmd/otelcontribcol/go.mod

Large diffs are not rendered by default.

418 changes: 403 additions & 15 deletions cmd/otelcontribcol/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver v0.70.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusexecreceiver v0.70.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.70.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/promtailreceiver v0.0.0-00010101000000-000000000000
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/promtailreceiver v0.70.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/pulsarreceiver v0.70.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/purefareceiver v0.70.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/purefbreceiver v0.70.0
Expand Down
6 changes: 3 additions & 3 deletions receiver/promtailreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ func NewConfigWithID(operatorID string) *Config {
}

type PromtailInputConfig struct {
PositionsConfig positions.Config `mapstructure:"positions,omitempty" yaml:"positions,omitempty"`
ScrapeConfig []scrapeconfig.Config `mapstructure:"scrape_configs,omitempty" yaml:"scrape_configs,omitempty"`
TargetConfig file.Config `mapstructure:"target_config,omitempty" yaml:"target_config,omitempty"`
PositionsConfig positions.Config `mapstructure:"-" yaml:"positions,omitempty"`
ScrapeConfig []scrapeconfig.Config `mapstructure:"-" yaml:"scrape_configs,omitempty"`
TargetConfig file.Config `mapstructure:"-" yaml:"target_config,omitempty"`
}
Comment on lines 54 to 58
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

@mar4uk mar4uk Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test

func TestValidateConfigs(t *testing.T) {
failed because inner structs don't have mapstructure tags, they only have yaml tags.

Since promtail config has its own Unmarshall method that uses yaml.Marshal, yaml.Unmarshal methods, mapstructure tag is not needed here


type Config struct {
Expand Down