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

Add support for dynamic histogram metrics #5239

Merged
merged 11 commits into from
May 27, 2021

Conversation

axw
Copy link
Member

@axw axw commented May 6, 2021

Motivation/summary

Introduce support for specifying metric type and unit.

If these are set for any metrics in a metricset, we will create a _metric_descriptions field which is used in a new ingest processor. The ingest processor uses these properties to set dynamic_templates. Currently we only understand the type "histogram", and unit is ignored. Later we will add support for "summary" metrics, and for setting field metadata for metric type (gauge, counter), and for units (byte, percent, nanos, etc.)

The OTLP processor is updated to consume histogram metrics accordingly. We will follow up with support for the Elastic APM metrics intake in another PR.

Checklist

How to test these changes

  1. Run apm-server
  2. Instrument an application with OpenTelemetry, capturing metrics configured to be sent as histograms

Related issues

#3195

@axw axw added the v7.14.0 label May 6, 2021
@apmmachine
Copy link
Contributor

apmmachine commented May 6, 2021

💔 Tests Failed

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 #5239 updated

  • Start Time: 2021-05-27T00:29:40.253+0000

  • Duration: 47 min 37 sec

  • Commit: abfcf29

Test stats 🧪

Test Results
Failed 1
Passed 6261
Skipped 120
Total 6382

Trends 🧪

Image of Build Times

Image of Tests

Test errors 1

Expand to view the tests failures

Build and Test / APM Integration Tests / test_concurrent_req_java_spring_foobar – tests.agent.test_java
    Expand to view the error details

     AssertionError: queried for [('processor.event', 'transaction'), ('service.name', ['springapp', 'springapp'])], expected 1375, got 1374 
    

    Expand to view the stacktrace

     java_spring = <tests.fixtures.agents.Agent object at 0x7f161c114fd0>
    
        @pytest.mark.java_spring
        def test_concurrent_req_java_spring_foobar(java_spring):
            foo = Concurrent.Endpoint(java_spring.foo.url,
                                      java_spring.app_name,
                                      ["foo"],
                                      "GreetingController#foo",
                                      events_no=375)
            bar = Concurrent.Endpoint(java_spring.bar.url,
                                      java_spring.app_name,
                                      ["bar", "extra"],
                                      "GreetingController#bar")
    >       Concurrent(java_spring.apm_server.elasticsearch, [foo, bar], iters=1).run()
    
    tests/agent/test_java.py:39: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/agent/concurrent_requests.py:254: in run
        self.check_counts(it)
    tests/agent/concurrent_requests.py:138: in check_counts
        assert_count([("processor.event", "transaction"), ("service.name", service_names)], transactions_count)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    terms = [('processor.event', 'transaction'), ('service.name', ['springapp', 'springapp'])]
    expected = 1375
    
        def assert_count(terms, expected):
            """wait a bit for doc count to reach expectation"""
            @timeout_decorator.timeout(max_wait)
            def check_count(mut_actual):
                while True:
                    rsp = self.es.count(index=self.index, body=self.elasticsearch.term_q(terms))
                    mut_actual[0] = rsp["count"]
                    if mut_actual[0] >= expected:
                        return
                    time.sleep(backoff)
        
            mut_actual = [-1]  # keep actual count in this mutable
            try:
                check_count(mut_actual)
            except timeout_decorator.TimeoutError:
                pass
            actual = mut_actual[0]
    >       assert actual == expected, err.format(terms, expected, actual)
    E       AssertionError: queried for [('processor.event', 'transaction'), ('service.name', ['springapp', 'springapp'])], expected 1375, got 1374
    
    tests/agent/concurrent_requests.py:132: AssertionError 
    

Steps errors 1

Expand to view the steps failures

Test Sync
  • Took 4 min 37 sec . View more details on here
  • Description: ./.ci/scripts/sync.sh

Log output

Expand to view the last 100 lines of log output

