Skip to content

Add Logs data stream for collecting Azure Functions #6417

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

Merged
merged 52 commits into from
Jul 19, 2023
Merged

Add Logs data stream for collecting Azure Functions #6417

merged 52 commits into from
Jul 19, 2023

Conversation

devamanv
Copy link
Contributor

@devamanv devamanv commented Jun 1, 2023

What does this PR do?

The PR contains changes to add a new datastream functionapplogs that contains all the field mappings, ingest pipelines, documentations needed to ingest the Azure Functions logs into Elasticsearch.

Note: Dashboards assets to be added in a separate PR.

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

  • Clone the integrations repo
  • Install elastic-package locally
  • Spin up an elastic stack using elastic-package
  • Run elastic-package test from the integrations/packages/azure_functions directory

Related issues

Screenshots

image
image

@elasticmachine
Copy link

elasticmachine commented Jun 1, 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-07-18T16:33:45.282+0000

  • Duration: 16 min 55 sec

Test stats 🧪

Test Results
Failed 0
Passed 5
Skipped 0
Total 5

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

@devamanv devamanv requested review from zmoog and a team June 14, 2023 23:45
@devamanv devamanv marked this pull request as ready for review June 14, 2023 23:45
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 looks good; I have a few minor changes to request.

@devamanv devamanv requested review from gpop63 and lucian-ioan June 15, 2023 15:29
@elasticmachine
Copy link

elasticmachine commented Jun 15, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (2/2) 💚
Classes 100.0% (2/2) 💚
Methods 92.857% (13/14) 👍 4.978
Lines 96.753% (149/154) 👎 -0.719
Conditionals 100.0% (0/0) 💚

@devamanv devamanv removed a link to an issue Jun 27, 2023
2 tasks
@devamanv devamanv linked an issue Jun 27, 2023 that may be closed by this pull request
5 tasks
@devamanv devamanv changed the title Add an integration package for collecting Azure Function Logs Add Logs data stream for collecting Azure Functions Jun 27, 2023
ignore_missing: true
- rename:
field: json.properties.functionInvocationId
target_field: azure.function.function_invocation_id
Copy link
Contributor

@gpop63 gpop63 Jul 3, 2023

Choose a reason for hiding this comment

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

I wonder if azure.function.function_invocation_id is redundant and something like azure.function.invocation_id make more sense, this applies to azure.function.function_name too. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's a fair point. I will change that in the next commit.

@devamanv devamanv mentioned this pull request Jul 6, 2023
2 tasks
@devamanv devamanv requested a review from gpop63 July 6, 2023 14:51
@muthu-mps
Copy link
Contributor

@devamanv - Please find my comments below after installing the enabling the data collection for azure functions.

  • When starting the integration for the first time there is a few minutes delay observed in the data collection. Is this the expected behaviour for a first time installer ?
  • The assets is not available for the integration.The PR description has a mention of having assets along with this PR. Can we create assets.
  • The logo in the Azure function's section of the Azure portal is slightly different than what we have. Can we check and update it.

@devamanv
Copy link
Contributor Author

devamanv commented Jul 11, 2023

@muthu-mps

When starting the integration for the first time there is a few minutes delay observed in the data collection. Is this the expected behaviour for a first time installer ?

Events from Azure are usually slow, and this delay is expected and could take anywhere between a few minutes to an hour, reference. Part of the reason is the fact that Platform logs are only collected when there's a corresponding diagnostic setting enabled, source. This usually takes a few minutes for the logs to be routed to a destination, which happens to be Eventhub in this case.
This may also have to do with how the eventhub input works under the hood, it needs to start a worker, establish a connection with Azure Eventhub and at the same time store metadata in an instance of the Storage Account.

The assets is not available for the integration.The PR description has a mention of having assets along with this PR. Can we create assets

The assets(dashboards) will be created as a separate PR. The assets work is already in progress. I have updated the description accordingly.

The logo in the Azure function's section of the Azure portal is slightly different than what we have. Can we check and update it.

I have updated the logo to match the one in the Azure Portal, please take a look.

@devamanv devamanv requested a review from muthu-mps July 11, 2023 08:09
format_version: 2.5.1
name: azure_functions
title: "Azure Functions"
version: 0.1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make the initial release version as experimental 0.0.1 until the Kibana dashboard PR is getting merged. Otherwise looks good !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the release as experimental and the initial package version to 0.0.1.

@zmoog
Copy link
Contributor

zmoog commented Jul 18, 2023

When starting the integration for the first time there is a few minutes delay observed in the data collection. Is this the expected behaviour for a first time installer ?

To add extra details to what @devamanv said, here's how to check what happens between event creation on Azure and ingestion on Elasticsearch using the document fields.

Here's a KB article I put together a few months ago. AFAIK it's unavailable as a public page, so I'm adding it as a screenshot.

CleanShot 2023-07-18 at 07 20 19@2x

We can turn it into a public resource if you think it can be helpful to a broader audience.

devamanv and others added 4 commits July 18, 2023 19:22
Update the ECS version to use the v8.8.0 tag instead of using
the 8.8 branch.

More precise dependencies should enable more predictable builds.
Align the content of the `sample_event.json` file with the new
field names.
Copy link
Contributor

@muthu-mps muthu-mps 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 !

@devamanv devamanv merged commit 2d586eb into elastic:main Jul 19, 2023
@elasticmachine
Copy link

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

@andrewkroh andrewkroh added the Integration:azure_functions Azure Functions label Jul 22, 2024
@andrewkroh andrewkroh added the New Integration Issue or pull request for creating a new integration package. label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration:azure_functions Azure Functions New Integration Issue or pull request for creating a new integration package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Logs data stream for Azure Functions
7 participants