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

[exporter/coralogix] Create dynamic subsystem name #7957

Merged
merged 9 commits into from
Mar 14, 2022
Merged

[exporter/coralogix] Create dynamic subsystem name #7957

merged 9 commits into from
Mar 14, 2022

Conversation

ofirshmuel
Copy link
Contributor

@ofirshmuel ofirshmuel commented Feb 17, 2022

Description:

Create dynamic subsystem name for Coralogix endpoint.
The subsystem name is taken from the service_name of span.
Add exporter timeout option.

Link to tracking Issue:

Testing:

Documentation:

ApplicationName: c.cfg.AppName,
SubsystemName: subsystem,
}
c.cfg.GRPCClientSettings.Headers["subsystemName"] = subsystem
Copy link
Member

Choose a reason for hiding this comment

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

If your user has set this header themselves in the config, you are overriding it without warning. Be nice to your users and inform them that this is happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A warning message is added

exporter/coralogixexporter/config.go Show resolved Hide resolved
@jpkrohling jpkrohling changed the title create dynamic subsystem name [exporter/coralogix] Create dynamic subsystem name Feb 18, 2022
@oded-dd
Copy link
Contributor

oded-dd commented Feb 22, 2022

Hi @jpkrohling any update on the PR?

@ofirshmuel
Copy link
Contributor Author

searching for an issue with problems, freezing for now

@ofirshmuel ofirshmuel marked this pull request as draft February 23, 2022 15:48
@ofirshmuel ofirshmuel marked this pull request as ready for review March 8, 2022 16:30
@ofirshmuel
Copy link
Contributor Author

Hi @jpkrohling any updates?

@jpkrohling
Copy link
Member

See my comments about the config breaking compatibility with the previous version.

exporter/coralogixexporter/client.go Outdated Show resolved Hide resolved
@ofirshmuel
Copy link
Contributor Author

Hi @jpkrohling, according to your comment about breaking changes. I add the changes to the changelog file. In addition, I update the readme, tests and config_test file. The 'subsystems' config option is not available anymore.

@jpkrohling
Copy link
Member

@ofirshmuel, please go over the document I shared earlier: https://github.com/open-telemetry/opentelemetry-collector/blob/main/CONTRIBUTING.md#breaking-changes

The document above has concrete steps you should be taking to prevent breaking your users without notice. As it is, just removing the config option isn't acceptable without deprecating it first.

@ofirshmuel
Copy link
Contributor Author

@jpkrohling I mark the subsystem as deprecated and add more comments about it.
In the next version, I will open PR to remove it as mentioned in contributing document.

Metadata: &cxpb.Metadata{ApplicationName: c.cfg.AppName, SubsystemName: batch.GetProcess().GetServiceName()},
}, grpc.WaitForReady(c.cfg.WaitForReady))
if err != nil {
return fmt.Errorf("Failed to push trace data via Coralogix exporter %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

Please, follow the Go conventions by not uppercasing the first letter from the error message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the uppercase to lowercase according to the conventions.

}
c.logger.Debug("Trace was sent successfully")
} else {
return fmt.Errorf("Failed to push trace data via Coralogix exporter because batch.process.serviceName is empty")
Copy link
Member

Choose a reason for hiding this comment

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

Same here and possibly elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the uppercase to lowercase according to the conventions.

@@ -56,7 +58,7 @@ func (c *Config) Validate() error {
return fmt.Errorf("`appName` not specified, please fix the configuration file")
}
if c.SubSystem == "" {
return fmt.Errorf("`subSystem` not specified, please fix the configuration file")
return fmt.Errorf("`subSystem` not specified, please fix the configuration file.\nPay attention: deprecated subsystem will be removed in the next version")
Copy link
Member

Choose a reason for hiding this comment

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

Imagine error messages in a broader context: they bubble up and are printed to the user by the component that is the closest to the user, collecting all the breadcrumbs until it gets there. In that context, new lines aren't desirable, as your message would end up looking like this:

2022-03-11 14:10:12.1234 ERR could not start blurbs: failed to parse config file: `subSystem` not specified, please fix the configuration file
Pay attention: deprecated subsystem will be removed in the next version.

That said, you should really make room for your users to migrate to the replacement already. If they won't be allowed to specify this option, then make it possible for your users to not specify this already and leave their config files ready for the next version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @jpkrohling , I fixed the error message and let the users add or remove 'subsystem' option from the config file in this version.

exporter/coralogixexporter/config.go Show resolved Hide resolved
@jpkrohling jpkrohling merged commit d050ab7 into open-telemetry:main Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants