Skip to content

Set metricset.name for breakdown metrics#4910

Merged
axw merged 4 commits intoelastic:masterfrom
axw:metricset-name-breakdown
Mar 9, 2021
Merged

Set metricset.name for breakdown metrics#4910
axw merged 4 commits intoelastic:masterfrom
axw:metricset-name-breakdown

Conversation

@axw
Copy link
Copy Markdown
Member

@axw axw commented Mar 4, 2021

Motivation/summary

Introduce model/modelprocessor.SetMetricsetName, which sets metricset.name for well-known (breakdown) agent metrics.

  • Transaction breakdown metric sets (transaction.breakdown.count, etc.) will be named "transaction_breakdown".
  • Span breakdown metric sets (span.self_time.*) will be named "span_breakdown".
  • All other agent metric sets will be named "app".

Checklist

How to test these changes

  1. Instrument an app with any Elastic APM agent that supports breakdown metrics (should be all current versions).
  2. Send some requests, wait >30s for the agent to send breakdown metrics.
  3. Check the breakdown and system/process/runtime metric docs in Elasticsearch have a metricset.name field with the expected names.

Related issues

Closes #4392

@axw axw force-pushed the metricset-name-breakdown branch 2 times, most recently from 48a331f to 9649cf6 Compare March 4, 2021 02:08
@ghost
Copy link
Copy Markdown

ghost commented Mar 4, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #4910 updated

  • Start Time: 2021-03-09T00:14:32.116+0000

  • Duration: 47 min 9 sec

  • Commit: af04d83

Test stats 🧪

Test Results
Failed 0
Passed 4752
Skipped 117
Total 4869

Trends 🧪

Image of Build Times

Image of Tests

@axw axw force-pushed the metricset-name-breakdown branch 4 times, most recently from 1c077d1 to f3d2a86 Compare March 4, 2021 06:47
@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 4, 2021

Codecov Report

Merging #4910 (9360f82) into master (3a51cc5) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4910      +/-   ##
==========================================
+ Coverage   76.64%   76.65%   +0.01%     
==========================================
  Files         166      167       +1     
  Lines       10143    10158      +15     
==========================================
+ Hits         7774     7787      +13     
- Misses       2369     2371       +2     
Impacted Files Coverage Δ
beater/beater.go 69.49% <100.00%> (-0.58%) ⬇️
model/modelprocessor/metricsetname.go 100.00% <100.00%> (ø)
...ack/apm-server/aggregation/txmetrics/aggregator.go 93.24% <0.00%> (ø)

@axw axw force-pushed the metricset-name-breakdown branch from f3d2a86 to 9ab9f12 Compare March 4, 2021 12:45
Copy link
Copy Markdown
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

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

Looks good on a first high level review

@axw axw force-pushed the metricset-name-breakdown branch from 02cba85 to 5dadb13 Compare March 8, 2021 01:41
axw added 2 commits March 8, 2021 10:54
Introduce model/modelprocessor.SetMetricsetName,
which sets metricset.name for all agent metrics.
Breakdown metrics get a specific name, everything
else is named "app".

Also, add Go system tests for metrics and get rid
of a couple of Python-based ones.
tests/system/metricset.approved.json is used for
generating docs. Until we change hat, we can't
get rid of this test.
@axw axw force-pushed the metricset-name-breakdown branch from 5dadb13 to 9360f82 Compare March 8, 2021 02:54
@axw axw marked this pull request as ready for review March 8, 2021 13:40
@axw axw requested a review from simitt March 8, 2021 13:40
continue
}
ms.Name = appMetricsetName
if ms.Transaction.Type == "" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: would it make sense to move the code for defining when a metricset is a transaction_breakdown and when it is a span_breakdown directly to the metricset model? And then only consume this information here for setting the proper names?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd rather not, but let's continue discussing this later. Ultimately I'd like the model package to be more or less just a data representation, along the lines of https://github.com/elastic/apm-agent-go/tree/master/model. I have in mind that all business logic, anything to do with interpreting or processing the types, will live outside the model package.

@axw axw merged commit 5747c1d into elastic:master Mar 9, 2021
@axw axw deleted the metricset-name-breakdown branch March 9, 2021 01:04
@axw axw removed the test-plan label Mar 9, 2021
axw added a commit to axw/apm-server that referenced this pull request Mar 26, 2021
* Set metricset.name for breakdown metrics

Introduce model/modelprocessor.SetMetricsetName,
which sets metricset.name for all agent metrics.
Breakdown metrics get a specific name, everything
else is named "app".

Also, add Go system tests for metrics and get rid
of a couple of Python-based ones.

* tests/system: reinstate metricset system test

tests/system/metricset.approved.json is used for
generating docs. Until we change hat, we can't
get rid of this test.
# Conflicts:
#	changelogs/head.asciidoc
axw added a commit that referenced this pull request Mar 26, 2021
* Set metricset.name for breakdown metrics

Introduce model/modelprocessor.SetMetricsetName,
which sets metricset.name for all agent metrics.
Breakdown metrics get a specific name, everything
else is named "app".

Also, add Go system tests for metrics and get rid
of a couple of Python-based ones.

* tests/system: reinstate metricset system test

tests/system/metricset.approved.json is used for
generating docs. Until we change hat, we can't
get rid of this test.
# Conflicts:
#	changelogs/head.asciidoc
mergify bot pushed a commit that referenced this pull request Apr 27, 2021
* Set metricset.name for breakdown metrics

Introduce model/modelprocessor.SetMetricsetName,
which sets metricset.name for all agent metrics.
Breakdown metrics get a specific name, everything
else is named "app".

Also, add Go system tests for metrics and get rid
of a couple of Python-based ones.

* tests/system: reinstate metricset system test

tests/system/metricset.approved.json is used for
generating docs. Until we change hat, we can't
get rid of this test.

(cherry picked from commit 5747c1d)

# Conflicts:
#	beater/beater.go
#	changelogs/head.asciidoc
#	systemtest/approvals/TestApprovedMetrics.approved.json
@simitt
Copy link
Copy Markdown
Contributor

simitt commented May 6, 2021

tested with BC-4 and go-apm-agent - works as expected

@simitt simitt self-assigned this May 6, 2021
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.

Field to identify different kinds of metrics

4 participants