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

[Azure] [PlatformLogs] Fix pipeline for edge cases #12735

Merged
merged 12 commits into from
Mar 5, 2025

Conversation

lucian-ioan
Copy link
Contributor

Proposed commit message

Fix pipeline for edge cases.

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@lucian-ioan lucian-ioan added Integration:azure Azure Logs Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] labels Feb 12, 2025
@lucian-ioan lucian-ioan self-assigned this Feb 12, 2025
@lucian-ioan lucian-ioan marked this pull request as ready for review February 12, 2025 00:50
@lucian-ioan lucian-ioan requested a review from a team as a code owner February 12, 2025 00:50
@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented Feb 12, 2025

🚀 Benchmarks report

Package azure 👍(5) 💚(2) 💔(4)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
signinlogs 2551.02 1805.05 -745.97 (-29.24%) 💔
springcloudlogs 5434.78 3984.06 -1450.72 (-26.69%) 💔
platformlogs 5747.13 4830.92 -916.21 (-15.94%) 💔
provisioning 6849.32 2801.12 -4048.2 (-59.1%) 💔

To see the full report comment with /test benchmark fullreport

@lucian-ioan lucian-ioan requested review from a team as code owners February 18, 2025 06:23
@ishleenk17
Copy link
Contributor

@muthu-mps : Can you please review this.

@@ -63,8 +59,7 @@ processors:
field: azure.resource_id
if: 'ctx.azure?.subscription_id == null'
patterns:
- /SUBSCRIPTIONS/%{SUBID:azure.subscription_id}/RESOURCEGROUPS/%{GROUPID:azure.resource.group}
- /subscriptions/%{SUBID:azure.subscription_id}/resourceGroups/%{GROUPID:azure.resource.group}
- /(?i)subscriptionssubscriptions/%{SUBID:azure.subscription_id}/resourceGroups/%{GROUPID:azure.resource.group}
Copy link
Contributor

Choose a reason for hiding this comment

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

subscriptionssubscriptions doesn't look right (it's word subscriptions twice`). Is it a mistake?

@@ -148,7 +148,7 @@ processors:
- convert:
field: azure.platformlogs.durationMs
target_field: event.duration
type: integer
type: float
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Not sure why the event.duration is of type integer. As we reference the ECS field for event.duration changing the type to float may not align with the ECS field as the event.duration is of type long. You have to convert it to long instead of float.
  • event.duration ECS reference- https://www.elastic.co/guide/en/ecs/current/ecs-event.html#field-event-duration
  • Will this change create a mapping conflict? If Yes, then lets file a separate issue for this fix.

Copy link
Contributor Author

@lucian-ioan lucian-ioan Feb 25, 2025

Choose a reason for hiding this comment

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

event.duration gets converted from azure.platformlogs.durationMs which can be string represeting a float.

Edit: I can convert the original string to long but it can come as "2.7897" so I would lose the precision. WDYT @muthu-mps ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, This value is again converted to nano seconds here

So we can keep the type as long.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ishleenk17 - Do you have any second thought on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we use event.duration ?
I expect conflicts to happen in case this field is already present and datatype is long.
Can't we use a time duration field specific for azure platform logs ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally, event.duration is used in all Azure integrations to capture the request duration. I don't think we can add a separate field for platform logs alone.
To fix this we need to change integer field type to long.

Copy link
Contributor Author

@lucian-ioan lucian-ioan Feb 25, 2025

Choose a reason for hiding this comment

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

Thank you, I think it will work. Testing this live before merging.

Copy link
Contributor

Choose a reason for hiding this comment

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

@muthu-mps : We have never confronted conflicts for this field ?
Also, I assume all the event.duration are long in existing azure logs as well to adhere to the ECS fields.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have never confronted conflicts for this field ?

No, We have not seen any conflict error.

Also, I assume all the event.duration are long in existing azure logs as well to adhere to the ECS fields.

yes, all other Azure integrations adhere to ECS field.

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.

LGTM!
As the field type change doesn't induce any error. cc: @lucian-ioan

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @lucian-ioan

@lucian-ioan lucian-ioan merged commit 65d9d9a into elastic:main Mar 5, 2025
7 checks passed
@elastic-vault-github-plugin-prod

Package azure - 1.22.2 containing this change is available at https://epr.elastic.co/package/azure/1.22.2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration:azure Azure Logs Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Azure] [Platform Logs] Issues with processing certain fields
5 participants