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

Implements file reading for peer tags to synchronize cross repo usage #25600

Merged
merged 27 commits into from
May 30, 2024

Conversation

zarirhamza
Copy link
Contributor

@zarirhamza zarirhamza commented May 14, 2024

What does this PR do?

Make the defaultPeerTags list read from a file so that file can be synchronized with other repos that use peer tags

Part of a larger set of changes to come where common tag names are sourced from a single source of truth across DD repos

The planned source of truth will generate static files which can be read by the agent code and synchronized across all DD repos involving peer tags

How to test

Ensure that service map behavior is unchanged namely the features related to peer.* tags. Specifically, the connections between services in the service map remain unchanged

Run TestPreparePeerTags in concentrator_test.go

Part of larger changes to come where common tag names are sourced from a single source of truth across DD repos
The planned source of truth will generate static files which can be read by the agent code and synchronized across all DD repos involving peer tags
@bits-bot
Copy link
Collaborator

bits-bot commented May 14, 2024

CLA assistant check
All committers have signed the CLA.

@zarirhamza zarirhamza requested a review from majorgreys May 14, 2024 17:48
@github-actions github-actions bot added team/agent-apm trace-agent team/opentelemetry OpenTelemetry team labels May 14, 2024
@zarirhamza zarirhamza requested a review from ajgajg1134 May 14, 2024 17:48
@zarirhamza
Copy link
Contributor Author

Probably going to shift away from the csv style but for now a place holder until @majorgreys decides on the final expected format to read values from

@zarirhamza zarirhamza removed the team/opentelemetry OpenTelemetry team label May 14, 2024
@pr-commenter
Copy link

pr-commenter bot commented May 14, 2024

Regression Detector

Regression Detector Results

Run ID: 93cb6abb-3864-4870-8ca4-6628907c0c63
Baseline: 344ecd7
Comparison: 1f5cc9f

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI
tcp_syslog_to_blackhole ingress throughput +7.41 [-14.80, +29.63]
uds_dogstatsd_to_api_cpu % cpu utilization +2.37 [-0.69, +5.43]
basic_py_check % cpu utilization +1.76 [-1.14, +4.65]
file_tree memory utilization +1.02 [+0.92, +1.12]
pycheck_1000_100byte_tags % cpu utilization +0.96 [-3.70, +5.61]
tcp_dd_logs_filter_exclude ingress throughput +0.07 [+0.02, +0.11]
otel_to_otel_logs ingress throughput +0.02 [-0.34, +0.39]
uds_dogstatsd_to_api ingress throughput +0.00 [-0.20, +0.20]
trace_agent_json ingress throughput +0.00 [-0.01, +0.01]
trace_agent_msgpack ingress throughput -0.00 [-0.00, +0.00]
idle memory utilization -0.12 [-0.16, -0.08]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@pr-commenter
Copy link

pr-commenter bot commented May 14, 2024

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv create-vm --pipeline-id=35476282 --os-family=ubuntu

Goal is to have values stored in ini file which is now parsed as expected
@pr-commenter

This comment has been minimized.

@pr-commenter

This comment has been minimized.

Copy link

cit-pr-commenter bot commented May 15, 2024

Go Package Import Differences

Baseline: 344ecd7
Comparison: 1f5cc9f

binaryosarchchange
serverlesslinuxamd64
+1, -0
+gopkg.in/ini.v1
serverlesslinuxarm64
+1, -0
+gopkg.in/ini.v1
trace-agentlinuxamd64
+1, -0
+gopkg.in/ini.v1
trace-agentlinuxarm64
+1, -0
+gopkg.in/ini.v1
trace-agentwindowsamd64
+1, -0
+gopkg.in/ini.v1
trace-agentdarwinamd64
+1, -0
+gopkg.in/ini.v1
trace-agentdarwinarm64
+1, -0
+gopkg.in/ini.v1
heroku-trace-agentlinuxamd64
+1, -0
+gopkg.in/ini.v1

Due to mismatches between remapping on backend and previous list, several tags are inserted and removed to ensure the final list is the same as before
This may change in the future in order to ensure all behavior is consistent
Tests are also added to ensure similar behavior
@pr-commenter

This comment has been minimized.

@pr-commenter

