-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Make Splunk HEC exporter send profiling data separately from logs #4464
Make Splunk HEC exporter send profiling data separately from logs #4464
Conversation
…hat was successfully sent before; prepare for adding profiling headers
@gsmirnov-splk thanks for putting the benchmark tests, the overhead looks acceptable to me. Could you please move the bugfix to another PR? |
Also please take a look at the linter issues |
Sure, here it is: #4467 Working on addressing the other comments now. |
# Conflicts: # exporter/splunkhecexporter/client_test.go
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.
Those changes look ok to me, with the explicit understanding that this is not the final form of profiling, but it fits right now for this use case.
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
Needs rebasing and updating the commit message / PR description (bug fix is no longer part of this PR). |
# Conflicts: # exporter/splunkhecexporter/client.go # exporter/splunkhecexporter/client_test.go
…pc/otelgrpc (open-telemetry#4464) Bumps [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.26.1 to 0.27.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](open-telemetry/opentelemetry-go-contrib@zpages/v0.26.1...zpages/v0.27.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description:
Splunk Profiling uses OTLP logs as the data transport at this time. To make entitlements work on the server side, we need to send this data separately, with a special HTTP header. This is achieved by keeping two separate buffers: one for regular logs and one for profiling data. The data is differentiated by looking at the
InstrumentationLibraryName
of log records, and the buffers are flushed separately. I did some minor refactoring, but did not go far with it yet, so @bjsignalfx @tigrannajaryan and @dmitryax, your feedback is very welcome.Testing:
Functionality is tested by the new
Test_pushLogData_ShouldAddHeadersForProfilingData
andTestSubLogs
tests. The bugfix is verified in theTest_pushLogData_ShouldReturnUnsentLogsOnly
test. I also made a docker image from this branch and tried pointing a profiling agent at it. I could see the correct HTTP headers on the HEC ingest endpoint.Performance-wise, I added the
Benchmark_pushLogData_<A>_<B>_<C>_<D>
tests, where:After running them locally (amd64, WSL2, Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz)
So, the overhead per op is 3-4% when there is no profiling data and 5-9% with mixed data. It also heavily depends on incoming batch size (as log record count) and the outgoing buffer size (as bytes). I could bring it up to 23% by using 1MB bodies for HTTP calls.
However, if I add a 10ms backoff to simulate HTTP call latency, the overhead based on the CPU time reported by go benchmarking suite drops to ~0%.