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

[datadogexporter] Use a singleton for sublayer calculation #1759

Merged
merged 4 commits into from
Dec 11, 2020

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Dec 4, 2020

Description:

  • Use a single sublayer calculator per trace exporter. This reduces memory consumption at the expense of increased mutex contention. Ideally, we would use a sublayer calculator per worker with no need for mutexes but this is not currently possible.

Link to tracking Issue: aws-observability/aws-otel-collector#179

Testing: Unit tests were amended. Tested end to end and performance tested.

Ideally, we would use one sublayer calculator per worker as the Datadog
Agent does, but we can't here since we don't have access to the queue
consumers.
@project-bot project-bot bot added this to In progress in Collector Dec 4, 2020
@mx-psi mx-psi marked this pull request as ready for review December 4, 2020 16:33
@mx-psi mx-psi requested a review from a team as a code owner December 4, 2020 16:33
@codecov
Copy link

codecov bot commented Dec 4, 2020

Codecov Report

Merging #1759 (1345a4d) into master (d48fa8d) will increase coverage by 0.00%.
The diff coverage is 93.75%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1759   +/-   ##
=======================================
  Coverage   89.85%   89.85%           
=======================================
  Files         376      376           
  Lines       18180    18184    +4     
=======================================
+ Hits        16336    16340    +4     
  Misses       1383     1383           
  Partials      461      461           
Flag Coverage Δ
integration 69.77% <ø> (ø)
unit 88.55% <93.75%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
exporter/datadogexporter/model.go 73.68% <0.00%> (ø)
exporter/datadogexporter/trace_connection.go 59.64% <ø> (ø)
exporter/datadogexporter/stats.go 85.71% <100.00%> (ø)
exporter/datadogexporter/traces_exporter.go 81.57% <100.00%> (+2.16%) ⬆️
exporter/datadogexporter/translate_traces.go 82.14% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d48fa8d...1345a4d. Read the comment docs.

Copy link
Contributor

@ericmustin ericmustin left a comment

Choose a reason for hiding this comment

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

👍 lgtm, approving on behalf of datadog

@@ -26,8 +26,7 @@ const (
)

// ComputeAPMStats calculates the stats that should be submitted to APM about a given trace
func ComputeAPMStats(tracePayload *pb.TracePayload, calculator *stats.SublayerCalculator, pushTime int64) *stats.Payload {

func ComputeAPMStats(tracePayload *pb.TracePayload, calculator *sublayerCalculator, pushTime int64) *stats.Payload {
Copy link
Member

Choose a reason for hiding this comment

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

Why public?

Copy link
Member Author

@mx-psi mx-psi Dec 8, 2020

Choose a reason for hiding this comment

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

I was trying to maintain the visibility of existing functions that were already public. I have double checked with the person who wrote this code and these and other functions can be made private, so I have done so in commit 1345a4d.

I can also make these changes in a separate PR if need be.

exporter/datadogexporter/traces_exporter.go Outdated Show resolved Hide resolved
Collector automation moved this from In progress to Reviewer approved Dec 11, 2020
@bogdandrutu bogdandrutu merged commit f53bd40 into open-telemetry:master Dec 11, 2020
Collector automation moved this from Reviewer approved to Done Dec 11, 2020
@mx-psi mx-psi deleted the mx-psi/singleton-wrapper branch December 11, 2020 16:15
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
…er (#1759)

* add test to cover default configurations; update document for default max_elapsed_time value

* check type assertion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Collector
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants