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

[AWS] Add API Gateway metrics data stream #6188

Merged
merged 24 commits into from
Jun 5, 2023

Conversation

lucian-ioan
Copy link
Contributor

@lucian-ioan lucian-ioan commented May 12, 2023

What does this PR do?

Adds API Gateway metrics datastream which covers HTTP, REST and Websocket APIs.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author checklist

  • Add unit metric types
  • Add docs

Related issues

Concerns #6058
Closes #6270

@lucian-ioan lucian-ioan changed the title Add API Gateway [AWS] Add API Gateway metrics data stream May 12, 2023
@elasticmachine
Copy link

elasticmachine commented May 12, 2023

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-05T14:21:24.786+0000

  • Duration: 54 min 57 sec

Test stats 🧪

Test Results
Failed 0
Passed 190
Skipped 4
Total 194

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented May 14, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (15/15) 💚
Files 93.75% (15/16) 👍
Classes 93.75% (15/16) 👍
Methods 85.921% (238/277) 👎 -0.211
Lines 85.925% (7387/8597) 👍
Conditionals 100.0% (0/0) 💚

@lucian-ioan lucian-ioan self-assigned this May 15, 2023
@lucian-ioan lucian-ioan marked this pull request as ready for review May 15, 2023 14:05
@lucian-ioan lucian-ioan requested a review from a team as a code owner May 15, 2023 14:05
Copy link
Member

@shmsr shmsr left a comment

Choose a reason for hiding this comment

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

Left some comments.

@lucian-ioan
Copy link
Contributor Author

lucian-ioan commented May 16, 2023

@shmsr I was also confused by this for the longest time, not sure why AWS chose this naming scheme.

Under https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html, there are three "Working with..." for the supported APIs (HTTP, REST, WebSockets), each with variations in metrics/dimensions under Monitor/Metrics tab (ex: 4XXError for REST vs 4xx for HTTP).

There are also some mentions of 4XXError metrics:
https://github.com/aws/aws-cdk/blob/b885ece7285ebe8219dbe4d62ae80554bd657632/packages/aws-cdk-lib/aws-apigateway/test/method.test.ts#L947

Snippet of event I got in elasticsearch from REST:

          "aws": {
            "apigateway": {
              "metrics": {
                "4XXError": {
                  "sum": 0
                },
                "Count": {
                  "sum": 6
                },
                "5XXError": {
                  "sum": 0
                },
                "IntegrationLatency": {
                  "avg": 2.6
                },
                "Latency": {
                  "avg": 4.5
                }
              }
            },
            "cloudwatch": {
              "namespace": "AWS/ApiGateway"
            },
            "dimensions": {
              "ApiName": "PetStore",
              "Stage": "prod"
            }
          }

@shmsr
Copy link
Member

shmsr commented May 16, 2023

Oh, okay. Thanks for sharing!

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
@lucian-ioan lucian-ioan mentioned this pull request May 30, 2023
8 tasks
@lucian-ioan lucian-ioan requested a review from shmsr May 31, 2023 04:56
Copy link
Member

@shmsr shmsr 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 to me.

But as I'm still not much experienced with integrations as of now, I'd like to request you get another pair of eyes to review this PR. I might have missed something.

packages/aws/_dev/build/docs/apigateway.md Outdated Show resolved Hide resolved
packages/aws/docs/apigateway.md Outdated Show resolved Hide resolved
packages/aws/_dev/build/docs/apigateway.md Outdated Show resolved Hide resolved
packages/aws/docs/apigateway.md Show resolved Hide resolved
packages/aws/manifest.yml Outdated Show resolved Hide resolved
packages/aws/manifest.yml Outdated Show resolved Hide resolved
lucian-ioan and others added 2 commits May 31, 2023 09:29
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
lucian-ioan and others added 4 commits May 31, 2023 09:30
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
@lucian-ioan lucian-ioan requested a review from gpop63 May 31, 2023 06:31
@gpop63
Copy link
Contributor

gpop63 commented May 31, 2023

LGTM, I'll take a look at the documentation.

Copy link
Contributor

@zmoog zmoog left a comment

Choose a reason for hiding this comment

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

Please considers adding the latency doc from the other PR.

LGTM.

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
@lucian-ioan lucian-ioan merged commit e465e79 into elastic:main Jun 5, 2023
3 checks passed
@elasticmachine
Copy link

Package aws - 1.39.0 containing this change is available at https://epr.elastic.co/search?package=aws

sodhikirti07 pushed a commit that referenced this pull request Jun 15, 2023
* Add sample event

* Add changelog entry

* Add stream

* Add manifest

* Add fields

* Add manifest entry

* Fix fields

* Add icon

* Update descriptions

* Update package-fields description

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Add unit and metric types

* Add docs

* Update packages/aws/_dev/build/docs/apigateway.md

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update packages/aws/docs/apigateway.md

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update packages/aws/manifest.yml

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update packages/aws/docs/apigateway.md

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update packages/aws/manifest.yml

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update packages/aws/_dev/build/docs/apigateway.md

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>

* Update packages/aws/data_stream/apigateway_metrics/manifest.yml

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>

* fix apigateway docs

---------

Co-authored-by: subham sarkar <sarkar.subhams2@gmail.com>
Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
@lucian-ioan lucian-ioan linked an issue Jul 24, 2023 that may be closed by this pull request
8 tasks
@lucian-ioan lucian-ioan deleted the add_aws-apigateway_metrics branch September 6, 2023 11:36
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.

[AWS API Gateway] Metrics datastream AWS API Gateway Integration
5 participants