-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat: oci logging analytics output plugin implementation #7830
Conversation
|
Signed-off-by: adiforluls <[email protected]>
33f099a
to
afee9d9
Compare
To code-owners: PR description includes the link of REST API that is used to flush logs. The authorization is done using a configuration file, following is the documentation for that https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm |
I'll fix the merge conflict and include appropriate copyrights tomorrow. |
Useful plugin I think to have @adiforluls so appreciate the effort. Before we can review I think we need to tackle the various failing target builds. Ideally this plugin is cross-platform but if it is not supported on Windows/macOS then defaults need to be set to disable it:
Please build locally for all Linux targets using the script linked above - this uses a container build to do each target so takes some time but should help you debug any missing dependencies or per-target issues. If it is not supported please add a comment as well to explain why not so people can see in the future if they want to enable it. It will need documentation too adding in fluent/fluent-bit-docs @adiforluls. |
Sure @patrick-stephens, I've been able to build it on macOS (the log output is from a binary built and run on macOS). Also I don't see that tests ran for this PR? All I see are a bunch of tests skipped About documentation: Is that supposed to be contributed alongside this PR in the docs repo or after this PR is merged in fluent-bit? Will work on writing the documentation accordingly. |
Yeah Github status is not reporting any problems but it has not triggered the CI for package builds for some reason or any of the unit tests. |
I think the issue is that there is a block for first time contributors before we run any workflows - that should show an approve-and-run button here but does not. I think that's what is the issue, no UI to approve the workflows to run for you. |
Ah @adiforluls the reason is you have conflicts that need to be resolved - nothing can run until that is sorted. |
Signed-off-by: adiforluls <[email protected]>
Signed-off-by: adiforluls <[email protected]>
Ack, it was a small conflict so I fixed it just now |
Yeah, you can see there are a few coding issues, e.g. on older targets this is not valid syntax:
Check the coding style but I think Fluent Bit requires everything pre-declared. |
Signed-off-by: adiforluls <[email protected]>
Here's the documentation PR fluent/fluent-bit-docs#1186 |
@adiforluls is it the "oci_logan" name a recognizable term that describes Oracle Cloud Log Analytics platform ?, I just want to make sure people understand what it means, or if we need to rename it before merging it |
CMakeLists.txt
Outdated
@@ -255,6 +255,7 @@ option(FLB_OUT_PROMETHEUS_REMOTE_WRITE "Enable Prometheus remote write plugin" | |||
option(FLB_OUT_S3 "Enable AWS S3 output plugin" Yes) | |||
option(FLB_OUT_VIVO_EXPORTER "Enabel Vivo exporter output plugin" Yes) | |||
option(FLB_OUT_WEBSOCKET "Enable Websocket output plugin" Yes) | |||
option(FLB_OUT_OCI_LOGAN "Enable OCI Logging analytics plugin" Yes) |
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.
Per the docs PR, I would expand OCI to be Oracle Cloud Infrastructure as it is a fairly generic acronym and may be confused with open container initiative.
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.
what about oracle_log_analytics
? azure has azure_logs ingestion
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.
Yeah sounds good to me, making it clear it is Oracle I think is the key one - we have AWS/Google equivalents too.
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.
Good idea, I'll make these changes
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.
Refactored @edsiper
Signed-off-by: adiforluls <[email protected]>
Hi @edsiper @patrick-stephens , I see this was added to v2.1.9 milestone but wasn't merged to be included in 2.1.9. Let me know what's holding the merge such that this goes out in the next release. |
Assuming you have updated per the review comments it likely just needs a re-review to be merged. It will then go into whichever is the next release after that. Unfortunately it takes time to work through all the things in the review queue but I'm sure @edsiper will have a look as soon as he can. Please just make sure all comments are addressed. |
Thanks @patrick-stephens for you response.
cc: @edsiper Note: Once this is merged, I'll be raising another PR to add two other modes of authentication to this plugin, the size of that PR is roughly the same as this one. It'll be good if we can get this in by next week if the PR looks good such that we have enough time to review the follow up PR and get that in before the next release as well. |
the plugin build option still has the old name: FLB_OUT_OCI_LOGAN , same as the registration structure, please get it fixed so we can merge it, thank you |
Signed-off-by: adiforluls <[email protected]>
Fixed the old name references @edsiper |
#define FLB_OCI_ERROR_CODE_TOO_MANY_REQUESTS "TooManyRequests" | ||
#define FLB_OCI_ERROR_CODE_INTERNAL_SERVER_ERROR "InternalServerError" | ||
|
||
#define METADATA_URL_BASE "http://169.254.169.254/opc/v2" |
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.
why these endpoints are hard coded and there is no host/DNS ? are these definitions in use ?
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.
These are not in use currently but will be in use in the follow up PR to add two other modes of authentication to connect to Oracle Cloud Infrastructure endpoints. I can remove it from this PR if you want.
The reason for no host/DNS is probably because these endpoints were set this way. OCI has SDKs in various languages and they include these endpoints hardcoded just like 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.
Removed those endpoints from this PR since they are unused currently @edsiper
Signed-off-by: adiforluls <[email protected]>
--------- Signed-off-by: adiforluls <[email protected]>
A new output plugin for OCI Logging Analytics.
https://docs.oracle.com/en-us/iaas/logging-analytics/index.html
REST API reference of the output destination: https://docs.oracle.com/en-us/iaas/api/#/en/logan-api-spec/20200601/Upload/UploadLogEventsFile
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
fluent/fluent-bit-docs#1186
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.