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

[WIP] fluentd exporter #42

Closed
wants to merge 14 commits into from
Closed

[WIP] fluentd exporter #42

wants to merge 14 commits into from

Conversation

maxgolov
Copy link
Contributor

@maxgolov maxgolov commented Jun 22, 2021

@lalitb - Draft implementation of fluentd exporter.

What I'm still working on:

PR includes the test setup needed to run a test fluent agent: fluentd or fluentbit, both work. It also works with specific of MDSD custom protocol. MDSD itself is available in open Azure Container Registry. I can elaborate on that setup (how to use this exporter to send telemetry to Azure mdsd via fluent) in a separate document.

@lalitb
Copy link
Member

lalitb commented Jun 22, 2021

Thanks @maxgolov will have a look.

@maxgolov
Copy link
Contributor Author

I added async uploader with batching queue, configurable reconnection retries, and configurable wait time between batch uploads. Plus E2E tests. E2E test starts up "fluentd-alike" listener, that accepts MsgPack encoded fluentd forward protocol. And verifies that expected number of events have arrived. It also prints the JSON representation of MsgPack in console.

E2E tests depend on another PR in the main repo, that implements tests socket server for TCP, UDP and Unix Domain sockets. Test server included here is not intended to be used in production, for testing only, and fundamentally it's an improvement on top of HTTP server we use elsewhere. Now it supports not only HTTP, but raw TCP, UDP and Unix Domain cross-plat.

@echo off
pushd %~dp0
echo Building docker image in %CD%...
docker build --rm -t opentelemetry-fluentd ./
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to check in fluentd docker files here? We can just document how to invoke fluentd docker container - either by pulling from Dockerhub or cloning from fluentd repo. This will ensure the latest images are used?

Copy link
Member

@lalitb lalitb Jul 6, 2021

Choose a reason for hiding this comment

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

Also, the example dir should ideally contain the example to create a fluentd exporter?

-- Build files have been written to: /home/<user>/source/opentelemetry-cpp/build
$
```

Copy link
Member

Choose a reason for hiding this comment

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

Will it build successfully if cmake is involved directly from the contrib repo, assuming that the opentelemetry-cpp is already installed? If yes, would be good to document that here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that is not how it is supposed to be built. It is expected to be built as an overlay on top of main repo.

LOG_TRACE("sending %zu Span event(s)", obj[1].size());
std::vector<uint8_t> msg = nlohmann::json::to_msgpack(obj);
// Schedule upload of Span event(s)
Enqueue(msg);
Copy link
Member

@lalitb lalitb Jul 6, 2021

Choose a reason for hiding this comment

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

So, we are batching the events here, and sending them through a separate thread, to optimize the number of TCP connections? As per the specs, the Exporter::Export() method should really be doing the export through the transmission channels, and the return status should be the actual status of transmission: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#exportbatch

There is already a batch span processor to handle any such batching needs.

@lalitb
Copy link
Member

lalitb commented Sep 15, 2021

Closing this PR. Plan is to consolidate the changes in this PR along with the socket library introduced in open-telemetry/opentelemetry-cpp#871 and raise common PR.

@lalitb lalitb closed this Sep 15, 2021
@marcalff marcalff added the exporter:fluentd Fluentd Exporter label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter:fluentd Fluentd Exporter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fluentd forward exporter
3 participants