[2021-05-27T01:14:49.731Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2021-05-27T01:14:49.788Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86.zip
[2021-05-27T01:14:50.920Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86.zip.sha512
[2021-05-27T01:14:50.985Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86_64.zip
[2021-05-27T01:14:52.155Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86_64.zip.sha512
[2021-05-27T01:14:52.210Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-x86_64.rpm
[2021-05-27T01:14:53.856Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-x86_64.rpm.sha512
[2021-05-27T01:14:53.941Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-aarch64.rpm
[2021-05-27T01:14:55.175Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-aarch64.rpm.sha512
[2021-05-27T01:14:55.243Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-amd64.deb
[2021-05-27T01:14:56.688Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-amd64.deb.sha512
[2021-05-27T01:14:56.743Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-arm64.deb
[2021-05-27T01:14:58.019Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-arm64.deb.sha512
[2021-05-27T01:14:58.076Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz
[2021-05-27T01:14:59.371Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz.sha512
[2021-05-27T01:14:59.425Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i386.deb
[2021-05-27T01:15:00.768Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i386.deb.sha512
[2021-05-27T01:15:00.821Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i686.rpm
[2021-05-27T01:15:02.219Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i686.rpm.sha512
[2021-05-27T01:15:02.273Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-05-27T01:15:09.194Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-05-27T01:15:09.247Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-arm64.tar.gz
[2021-05-27T01:15:10.533Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-arm64.tar.gz.sha512
[2021-05-27T01:15:10.610Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86.tar.gz
[2021-05-27T01:15:11.960Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86.tar.gz.sha512
[2021-05-27T01:15:12.017Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2021-05-27T01:15:13.494Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2021-05-27T01:15:13.560Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86.zip
[2021-05-27T01:15:14.847Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86.zip.sha512
[2021-05-27T01:15:14.914Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86_64.zip
[2021-05-27T01:15:16.315Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86_64.zip.sha512
[2021-05-27T01:15:16.371Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-x86_64.rpm
[2021-05-27T01:15:17.760Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-x86_64.rpm.sha512
[2021-05-27T01:15:17.826Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-05-27T01:15:21.499Z] Warning: A secret was passed to "googleStorageUpload" using Groovy String interpolation, which is insecure.
[2021-05-27T01:15:21.499Z] 		 Affected argument(s) used the following variable(s): [JOB_GCS_BUCKET]
[2021-05-27T01:15:21.499Z] 		 See https://jenkins.io/redirect/groovy-string-interpolation for details.
[2021-05-27T01:15:21.516Z] [Google Cloud Storage Plugin] Found 54 files to upload from pattern: src/github.com/elastic/apm-server/build/distributions/**/*
[2021-05-27T01:15:21.391Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-05-27T01:15:21.564Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-aarch64.rpm
[2021-05-27T01:15:23.239Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-aarch64.rpm.sha512
[2021-05-27T01:15:23.298Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-amd64.deb
[2021-05-27T01:15:25.109Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-amd64.deb.sha512
[2021-05-27T01:15:25.161Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-arm64.deb
[2021-05-27T01:15:26.747Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-arm64.deb.sha512
[2021-05-27T01:15:26.886Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz
[2021-05-27T01:15:28.653Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz.sha512
[2021-05-27T01:15:28.697Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-i386.deb
[2021-05-27T01:15:30.404Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-i386.deb.sha512
[2021-05-27T01:15:30.446Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-i686.rpm
[2021-05-27T01:15:32.061Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-i686.rpm.sha512
[2021-05-27T01:15:32.115Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-05-27T01:15:39.294Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-05-27T01:15:39.356Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-arm64.tar.gz
[2021-05-27T01:15:40.928Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-arm64.tar.gz.sha512
[2021-05-27T01:15:40.972Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86.tar.gz
[2021-05-27T01:15:42.710Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86.tar.gz.sha512
[2021-05-27T01:15:42.762Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2021-05-27T01:15:44.541Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2021-05-27T01:15:44.586Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86.zip
[2021-05-27T01:15:45.699Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86.zip.sha512
[2021-05-27T01:15:45.751Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86_64.zip
[2021-05-27T01:15:46.942Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-windows-x86_64.zip.sha512
[2021-05-27T01:15:47.030Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-x86_64.rpm
[2021-05-27T01:15:48.688Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-8.0.0-SNAPSHOT-x86_64.rpm.sha512
[2021-05-27T01:15:48.736Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-aarch64.rpm
[2021-05-27T01:15:50.067Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-aarch64.rpm.sha512
[2021-05-27T01:15:50.137Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-amd64.deb
[2021-05-27T01:15:51.544Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-amd64.deb.sha512
[2021-05-27T01:15:51.584Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-arm64.deb
[2021-05-27T01:15:52.857Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-arm64.deb.sha512
[2021-05-27T01:15:52.931Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz
[2021-05-27T01:15:54.184Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-darwin-x86_64.tar.gz.sha512
[2021-05-27T01:15:54.223Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i386.deb
[2021-05-27T01:15:55.608Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i386.deb.sha512
[2021-05-27T01:15:55.731Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i686.rpm
[2021-05-27T01:15:57.179Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-i686.rpm.sha512
[2021-05-27T01:15:57.228Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-05-27T01:16:04.119Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-05-27T01:16:04.166Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-arm64.tar.gz
[2021-05-27T01:16:05.471Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-arm64.tar.gz.sha512
[2021-05-27T01:16:05.510Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86.tar.gz
[2021-05-27T01:16:06.904Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86.tar.gz.sha512
[2021-05-27T01:16:06.950Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
[2021-05-27T01:16:08.355Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz.sha512
[2021-05-27T01:16:08.409Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86.zip
[2021-05-27T01:16:09.383Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86.zip.sha512
[2021-05-27T01:16:09.435Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86_64.zip
[2021-05-27T01:16:10.512Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-windows-x86_64.zip.sha512
[2021-05-27T01:16:10.560Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-x86_64.rpm
[2021-05-27T01:16:11.976Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-oss-8.0.0-SNAPSHOT-x86_64.rpm.sha512
[2021-05-27T01:16:12.047Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
[2021-05-27T01:16:15.626Z] [Google Cloud Storage Plugin] Uploading: src/github.com/elastic/apm-server/build/distributions/apm-server-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz.sha512
[2021-05-27T01:16:16.167Z] Running on Jenkins in /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-5239
[2021-05-27T01:16:16.228Z] [INFO] getVaultSecret: Getting secrets
[2021-05-27T01:16:16.282Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-05-27T01:16:17.335Z] + chmod 755 generate-build-data.sh
[2021-05-27T01:16:17.335Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5239/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5239/runs/10 UNSTABLE 2796818
[2021-05-27T01:16:17.335Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5239/runs/10/steps/?limit=10000 -o steps-info.json
[2021-05-27T01:16:17.585Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5239/runs/10/tests/?status=FAILED -o tests-errors.json

@axw axw mentioned this pull request May 6, 2021
1 task
@axw axw marked this pull request as ready for review May 6, 2021 09:30
@mergify
Copy link
Contributor

mergify bot commented May 12, 2021

This pull request is now in conflicts. Could you fix it @axw? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b metrics-intake-type-unit upstream/metrics-intake-type-unit
git merge upstream/master
git push upstream metrics-intake-type-unit

@axw axw requested a review from a team May 24, 2021 08:05
model/metricset.go Show resolved Hide resolved
for i, count := range bucketCounts {
if count > 0 {
counts = append(counts, int64(count))
values = append(values, explicitBounds[i])
Copy link
Contributor

Choose a reason for hiding this comment

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

from the otel code:

// The number of elements in bucket_counts array must be by one greater than
// the number of elements in explicit_bounds array.

Wouldn't that lead to an index-out-of-bound exception for explicitBounds[i]?

Copy link
Contributor

Choose a reason for hiding this comment

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

The tests should also be updated if this is the case, as the slices representing bucket_counts and explicit_bounds are equal length

Copy link
Member Author

Choose a reason for hiding this comment

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

Yikes, good catch @simitt. I guess the system test was passing due to luck, and the last entry had a zero count. Looking into it now; probably should be recording the midpoints.

stuartnelson3
stuartnelson3 previously approved these changes May 25, 2021
@stuartnelson3
Copy link
Contributor

Dis-regard my approval, @simitt is bringing her expert knowledge to bear :)

@stuartnelson3 stuartnelson3 dismissed their stale review May 25, 2021 07:45

New questions have been brought to light

Handle histogram bucket counts correctly, following the
approach taken by Prometheus.
@axw axw requested review from simitt and stuartnelson3 May 26, 2021 02:44
@mergify
Copy link
Contributor

mergify bot commented May 26, 2021

This pull request is now in conflicts. Could you fix it @axw? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b metrics-intake-type-unit upstream/metrics-intake-type-unit
git merge upstream/master
git push upstream metrics-intake-type-unit

Copy link
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.

left one minor comment, apart from that LGTM

// bucket is assumed to be 0 if the upper bound of that bucket is greater than 0. In that
// case, the usual linear interpolation is applied within that bucket. Otherwise, the upper
// bound of the lowest bucket is returned for quantiles located in the lowest bucket."
values := make([]float64, 0, len(explicitBounds))
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't values := make([]float64, 0, len(bucketCounts)) make sense now?

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed, another good catch :) fixed, thanks

@axw axw merged commit 91645bd into elastic:master May 27, 2021
@axw axw deleted the metrics-intake-type-unit branch May 27, 2021 01:39
mergify bot pushed a commit that referenced this pull request May 27, 2021
* model/metricset: add "histogram" dynamic_template

* ingest/pipeline: handle metric descriptions

* model: add metric type and unit

* processor/otel: translate histogram metrics

* Update changelog

* processor/otel: fix histogram translation

Handle histogram bucket counts correctly, following the
approach taken by Prometheus.

* processor/otel: fix merge

* processor/otel: use appropriate slice cap

(cherry picked from commit 91645bd)

# Conflicts:
#	changelogs/head.asciidoc
#	include/fields.go
axw added a commit that referenced this pull request May 27, 2021
* Add support for dynamic histogram metrics (#5239)

* model/metricset: add "histogram" dynamic_template

* ingest/pipeline: handle metric descriptions

* model: add metric type and unit

* processor/otel: translate histogram metrics

* Update changelog

* processor/otel: fix histogram translation

Handle histogram bucket counts correctly, following the
approach taken by Prometheus.

* processor/otel: fix merge

* processor/otel: use appropriate slice cap

(cherry picked from commit 91645bd)

# Conflicts:
#	changelogs/head.asciidoc
#	include/fields.go

* fix merge

Co-authored-by: Andrew Wilkins <[email protected]>
axw added a commit that referenced this pull request May 27, 2021
@simitt simitt self-assigned this Jul 9, 2021
mergify bot pushed a commit that referenced this pull request Jul 9, 2021
* model/metricset: add "histogram" dynamic_template

* ingest/pipeline: handle metric descriptions

* model: add metric type and unit

* processor/otel: translate histogram metrics

* Update changelog

* processor/otel: fix histogram translation

Handle histogram bucket counts correctly, following the
approach taken by Prometheus.

* processor/otel: fix merge

* processor/otel: use appropriate slice cap

(cherry picked from commit 91645bd)

# Conflicts:
#	apmpackage/apm/0.2.0/data_stream/app_metrics/elasticsearch/ingest_pipeline/default.json
#	apmpackage/apm/0.2.0/data_stream/error_logs/elasticsearch/ingest_pipeline/default.json
#	apmpackage/apm/0.2.0/data_stream/internal_metrics/elasticsearch/ingest_pipeline/default.json
#	apmpackage/apm/0.2.0/data_stream/profile_metrics/elasticsearch/ingest_pipeline/default.json
#	apmpackage/apm/0.2.0/data_stream/traces/elasticsearch/ingest_pipeline/default.json
#	apmpackage/apm/data_stream/app_metrics/elasticsearch/ingest_pipeline/apm_metrics_dynamic_template.json
#	apmpackage/apm/data_stream/error_logs/elasticsearch/ingest_pipeline/apm_metrics_dynamic_template.json
#	apmpackage/apm/data_stream/internal_metrics/elasticsearch/ingest_pipeline/apm_metrics_dynamic_template.json
#	apmpackage/apm/data_stream/profile_metrics/elasticsearch/ingest_pipeline/apm_metrics_dynamic_template.json
#	apmpackage/apm/data_stream/traces/elasticsearch/ingest_pipeline/apm_metrics_dynamic_template.json
#	changelogs/head.asciidoc
#	include/fields.go
#	processor/otel/metrics.go
#	processor/otel/metrics_test.go
@simitt
Copy link
Contributor

simitt commented Jul 12, 2021

Tesetd with BC 2 - histogram metrics are ingested, and dynamic mapping is added

Screenshot 2021-07-12 at 11 06 00

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.

4 participants