-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(azure_logs_ingestion): Initial azure_logs_ingestion
sink
#22912
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
base: master
Are you sure you want to change the base?
feat(azure_logs_ingestion): Initial azure_logs_ingestion
sink
#22912
Conversation
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
Signed-off-by: Jed Laundry <[email protected]>
check-spelling run (pull_request_target) for feature-azure_logs_ingestion Signed-off-by: check-spelling-bot <[email protected]> on-behalf-of: @check-spelling <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jlaundry, thanks for this contribution!
It looks good. Two things:
- We will need some documentation files. See an example here (all files under
website
). Note thatbase/
is generated bymake generate-component-docs
. - Is the intention to complete replace the
azure_monitor_logs
sink? If that's the case maybe we can mark the existing one as deprecated in favor of this new sink.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! Approving with one very minor suggestion.
The maximum size of a batch that is processed by a sink. | ||
|
||
This is based on the uncompressed size of the batched events, before they are | ||
serialized/compressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serialized/compressed. | |
serialized or compressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This text is imported from https://github.com/vectordotdev/vector/blob/master/src/sinks/util/batch.rs#L104, and appears in most of the sinks/base/*.cue
files - should we raise a separate PR to change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable.
Apologies, I thought this page was auto-generated as well - added now.
Good point, added 🙂 |
|
||
static CONTENT_TYPE_VALUE: LazyLock<HeaderValue> = | ||
LazyLock::new(|| HeaderValue::from_static(CONTENT_TYPE)); | ||
// static X_MS_CLIENT_REQUEST_ID_HEADER: LazyLock<HeaderName> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// #[cfg(test)] | ||
// mod tests; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to add a tests.rs
? If not you can delete this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it would be great to have a simple integration test here. But I don't want to block the PR because of this. If you look at other integrations tests, it should be easy to add one (assuming we have a azure logs docker image)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've spent some time this weekend looking for a nice way to do testing... and unfortunately it's not as easy as it seems.
- Because the API expects an OAuth token, we need to mock the OAuth endpoint, which would be simple, except:
- to mock the token endpoint, we need the
azure_identity
crate to be updated to 0.23.0 to use aClientSecretCredential
with specific authority endpoint, and - that update is blocked, because it and
azure_core
have substantial refactors, andazure_storage
hasn't yet been updated (theazure_blob
sink usesazure_storage
) - The only other option is to use a real Azure App Registration as part of the test suite, and ignore the OAuth token in the mock API - which would be simple to setup for the GitHub Actions tests, but would then require individual devs to have Azure CLI / their own AZURE_CLIENT_ID, which doesn't seem nice.
I've stashed a WIP: jlaundry/vector@feature-azure_logs_ingestion...jlaundry:vector:feature-azure_logs_ingestion-tests and will tinker with this for a bit, but we might be best waiting until the azure_storage
crate update is unblocked.
) -> crate::Result<Self> { | ||
let mut parts = endpoint.into_parts(); | ||
parts.path_and_query = Some( | ||
// https://my-dce-5kyl.eastus-1.ingest.monitor.azure.com/dataCollectionRules/dcr-000a00a000a00000a000000aa000a0aa/streams/Custom-MyTable?api-version=2023-01-01 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete debug comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Summary
The current
azure_monitor_logs
sink uses the Data Collector API, which has been deprecated and will be removed in September 2026.This sink uses the replacement Logs Ingestion API.
While I did consider making this a drop-in replacement for the existing sink, users need to make numerous breaking infrastructure changes, including:
_CL
custom tables.Change Type
Is this a breaking change?
How did you test this PR?
AZURE_TENANT_ID
,AZURE_CLIENT_ID
, andAZURE_CLIENT_SECRET
environment variables from the App Registrationvector.yaml
:Does this PR include user facing changes?
References
azure_blob
, by using the Azure Identity crate, this sink supports passwordless credentials.