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

Applied the feedback from community to our extension #17

Merged
merged 3 commits into from
May 14, 2024

Conversation

jerrytfleung
Copy link

@jerrytfleung jerrytfleung commented May 13, 2024

Applied the PR feedback from community to our extension.

  1. It fixed the shutdown problem.
  2. Changed noop to getting soft disabled settings from collector
  3. Reverted validate method to config

@jerrytfleung jerrytfleung marked this pull request as ready for review May 13, 2024 22:02
@jerrytfleung jerrytfleung requested a review from a team May 13, 2024 22:02

type Config struct {
Endpoint string `mapstructure:"endpoint"`
Key string `mapstructure:"key"`
Interval time.Duration `mapstructure:"interval"`
}

const (

Choose a reason for hiding this comment

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

Do these consts need to be public? If not, I'd make them private by lower-casing the first letter.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, all examples from otel collector & otel collector contrib repo are in capital letter

Copy link

@swi-jared swi-jared left a comment

Choose a reason for hiding this comment

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

Minor nits, looks good otherwise

}

func resolveServiceNameBestEffort() string {
if otelServiceName, otelServiceNameDefined := os.LookupEnv("OTEL_SERVICE_NAME"); otelServiceNameDefined && len(otelServiceName) > 0 {

Choose a reason for hiding this comment

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

Idiomatically, it's OK to use and re-use names. For this and the similar version below I'd stick with if name, ok :=

Copy link
Author

Choose a reason for hiding this comment

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

Thanks! Fixed!

@jerrytfleung jerrytfleung merged commit 35650ed into swo May 14, 2024
2 checks passed
@jerrytfleung jerrytfleung deleted the swo-applied-PR-comment-from-community branch May 14, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants