Skip to content

Conversation

@lucian-ioan
Copy link
Contributor

@lucian-ioan lucian-ioan commented Jul 26, 2023

Urgency

  • Normal

Activity Type

  • Enhancement

What does this PR do?

Adds apiId, domainName and stage fields which need Custom Access Logging enabled in the AWS API Gateway settings and to be added to the default log format via context variables. Also enhances current tests.

These fields are common between all API types supported by AWS and provide value in filtering data/enhancing dashboards.

apiId -> unique identifier for the API
domainName -> full URL path to the API, easier to identify with than apiId
stage -> environment typically used as a step in the lifecycle of the API (ex. dev/beta/prod/)

Documentation for context variables based on API type:

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.

How to test this PR locally

  • Set up an API using the AWS API Gateway service and enable Custom Access Logging
  • Add the following mapping to collect the additional fields in AWS: {"apiId": "$context.apiId", "domainName": "$context.domainName", "stage": "$context.stage"}
  • Run the AWS API Gateway integration locally using elastic-package and validate the fields are properly ingested

Related issues

@lucian-ioan lucian-ioan self-assigned this Jul 26, 2023
@lucian-ioan lucian-ioan added enhancement New feature or request Integration:aws AWS labels Jul 26, 2023
@lucian-ioan lucian-ioan requested review from gpop63 and zmoog July 26, 2023 12:43
@elasticmachine
Copy link

elasticmachine commented Jul 26, 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-08-11T12:11:58.034+0000

  • Duration: 53 min 44 sec

Test stats 🧪

Test Results
Failed 0
Passed 208
Skipped 4
Total 212

🤖 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 Jul 26, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (17/17) 💚
Files 94.444% (17/18) 👎 -5.556
Classes 94.444% (17/18) 👎 -5.556
Methods 85.953% (257/299) 👍 12.62
Lines 86.024% (7509/8729) 👎 -13.976
Conditionals 100.0% (0/0) 💚

@lucian-ioan lucian-ioan marked this pull request as ready for review July 31, 2023 06:23
@lucian-ioan lucian-ioan requested a review from a team as a code owner July 31, 2023 06:23
Comment on lines 24 to 25
Copy link
Contributor

Choose a reason for hiding this comment

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

We should expand this section.

Here's the information we should convey to the users:

  • the API Gateway offers a wide array of additional fields you can pick from
  • you can leverage the custom pipeline to process the field names or values
  • you can leverage the custom mapping to store data efficiently

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.

This PR is looking good; I have a few minor suggested changes.

@elastic elastic deleted a comment from cla-checker-service bot Aug 2, 2023
@lucian-ioan lucian-ioan requested a review from zmoog August 2, 2023 15:31
@lucian-ioan
Copy link
Contributor Author

lucian-ioan commented Aug 2, 2023

It seems changing my github username finally caught up to me (resigned the CLA).

What's your opinion on the new docs @zmoog ?

@cla-checker-service
Copy link

cla-checker-service bot commented Aug 2, 2023

💚 CLA has been signed

@zmoog
Copy link
Contributor

zmoog commented Aug 3, 2023

@lucian-ioan, do you still have problems with CLA?

@lucian-ioan
Copy link
Contributor Author

lucian-ioan commented Aug 3, 2023

/test

yes @zmoog, apparently so, I believe there need to be some signatures on the other end as well for it to be in effect.

Can the PR not be merged without the CLA passing?

@zmoog
Copy link
Contributor

zmoog commented Aug 3, 2023

Can the PR not be merged without the CLA passing?

No.

We need to sort this out.

@lucian-ioan lucian-ioan force-pushed the aws_apigateway_additional_fields branch 2 times, most recently from 0da8058 to 144af0f Compare August 9, 2023 14:21
@annamikhailovskaia
Copy link

cla/check

1 similar comment
@umatiw
Copy link

umatiw commented Aug 10, 2023

cla/check

@lucian-ioan lucian-ioan requested a review from a team as a code owner August 10, 2023 12:37
@umatiw
Copy link

umatiw commented Aug 10, 2023

cla/check

@lucian-ioan lucian-ioan force-pushed the aws_apigateway_additional_fields branch from 134917a to 5e32eba Compare August 11, 2023 09:53
@lucian-ioan lucian-ioan requested a review from zmoog August 11, 2023 10:12
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.

nit: tiny suggestion on the wording.

lucian-ioan and others added 2 commits August 11, 2023 14:25
Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.52.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

May be a minor version bump here as we are adding the fields and it is an enhancement

@lucian-ioan lucian-ioan requested a review from bhapas August 11, 2023 12:12
Copy link
Contributor

@bhapas bhapas left a comment

Choose a reason for hiding this comment

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

LGTM

@lucian-ioan lucian-ioan merged commit 03533c0 into elastic:main Aug 11, 2023
@elasticmachine
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Integration:aws AWS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AWS] [API Gateway] Custom Access Logging support for logs integration

7 participants