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/Logzioexporter] logs support #10821

Merged
merged 28 commits into from
Jun 28, 2022
Merged

[exporter/Logzioexporter] logs support #10821

merged 28 commits into from
Jun 28, 2022

Conversation

yotamloe
Copy link
Contributor

@yotamloe yotamloe commented Jun 7, 2022

Description:
logzioexporter update:

  • Add support for logs pipeline
  • Remove logzio-go and jaeger-logzio dependencies
  • Add logzioSpan,logzioService,jsonLog in object directiry
  • Add support for exporter helper configuration options (queue, retry)
  • Generic export method for traces and logs using HTTP client
  • Warning logs for soon to be deprecated config options:
    • custom_endpoint
    • drain_interval
    • queue_capacity
    • queue_max_length

Testing:
Added tests for logs pipeline and for logzio objects in the following files:

  • exporter_test.go
  • config_test.go
  • factory_test.go
  • jsonlog_test.go
  • logziospan_test.go

Passing all unit tests:
coverage: 82% of statements
Documentation:

  • Added documentation for exporterhelper configuration option
  • Removed deprecated configuration options (custom_endpoint, drain_interval, queue_capacity, queue_max_length)
  • Added examples for traces and logs pipeline configuration

@yotamloe yotamloe requested a review from a team as a code owner June 7, 2022 14:01
@yotamloe yotamloe requested a review from Aneurysm9 June 7, 2022 14:01
@dashpole
Copy link
Contributor

dashpole commented Jun 7, 2022

It looks like the exporter was marked stable in #10324. Should we be making breaking changes to the configuration?

@yotamloe
Copy link
Contributor Author

yotamloe commented Jun 7, 2022

Hi, @dashpole thanks for replying.
The breaking changes are only for optional configuration options. We changed them to follow opentelemetry collector best practices (utilize exporterhelper). The struct that we used to represant logzio spans remained the same. (ref), and required configuration options as well.

@dashpole
Copy link
Contributor

dashpole commented Jun 7, 2022

You might want to consider gating the configuration change with a feature-gate. I did this in the googlecloud exporter when we made changes to our config. See https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/googlecloudexporter/factory.go#L55 for an example of using different configurations based on a feature-gate.

@dashpole
Copy link
Contributor

dashpole commented Jun 7, 2022

On a separate note, I don't see a CODEOWNERS entry for this component. It seems like you and potentially @jkowall or @Doron-Bargo (who were cc'd on the status header PR) would be reasonable owners?

@yotamloe
Copy link
Contributor Author

yotamloe commented Jun 7, 2022

Thanks for the advice @dashpole, I'll take a look at that :)
Regarding the code owners, I'll add the relevant people, should I do it in a different PR?

@dashpole
Copy link
Contributor

dashpole commented Jun 7, 2022

yes, please add owners in a separate PR. If you could have one of the other codeowners review this PR, that would be helpful.

@yotamloe
Copy link
Contributor Author

yotamloe commented Jun 7, 2022

I checked and looks like this component does have an entry in CODEOWNERS: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/.github/CODEOWNERS#L45
The addition was made in this PR

@yotamloe yotamloe changed the title Logzioexporter logs support [exporter/Logzioexporter] logs support Jun 8, 2022
@dashpole
Copy link
Contributor

dashpole commented Jun 8, 2022

Ah, sorry. I searched for logsio...

@yotamloe
Copy link
Contributor Author

yotamloe commented Jun 8, 2022

You might want to consider gating the configuration change with a feature-gate. I did this in the googlecloud exporter when we made changes to our config. See https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/googlecloudexporter/factory.go#L55 for an example of using different configurations based on a feature-gate.

Hi @dashpole :)
Is feature-gate a requirement for this addition? In case we decide to implement it, how long do usually components keep feature gates? (number of releases?)

@dashpole
Copy link
Contributor

dashpole commented Jun 8, 2022

You wouldn't need to feature-gate the addition of logs support -- just the removal of config options from your stable configuration.

You just have to abide by this, since your component is stable:

Breaking changes, including configuration options and the component's output are not expected to happen without prior notice, unless under special circumstances.

A feature-gate, which is initially disabled by default, is one way to provide prior notice of removal of those options, since users can temporarily (during beta) re-enable them. But if you have a different way you'd like to provide prior notice (e.g. a warning log when using one of the options you plan to remove), that would also be acceptable. You should have at least one release where it is in alpha and one in beta, after which you can remove the feature gate.

@yotamloe
Copy link
Contributor Author

yotamloe commented Jun 8, 2022

Ok, that makes sense.
So if ill keep the legacy options for the next releases, map the values to the new config options when possible (custom_endpoint -> endpoint for example) and add a warning log for upcoming deprecation and the alternative config options (when the legacy option is used), would that be acceptable?

@yotamloe
Copy link
Contributor Author

Hi @dashpole, I hope you had a nice weekend.
I added the warning messages and option mapping in the latest commit

Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

I've reviewed the config + readme changes, which look good. I'll defer to one of the codeowners (who are hopefully more familiar with logzio) to review the log exporter implementation.

exporter/logzioexporter/config.go Outdated Show resolved Hide resolved
exporter/logzioexporter/config.go Outdated Show resolved Hide resolved
exporter/logzioexporter/config.go Outdated Show resolved Hide resolved
exporter/logzioexporter/config.go Outdated Show resolved Hide resolved
exporter/logzioexporter/config.go Outdated Show resolved Hide resolved
@dashpole
Copy link
Contributor

I can't, since they don't appear to be org members. Its fine though; they can still review.

@yotamloe yotamloe requested a review from dashpole June 13, 2022 14:17
Copy link
Contributor

@Doron-Bargo Doron-Bargo left a comment

Choose a reason for hiding this comment

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

lgtm

@yotamloe
Copy link
Contributor Author

Hi @dashpole.
Anything else we need to move forward and approve this PR?

exporter/logzioexporter/README.md Show resolved Hide resolved
@mx-psi
Copy link
Member

mx-psi commented Jun 28, 2022

@yotamloe can you fix the merge conflicts?

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

This PR adds some new public API, is it intentional? In general, functions, methods and structs should be made private so that we can change the internals of the exporter without making breaking changes.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
exporter/logzioexporter/go.mod Outdated Show resolved Hide resolved
exporter/logzioexporter/logzioservice.go Outdated Show resolved Hide resolved
exporter/logzioexporter/logziospan.go Outdated Show resolved Hide resolved
exporter/logzioexporter/logziospan.go Outdated Show resolved Hide resolved
exporter/logzioexporter/logziospan.go Outdated Show resolved Hide resolved
exporter/logzioexporter/jsonlog.go Outdated Show resolved Hide resolved
@yotamloe
Copy link
Contributor Author

@mx-psi Done 😁

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Thanks!! Just a couple more that I missed and we can merge this :)

exporter/logzioexporter/factory.go Outdated Show resolved Hide resolved
@mx-psi mx-psi merged commit 494f4fc into open-telemetry:main Jun 28, 2022
atoulme pushed a commit to atoulme/opentelemetry-collector-contrib that referenced this pull request Jul 16, 2022
* [logzioexporter] logs pipeline support

* Update exporters_test.go (CustomEndpoint -> Endpoint)

* go mod tidy

* update CHANGELOG.md

* go mod tidy

* make goporto + go.opentelemetry.io/collector v0.49.0 -> v0.52.0

* go.opentelemetry.io/collector v0.52.0 -> v0.52.1-0.20220603175357-6fb884b2dbdc

* make gotidy

* Restore legacy config options + `CheckAndWarnDeprecatedOptions` method to warn for deprecation + unit test

* Change warn log messages + CheckAndWarnDeprecatedOptions -> checkAndWarnDeprecatedOptions

* Update changelog + Add opentelemetry links in README.md

* Rely on http client timeout instead of exporter helper

* go mod tidy + fix linting issues

* make gotidy

* Fix default value of timeout ( 5s -> 30s )

* Move changes to unreleased (CHANGELOG.md)

* Restore `replace` statement in go.mod

* Make unnecessary public variables and functions private

* Make gotidy

* make `CreateTracesExporter` and `CreateLogsExporter` private
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.

None yet

4 participants