-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add initial info on how to write a component #88
Add initial info on how to write a component #88
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding this.
core repository and core distribution of the Collector. | ||
[core repository](https://github.com/open-telemetry/opentelemetry-collector) and | ||
core distribution of the Collector. Typically, these contributions are vendor | ||
specific receivers/exporters and/or components that are either legacy or are only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: do we need to specifically mention "legacy" here? I think this sentence reads fine and serves the purpose without that reference.
- Each component has its own go.mod file. This allows custom builds of the | ||
collector to take a limited sets of dependencies - so run `go mod` commands as | ||
appropriate for your component. | ||
- Implement the needed interface on your component by importing the appropriate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a note here saying that while Collector is in Alpha stage the interfaces may undergo breaking changes and they must be ready to fix their component when such changes happen otherwise the component will be excluded from the default builds.
component from the core repo. Follow the pattern of existing components regarding | ||
config and factory soruce files and tests. | ||
- Implement your component as appropriate. Provide end-to-end tests (or mock | ||
backend/client as appropriate). Target is to get 80% of code coverage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend/client as appropriate). Target is to get 80% of code coverage. | |
backend/client as appropriate). Target is to get 80% or more of code coverage. |
I'd prefer to remove the reference to specific percentage once we will implement ratcheting based on coverage percentage (to fail the build if coverage goes down).
rules and there are exceptions to them, but, take care considering when you are | ||
not following them. | ||
|
||
- Avoid introducing asynchronicity on receivers and exporters. Typically, these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth explaining what "asynchronicity" means in this context.
reused by other receivers and exporters). | ||
- When implementing exporters try to leverage the exporter helpers from the core | ||
repo, see [exporterhelper package](https://github.com/open-telemetry/opentelemetry-collector/tree/master/exporter/exporterhelper) | ||
on core repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a rationale as to why this is a good thing to do?
[core repository](https://github.com/open-telemetry/opentelemetry-collector) and | ||
core distribution of the Collector. Typically, these contributions are vendor | ||
specific receivers/exporters and/or components that are either legacy or are only | ||
useful to relatively small number of users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to a
There was some feedback from initial PR that was not incorporated, see open-telemetry#88
There was some feedback from initial PR that was not incorporated, see #88
* Adds factory and new-style config for Logging exporter. * Add a todo for configuring log level
Some code got moved, so reflect that in the README.
Provide a bit more of information for people interested in writing components for the collector. This is just to provide the initial guidelines a give a ballpark of what needs to be done.