This comment has been minimized.

Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 54.56%. Comparing base (344ecd7) to head (1f5cc9f).
Report is 20 commits behind head on main.

Files Patch % Lines
pkg/trace/stats/concentrator.go 76.47% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #25600       +/-   ##
===========================================
+ Coverage   45.08%   54.56%    +9.47%     
===========================================
  Files        2340      456     -1884     
  Lines      269884    39061   -230823     
===========================================
- Hits       121683    21312   -100371     
+ Misses     138581    16776   -121805     
+ Partials     9620      973     -8647     
Flag Coverage Δ
amzn_aarch64 55.92% <76.47%> (+10.01%) ⬆️
centos_x86_64 55.94% <76.47%> (+10.12%) ⬆️
ubuntu_aarch64 55.94% <76.47%> (+10.02%) ⬆️
ubuntu_x86_64 55.93% <76.47%> (+10.02%) ⬆️
windows_amd64 56.71% <76.47%> (+5.36%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zarirhamza
Copy link
Contributor Author

Final format style is determined to be INI. PR is finished and ready for review but note there are a few mismatches between the backend and agent aggregation. To avoid any breaking changes, some tags are manually added and removed but that may change in the future once discussed with the stats team

@zarirhamza zarirhamza marked this pull request as ready for review May 21, 2024 16:57
@zarirhamza zarirhamza requested review from a team as code owners May 21, 2024 16:58
@zarirhamza zarirhamza requested a review from ankitpatel96 May 21, 2024 16:58
Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Could you do a quick sanity check on whether OTel collector can still build with this change? Basically

  1. get a pseudo version of pkg/trace & comp/otelcol/otlp/components/statsprocessor
  2. use it in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/datadogexporter/go.mod#L25
  3. run make otelcontribcol

@zarirhamza
Copy link
Contributor Author

Could you do a quick sanity check on whether OTel collector can still build with this change? Basically

  1. get a pseudo version of pkg/trace & comp/otelcol/otlp/components/statsprocessor
  2. use it in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/datadogexporter/go.mod#L25
  3. run make otelcontribcol

Ran it locally by cloning the otel repo, replacing the packages with the local new versions, and ran the make command to no errors

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Approval for OTel-owned files

@songy23 songy23 removed the request for review from ankitpatel96 May 29, 2024 16:17
Copy link
Contributor

@DylanLovesCoffee DylanLovesCoffee left a comment

Choose a reason for hiding this comment

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

LGTM for Serverless

@zarirhamza
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented May 29, 2024

🚂 MergeQueue

Pull request added to the queue.

This build is going to start soon! (estimated merge in less than 26m)

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented May 29, 2024

❌ MergeQueue

Tests failed on this commit 9869771

You should fix those tests and then re-add your pull request to the queue!

Details

some checks are failing:

If you need support, contact us on Slack #devflow with those details!

@zarirhamza zarirhamza requested review from a team as code owners May 29, 2024 19:41
@pr-commenter

This comment has been minimized.

@pr-commenter

This comment has been minimized.

@pr-commenter

This comment has been minimized.

Copy link
Contributor

@dustmop dustmop left a comment

Choose a reason for hiding this comment

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

LGTM for agent-shared-components

cmd/serverless/dependencies_linux_amd64.txt Outdated Show resolved Hide resolved
cmd/serverless/dependencies_linux_arm64.txt Outdated Show resolved Hide resolved
@pr-commenter

This comment has been minimized.

@pr-commenter
Copy link

pr-commenter bot commented May 30, 2024

Benchmarks

Benchmark execution time: 2024-05-30 15:55:45

Comparing candidate commit 1f5cc9f in PR branch zarir/semantic-core-peer-tag-aggregation with baseline commit babd88d in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2 metrics, 1 unstable metrics.

Copy link
Contributor

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between cab6958 and 8c47317.

tl;dr

Use these benchmarks as an insight tool during development.

  1. Skim down the vs base column in each chart. If there is a ~, then there was no statistically significant change to the benchmark. Otherwise, ensure the estimated percent change is either negative or very small.

  2. The last row of each chart is the geomean. Ensure this percentage is either negative or very small.

What is this benchmarking?

The BenchmarkStartEndInvocation compares the amount of time it takes to call the start-invocation and end-invocation endpoints. For universal instrumentation languages (Dotnet, Golang, Java, Ruby), this represents the majority of the duration overhead added by our tracing layer.

The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type.

How do I interpret these charts?

The charts below comes from benchstat. They represent the statistical change in duration (sec/op), memory overhead (B/op), and allocations (allocs/op).

The benchstat docs explain how to interpret these charts.

Before the comparison table, we see common file-level configuration. If there are benchmarks with different configuration (for example, from different packages), benchstat will print separate tables for each configuration.

The table then compares the two input files for each benchmark. It shows the median and 95% confidence interval summaries for each benchmark before and after the change, and an A/B comparison under "vs base". ... The p-value measures how likely it is that any differences were due to random chance (i.e., noise). The "~" means benchstat did not detect a statistically significant difference between the two inputs. ...

Note that "statistically significant" is not the same as "large": with enough low-noise data, even very small changes can be distinguished from noise and considered statistically significant. It is, of course, generally easier to distinguish large changes from noise.

Finally, the last row of the table shows the geometric mean of each column, giving an overall picture of how the benchmarks changed. Proportional changes in the geomean reflect proportional changes in the benchmarks. For example, given n benchmarks, if sec/op for one of them increases by a factor of 2, then the sec/op geomean will increase by a factor of ⁿ√2.

I need more help

First off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development.

If you would like a hand interpreting the results come chat with us in #serverless-agent in the internal DataDog slack or in #serverless in the public DataDog slack. We're happy to help!

Benchmark stats
goos: linux
goarch: amd64
pkg: github.com/DataDog/datadog-agent/pkg/serverless/daemon
cpu: AMD EPYC 7763 64-Core Processor                
                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │         sec/op         │    sec/op     vs base               │
api-gateway-appsec.json                            85.99µ ± 4%    89.85µ ± 5%  +4.48% (p=0.009 n=10)
api-gateway-kong-appsec.json                       67.87µ ± 2%    68.91µ ± 1%       ~ (p=0.165 n=10)
api-gateway-kong.json                              66.83µ ± 2%    67.46µ ± 1%       ~ (p=0.280 n=10)
api-gateway-non-proxy-async.json                   106.0µ ± 2%    107.6µ ± 1%       ~ (p=0.052 n=10)
api-gateway-non-proxy.json                         105.5µ ± 1%    105.0µ ± 1%       ~ (p=0.063 n=10)
api-gateway-websocket-connect.json                 69.96µ ± 3%    69.71µ ± 1%       ~ (p=0.353 n=10)
api-gateway-websocket-default.json                 63.12µ ± 1%    63.36µ ± 2%       ~ (p=0.315 n=10)
api-gateway-websocket-disconnect.json              62.76µ ± 1%    63.32µ ± 2%       ~ (p=0.063 n=10)
api-gateway.json                                   114.2µ ± 1%    114.9µ ± 1%       ~ (p=0.165 n=10)
application-load-balancer.json                     62.86µ ± 1%    63.42µ ± 1%  +0.89% (p=0.009 n=10)
cloudfront.json                                    48.03µ ± 2%    48.13µ ± 3%       ~ (p=0.912 n=10)
cloudwatch-events.json                             38.99µ ± 2%    38.72µ ± 2%       ~ (p=0.971 n=10)
cloudwatch-logs.json                               65.46µ ± 2%    66.22µ ± 2%       ~ (p=0.724 n=10)
custom.json                                        30.68µ ± 1%    30.40µ ± 2%       ~ (p=0.105 n=10)
dynamodb.json                                      92.86µ ± 1%    93.56µ ± 1%       ~ (p=0.075 n=10)
empty.json                                         29.49µ ± 3%    29.15µ ± 2%       ~ (p=0.123 n=10)
eventbridge-custom.json                            41.66µ ± 2%    41.54µ ± 1%       ~ (p=0.529 n=10)
http-api.json                                      72.87µ ± 2%    73.56µ ± 2%       ~ (p=0.165 n=10)
kinesis-batch.json                                 70.59µ ± 2%    71.81µ ± 1%  +1.73% (p=0.000 n=10)
kinesis.json                                       53.86µ ± 1%    53.52µ ± 2%       ~ (p=0.448 n=10)
s3.json                                            58.75µ ± 2%    59.57µ ± 1%  +1.41% (p=0.035 n=10)
sns-batch.json                                     89.28µ ± 3%    90.51µ ± 2%       ~ (p=0.190 n=10)
sns.json                                           63.73µ ± 1%    64.73µ ± 2%  +1.57% (p=0.015 n=10)
snssqs.json                                        111.2µ ± 2%    111.8µ ± 1%       ~ (p=0.280 n=10)
snssqs_no_dd_context.json                          98.10µ ± 2%   100.62µ ± 2%  +2.57% (p=0.007 n=10)
sqs-aws-header.json                                55.08µ ± 3%    55.60µ ± 2%       ~ (p=0.143 n=10)
sqs-batch.json                                     92.48µ ± 3%    94.78µ ± 2%  +2.49% (p=0.023 n=10)
sqs.json                                           68.62µ ± 2%    69.89µ ± 3%       ~ (p=0.143 n=10)
sqs_no_dd_context.json                             62.11µ ± 2%    61.37µ ± 3%       ~ (p=0.315 n=10)
geomean                                            66.76µ         67.29µ       +0.79%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │          B/op          │     B/op      vs base               │
api-gateway-appsec.json                           37.20Ki ± 0%   37.19Ki ± 0%       ~ (p=0.867 n=10)
api-gateway-kong-appsec.json                      26.80Ki ± 0%   26.80Ki ± 0%       ~ (p=0.838 n=10)
api-gateway-kong.json                             24.29Ki ± 0%   24.28Ki ± 0%       ~ (p=0.781 n=10)
api-gateway-non-proxy-async.json                  47.99Ki ± 0%   48.00Ki ± 0%       ~ (p=0.565 n=10)
api-gateway-non-proxy.json                        47.21Ki ± 0%   47.20Ki ± 0%       ~ (p=0.424 n=10)
api-gateway-websocket-connect.json                25.40Ki ± 0%   25.40Ki ± 0%       ~ (p=0.564 n=10)
api-gateway-websocket-default.json                21.31Ki ± 0%   21.31Ki ± 0%       ~ (p=0.870 n=10)
api-gateway-websocket-disconnect.json             21.09Ki ± 0%   21.08Ki ± 0%       ~ (p=0.403 n=10)
api-gateway.json                                  49.46Ki ± 0%   49.45Ki ± 0%       ~ (p=0.897 n=10)
application-load-balancer.json                    23.18Ki ± 0%   23.17Ki ± 0%       ~ (p=0.288 n=10)
cloudfront.json                                   17.59Ki ± 0%   17.59Ki ± 0%       ~ (p=0.643 n=10)
cloudwatch-events.json                            11.64Ki ± 0%   11.64Ki ± 0%       ~ (p=0.810 n=10)
cloudwatch-logs.json                              53.29Ki ± 0%   53.28Ki ± 0%       ~ (p=0.670 n=10)
custom.json                                       9.672Ki ± 0%   9.654Ki ± 0%       ~ (p=0.210 n=10)
dynamodb.json                                     40.61Ki ± 0%   40.60Ki ± 0%       ~ (p=0.615 n=10)
empty.json                                        9.225Ki ± 0%   9.218Ki ± 0%       ~ (p=0.287 n=10)
eventbridge-custom.json                           13.37Ki ± 0%   13.36Ki ± 0%       ~ (p=0.566 n=10)
http-api.json                                     23.70Ki ± 0%   23.69Ki ± 0%       ~ (p=0.470 n=10)
kinesis-batch.json                                26.97Ki ± 0%   26.98Ki ± 0%       ~ (p=0.404 n=10)
kinesis.json                                      17.75Ki ± 0%   17.75Ki ± 0%       ~ (p=0.897 n=10)
s3.json                                           20.29Ki ± 0%   20.29Ki ± 0%       ~ (p=0.670 n=10)
sns-batch.json                                    38.54Ki ± 0%   38.53Ki ± 0%       ~ (p=0.853 n=10)
sns.json                                          23.94Ki ± 0%   23.89Ki ± 0%  -0.22% (p=0.008 n=10)
snssqs.json                                       50.58Ki ± 0%   50.57Ki ± 0%       ~ (p=0.615 n=10)
snssqs_no_dd_context.json                         44.77Ki ± 0%   44.77Ki ± 0%       ~ (p=0.529 n=10)
sqs-aws-header.json                               18.80Ki ± 1%   18.77Ki ± 0%       ~ (p=0.353 n=10)
sqs-batch.json                                    41.51Ki ± 0%   41.57Ki ± 0%  +0.15% (p=0.027 n=10)
sqs.json                                          25.47Ki ± 1%   25.50Ki ± 0%       ~ (p=0.149 n=10)
sqs_no_dd_context.json                            20.64Ki ± 1%   20.70Ki ± 0%       ~ (p=0.063 n=10)
geomean                                           25.67Ki        25.67Ki       -0.01%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │       allocs/op        │ allocs/op   vs base                 │
api-gateway-appsec.json                             629.5 ± 0%   629.0 ± 0%       ~ (p=1.000 n=10)
api-gateway-kong-appsec.json                        488.0 ± 0%   488.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-kong.json                               466.0 ± 0%   466.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-non-proxy-async.json                    725.0 ± 0%   725.0 ± 0%       ~ (p=1.000 n=10)
api-gateway-non-proxy.json                          716.0 ± 0%   716.0 ± 0%       ~ (p=0.582 n=10)
api-gateway-websocket-connect.json                  453.0 ± 0%   453.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-websocket-default.json                  379.0 ± 0%   379.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-websocket-disconnect.json               369.0 ± 0%   369.0 ± 0%       ~ (p=0.582 n=10)
api-gateway.json                                    790.0 ± 0%   790.0 ± 0%       ~ (p=1.000 n=10)
application-load-balancer.json                      353.0 ± 0%   352.5 ± 0%       ~ (p=1.000 n=10)
cloudfront.json                                     284.0 ± 0%   283.5 ± 0%       ~ (p=1.000 n=10)
cloudwatch-events.json                              220.0 ± 0%   220.0 ± 0%       ~ (p=0.474 n=10)
cloudwatch-logs.json                                215.0 ± 0%   215.0 ± 0%       ~ (p=1.000 n=10)
custom.json                                         168.0 ± 0%   168.0 ± 0%       ~ (p=1.000 n=10) ¹
dynamodb.json                                       588.5 ± 0%   588.0 ± 0%       ~ (p=0.650 n=10)
empty.json                                          159.0 ± 1%   159.0 ± 1%       ~ (p=1.000 n=10)
eventbridge-custom.json                             254.0 ± 0%   253.0 ± 0%       ~ (p=0.656 n=10)
http-api.json                                       432.0 ± 0%   432.0 ± 0%       ~ (p=0.635 n=10)
kinesis-batch.json                                  390.0 ± 0%   390.5 ± 0%       ~ (p=0.237 n=10)
kinesis.json                                        285.0 ± 0%   285.0 ± 0%       ~ (p=1.000 n=10)
s3.json                                             357.5 ± 0%   357.5 ± 0%       ~ (p=1.000 n=10)
sns-batch.json                                      454.0 ± 0%   454.0 ± 0%       ~ (p=0.580 n=10)
sns.json                                            323.0 ± 0%   322.5 ± 0%       ~ (p=0.053 n=10)
snssqs.json                                         445.5 ± 0%   445.0 ± 0%       ~ (p=0.269 n=10)
snssqs_no_dd_context.json                           399.0 ± 0%   399.0 ± 0%       ~ (p=0.339 n=10)
sqs-aws-header.json                                 274.0 ± 1%   273.0 ± 0%       ~ (p=0.232 n=10)
sqs-batch.json                                      502.5 ± 0%   503.0 ± 0%       ~ (p=0.136 n=10)
sqs.json                                            350.5 ± 1%   351.0 ± 0%       ~ (p=0.129 n=10)
sqs_no_dd_context.json                              324.5 ± 0%   325.0 ± 0%       ~ (p=0.170 n=10)
geomean                                             376.4        376.3       -0.03%
¹ all samples are equal

@zarirhamza
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented May 30, 2024

🚂 MergeQueue

Pull request added to the queue.

There are 3 builds ahead! (estimated merge in less than 2h)

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit 49deb26 into main May 30, 2024
227 of 228 checks passed
@dd-mergequeue dd-mergequeue bot deleted the zarir/semantic-core-peer-tag-aggregation branch May 30, 2024 18:21
@github-actions github-actions bot added this to the 7.55.0 milestone May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants