fluent-plugin-openlineage 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/linux.yml +30 -0
  4. data/.gitignore +16 -0
  5. data/.idea/.gitignore +8 -0
  6. data/.idea/fluentd.iml +204 -0
  7. data/.idea/misc.xml +4 -0
  8. data/.idea/modules/benchmark-memory-0.2.iml +12 -0
  9. data/.idea/modules/bigdecimal-3.1.iml +11 -0
  10. data/.idea/modules/certstore_c-0.1.iml +15 -0
  11. data/.idea/modules/concurrent-ruby-1.3.iml +18 -0
  12. data/.idea/modules/concurrent-ruby-1.31.iml +15 -0
  13. data/.idea/modules/connection_pool-2.4.iml +11 -0
  14. data/.idea/modules/cool.io-1.8.iml +16 -0
  15. data/.idea/modules/drb-2.2.iml +14 -0
  16. data/.idea/modules/drb-2.21.iml +11 -0
  17. data/.idea/modules/ffi-1.17.iml +20 -0
  18. data/.idea/modules/ffi-win32-extensions-1.0.iml +19 -0
  19. data/.idea/modules/fluentd-1.17.iml +43 -0
  20. data/.idea/modules/http_parser.rb-0.8.iml +17 -0
  21. data/.idea/modules/json-2.7.iml +14 -0
  22. data/.idea/modules/json-2.71.iml +11 -0
  23. data/.idea/modules/msgpack-1.7.iml +15 -0
  24. data/.idea/modules/mutex_m-0.2.iml +15 -0
  25. data/.idea/modules/new_gem.iml +15 -0
  26. data/.idea/modules/power_assert-2.0.iml +19 -0
  27. data/.idea/modules/rake-13.2.iml +18 -0
  28. data/.idea/modules/rake-13.21.iml +15 -0
  29. data/.idea/modules/rake-compiler-1.2.iml +13 -0
  30. data/.idea/modules/rusty_json_schema-0.15.iml +15 -0
  31. data/.idea/modules/serverengine-2.3.iml +17 -0
  32. data/.idea/modules/sigdump-0.2.iml +16 -0
  33. data/.idea/modules/specifications.iml +14 -0
  34. data/.idea/modules/specifications1.iml +11 -0
  35. data/.idea/modules/strptime-0.2.iml +16 -0
  36. data/.idea/modules/thermite-0.13.iml +17 -0
  37. data/.idea/modules/webrick-1.8.iml +18 -0
  38. data/.idea/modules/win32-event-0.6.iml +21 -0
  39. data/.idea/modules/win32-ipc-0.7.iml +20 -0
  40. data/.idea/modules/yajl-ruby-1.4.iml +779 -0
  41. data/.idea/modules.xml +41 -0
  42. data/.rspec +2 -0
  43. data/ChangeLog +3 -0
  44. data/Gemfile +3 -0
  45. data/LICENSE +202 -0
  46. data/README.md +250 -0
  47. data/Rakefile +13 -0
  48. data/fluent-plugin-openlineage.gemspec +28 -0
  49. data/lib/fluent/plugin/parser_openlineage.rb +182 -0
  50. data/misc/fluent.conf +101 -0
  51. data/misc/test-complete.json +73 -0
  52. data/misc/test-start.json +73 -0
  53. data/spec/Naming.md +500 -0
  54. data/spec/OpenLineage.json +304 -0
  55. data/spec/Versioning.md +49 -0
  56. data/spec/events/event_full.json +206 -0
  57. data/spec/events/event_invalid_dataset_facet.json +31 -0
  58. data/spec/events/event_invalid_input_dataset_facet.json +29 -0
  59. data/spec/events/event_invalid_job_facet.json +26 -0
  60. data/spec/events/event_invalid_output_dataset_facet.json +29 -0
  61. data/spec/events/event_invalid_run_facet.json +28 -0
  62. data/spec/events/event_no_run_id.json +28 -0
  63. data/spec/events/event_simple.json +29 -0
  64. data/spec/facets/ColumnLineageDatasetFacet.json +96 -0
  65. data/spec/facets/ColumnLineageDatasetFacet.md +106 -0
  66. data/spec/facets/DataQualityAssertionsDatasetFacet.json +49 -0
  67. data/spec/facets/DataQualityMetricsInputDatasetFacet.json +76 -0
  68. data/spec/facets/DatasetVersionDatasetFacet.json +31 -0
  69. data/spec/facets/DatasourceDatasetFacet.json +32 -0
  70. data/spec/facets/DocumentationDatasetFacet.json +31 -0
  71. data/spec/facets/DocumentationJobFacet.json +30 -0
  72. data/spec/facets/ErrorMessageRunFacet.json +41 -0
  73. data/spec/facets/ExternalQueryRunFacet.json +36 -0
  74. data/spec/facets/ExternalQueryRunFacet.md +49 -0
  75. data/spec/facets/ExtractionErrorRunFacet.json +58 -0
  76. data/spec/facets/JobTypeJobFacet.json +41 -0
  77. data/spec/facets/LifecycleStateChangeDatasetFacet.json +46 -0
  78. data/spec/facets/NominalTimeRunFacet.json +38 -0
  79. data/spec/facets/OutputStatisticsOutputDatasetFacet.json +36 -0
  80. data/spec/facets/OwnershipDatasetFacet.json +45 -0
  81. data/spec/facets/OwnershipJobFacet.json +45 -0
  82. data/spec/facets/ParentRunFacet.json +54 -0
  83. data/spec/facets/ProcessingEngineRunFacet.json +41 -0
  84. data/spec/facets/SQLJobFacet.json +30 -0
  85. data/spec/facets/SchemaDatasetFacet.json +59 -0
  86. data/spec/facets/SourceCodeJobFacet.json +34 -0
  87. data/spec/facets/SourceCodeLocationJobFacet.json +60 -0
  88. data/spec/facets/StorageDatasetFacet.json +35 -0
  89. data/spec/facets/SymlinksDatasetFacet.json +47 -0
  90. data/spec/fluent/plugin/test_parser_openlineage.rb +141 -0
  91. data/spec/registry/core/registry.json +31 -0
  92. data/spec/registry/gcp/facets/GcpCommonJobFacet.json +43 -0
  93. data/spec/registry/gcp/registry.json +6 -0
  94. data/spec/spec_helper.rb +8 -0
  95. data/spec/tests/ColumnLineageDatasetFacet/1.json +172 -0
  96. data/spec/tests/DataQualityAssertionsDatasetFacet/1.json +58 -0
  97. data/spec/tests/DataQualityMetricsInputDatasetFacet/1.json +23 -0
  98. data/spec/tests/DatasetVersionDatasetFacet/1.json +7 -0
  99. data/spec/tests/DatasourceDatasetFacet/1.json +7 -0
  100. data/spec/tests/DocumentationDatasetFacet/1.json +7 -0
  101. data/spec/tests/DocumentationJobFacet/1.json +7 -0
  102. data/spec/tests/ErrorMessageRunFacet/1.json +9 -0
  103. data/spec/tests/ExternalQueryRunFacet/1.json +8 -0
  104. data/spec/tests/ExtractionErrorRunFacet/1.json +15 -0
  105. data/spec/tests/JobTypeJobFacet/1.json +9 -0
  106. data/spec/tests/LifecycleStateChangeDatasetFacet/1.json +11 -0
  107. data/spec/tests/NominalTimeRunFacet/1.json +8 -0
  108. data/spec/tests/OutputStatisticsOutputDatasetFacet/1.json +9 -0
  109. data/spec/tests/OwnershipDatasetFacet/1.json +11 -0
  110. data/spec/tests/OwnershipJobFacet/1.json +11 -0
  111. data/spec/tests/ParentRunFacet/1.json +13 -0
  112. data/spec/tests/ProcessingEngineRunFacet/1.json +9 -0
  113. data/spec/tests/SQLJobFacet/1.json +7 -0
  114. data/spec/tests/SchemaDatasetFacet/1.json +92 -0
  115. data/spec/tests/SourceCodeJobFacet/1.json +8 -0
  116. data/spec/tests/SourceCodeLocationJobFacet/1.json +8 -0
  117. data/spec/tests/StorageDatasetFacet/1.json +8 -0
  118. data/spec/tests/SymlinksDatasetFacet/1.json +13 -0
  119. data/spec/tests/example_full_event.json +24 -0
  120. metadata +188 -3
data/.idea/modules.xml ADDED
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/benchmark-memory-0.2.iml" filepath="$PROJECT_DIR$/.idea/modules/benchmark-memory-0.2.iml" />
6
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/bigdecimal-3.1.iml" filepath="$PROJECT_DIR$/.idea/modules/bigdecimal-3.1.iml" />
7
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/certstore_c-0.1.iml" filepath="$PROJECT_DIR$/.idea/modules/certstore_c-0.1.iml" />
8
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/concurrent-ruby-1.3.iml" filepath="$PROJECT_DIR$/.idea/modules/concurrent-ruby-1.3.iml" />
9
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/concurrent-ruby-1.31.iml" filepath="$PROJECT_DIR$/.idea/modules/concurrent-ruby-1.31.iml" />
10
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/connection_pool-2.4.iml" filepath="$PROJECT_DIR$/.idea/modules/connection_pool-2.4.iml" />
11
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/cool.io-1.8.iml" filepath="$PROJECT_DIR$/.idea/modules/cool.io-1.8.iml" />
12
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/drb-2.2.iml" filepath="$PROJECT_DIR$/.idea/modules/drb-2.2.iml" />
13
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/drb-2.21.iml" filepath="$PROJECT_DIR$/.idea/modules/drb-2.21.iml" />
14
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/ffi-1.17.iml" filepath="$PROJECT_DIR$/.idea/modules/ffi-1.17.iml" />
15
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/ffi-win32-extensions-1.0.iml" filepath="$PROJECT_DIR$/.idea/modules/ffi-win32-extensions-1.0.iml" />
16
+ <module fileurl="file://$PROJECT_DIR$/.idea/fluentd.iml" filepath="$PROJECT_DIR$/.idea/fluentd.iml" />
17
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/fluentd-1.17.iml" filepath="$PROJECT_DIR$/.idea/modules/fluentd-1.17.iml" />
18
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/http_parser.rb-0.8.iml" filepath="$PROJECT_DIR$/.idea/modules/http_parser.rb-0.8.iml" />
19
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/json-2.7.iml" filepath="$PROJECT_DIR$/.idea/modules/json-2.7.iml" />
20
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/json-2.71.iml" filepath="$PROJECT_DIR$/.idea/modules/json-2.71.iml" />
21
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/msgpack-1.7.iml" filepath="$PROJECT_DIR$/.idea/modules/msgpack-1.7.iml" />
22
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/mutex_m-0.2.iml" filepath="$PROJECT_DIR$/.idea/modules/mutex_m-0.2.iml" />
23
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/new_gem.iml" filepath="$PROJECT_DIR$/.idea/modules/new_gem.iml" />
24
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/power_assert-2.0.iml" filepath="$PROJECT_DIR$/.idea/modules/power_assert-2.0.iml" />
25
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/rake-13.2.iml" filepath="$PROJECT_DIR$/.idea/modules/rake-13.2.iml" />
26
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/rake-13.21.iml" filepath="$PROJECT_DIR$/.idea/modules/rake-13.21.iml" />
27
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/rake-compiler-1.2.iml" filepath="$PROJECT_DIR$/.idea/modules/rake-compiler-1.2.iml" />
28
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/rusty_json_schema-0.15.iml" filepath="$PROJECT_DIR$/.idea/modules/rusty_json_schema-0.15.iml" />
29
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/serverengine-2.3.iml" filepath="$PROJECT_DIR$/.idea/modules/serverengine-2.3.iml" />
30
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/sigdump-0.2.iml" filepath="$PROJECT_DIR$/.idea/modules/sigdump-0.2.iml" />
31
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/specifications.iml" filepath="$PROJECT_DIR$/.idea/modules/specifications.iml" />
32
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/specifications1.iml" filepath="$PROJECT_DIR$/.idea/modules/specifications1.iml" />
33
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/strptime-0.2.iml" filepath="$PROJECT_DIR$/.idea/modules/strptime-0.2.iml" />
34
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/thermite-0.13.iml" filepath="$PROJECT_DIR$/.idea/modules/thermite-0.13.iml" />
35
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/webrick-1.8.iml" filepath="$PROJECT_DIR$/.idea/modules/webrick-1.8.iml" />
36
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/win32-event-0.6.iml" filepath="$PROJECT_DIR$/.idea/modules/win32-event-0.6.iml" />
37
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/win32-ipc-0.7.iml" filepath="$PROJECT_DIR$/.idea/modules/win32-ipc-0.7.iml" />
38
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/yajl-ruby-1.4.iml" filepath="$PROJECT_DIR$/.idea/modules/yajl-ruby-1.4.iml" />
39
+ </modules>
40
+ </component>
41
+ </project>
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/ChangeLog ADDED
@@ -0,0 +1,3 @@
1
+ Release 0.1.0 - 2024/08/02
2
+
3
+ * Project_level: Reseased
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,250 @@
1
+ # Fluent-plugin-openlineage, a plugin for [Fluentd](https://www.fluentd.org)
2
+ [![Gem Version](https://badge.fury.io/rb/fluent-plugin-openlineage.svg)](https://badge.fury.io/rb/fluent-plugin-openlineage)
3
+
4
+ fluent-plugin-openlineage is a Fluentd plugin that verifies if a JSON matches the OpenLineage schema.
5
+ It is intended to be used together with a [Fluentd Application](https://github.com/fluent/fluentd).
6
+
7
+ ## Requirements
8
+
9
+ | fluent-plugin-prometheus | fluentd | ruby |
10
+ |--------------------------|------------|--------|
11
+ | 1.x.y | >= v1.9.1 | >= 2.4 |
12
+ | 1.[0-7].y | >= v0.14.8 | >= 2.1 |
13
+ | 0.x.y | >= v0.12.0 | >= 1.9 |
14
+
15
+ ## Installation
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ ```ruby
20
+ gem 'fluent-plugin-openlineage'
21
+ ```
22
+
23
+ And then execute:
24
+
25
+ $ bundle
26
+
27
+ Or install it yourself using one of the following:
28
+
29
+ $ gem install fluent-plugin-openlineage
30
+
31
+ $ fluent-gem install fluent-plugin-openlineage
32
+
33
+ ## Usage
34
+
35
+ fluentd-plugin-openlineage include only one plugin.
36
+
37
+ - `openlineage` parse plugin
38
+
39
+ ## Why are Fluentd and Openlineage a perfect match?
40
+ ### This is part of the OpenLineage Project repository at: https://github.com/OpenLineage/OpenLineage/tree/main/proxy/fluentd
41
+
42
+ Modern data collectors (Fluentd, Logstash, Vector, etc.) can be extremely useful when designing
43
+ production-grade architectures for processing Openlineage events.
44
+
45
+ They can be used for features such as:
46
+ * A server-proxy in front of the Openlineage backend (like Marquez) to handle load spikes and buffer incoming events when the backend is down (e.g., due to a maintenance window).
47
+ * The ability to copy the event to multiple backends such as HTTP, Kafka or cloud object storage. Data collectors implement that out-of-the-box.
48
+
49
+ They have great potential except for a single missing feature: *the ability to parse and validate OpenLineage events at the point of HTTP input*.
50
+ This is important as one would like to get a `Bad Request` response immediately when sending invalid OpenLineage events to an endpoint.
51
+ Fortunately, this missing feature can be implemented as a plugin.
52
+
53
+ We decided to implement an OpenLineage parser plugin for Fluentd because:
54
+ * Fluentd has a small footprint in terms of resource utilization and does not require that JVM be installed,
55
+ * Fluentd plugins can be installed from local files (no need to register in a plugin repository).
56
+
57
+ As a side effect, the Fluentd integration can be also used as a OpenLineage HTTP validation backend for
58
+ development purposes.
59
+
60
+ ## Fluentd features
61
+
62
+ Some interesting Fluentd features are available according to the [official documentation](https://docs.fluentd.org/):
63
+
64
+ * [Buffering/retrying parameters](https://docs.fluentd.org/output#buffering-retrying-parameters),
65
+ * Useful output plugins:
66
+ * [Output Kafka plugin](https://docs.fluentd.org/output/kafka),
67
+ * [Output S3 plugin](https://docs.fluentd.org/output/s3),
68
+ * [Output copy plugin](https://docs.fluentd.org/output/copy),
69
+ * [Output HTTP plugin](https://docs.fluentd.org/output/http) with options such as [retryable_response_codes](https://docs.fluentd.org/output/http#retryable_response_codes) to specify backend codes that should cause a retry,
70
+ * [Buffer configuration](https://docs.fluentd.org/configuration/buffer-section),
71
+ * [Embedding Ruby Expressions in config files to contain environment variables](https://docs.fluentd.org/configuration/config-file#embedding-ruby-expressions).
72
+
73
+ The official Fluentd documentation does not mention guarantees about event ordering. However, retrieving
74
+ Openlineage events and buffering in file/memory should be considered a millisecond-long operation,
75
+ while any HTTP backend cannot guarantee ordering in such a case. On the other hand, by default
76
+ the amount of threads to flush the buffer is set to 1 and configurable ([flush_thread_count](https://docs.fluentd.org/output#flush_thread_count)).
77
+
78
+ ## Quickstart with Docker
79
+
80
+ Please refer to the [`Dockerfile`](docker/Dockerfile) and [`fluent.conf`](docker/conf/fluent.conf) to see how to build and install the plugin with
81
+ the example usage scenario provided in [`docker-compose.yml`](docker/docker-compose.yml). To run the example setup, go to the `docker` directory and execute the following command:
82
+
83
+ ```shell
84
+ docker-compose up
85
+ ```
86
+
87
+ After all the containers have started, send some HTTP requests:
88
+
89
+ ```shell
90
+ curl -X POST \
91
+ -d '{"test":"test"}' \
92
+ -H 'Content-Type: application/json' \
93
+ http://localhost:9880/api/v1/lineage
94
+ ```
95
+ In response, you should see the following message:
96
+
97
+ `Openlineage validation failed: path "/": "run" is a required property, path "/": "job" is a required property, path "/": "eventTime" is a required property, path "/": "producer" is a required property, path "/": "schemaURL" is a required property`
98
+
99
+ Next, send some valid requests:
100
+
101
+ ```shell
102
+ curl -X POST \
103
+ -d "$(cat test-start.json)" \
104
+ -H 'Content-Type: application/json' \
105
+ http://localhost:9880/api/v1/lineage
106
+ ```
107
+
108
+ ```shell
109
+ curl -X POST \
110
+ -d "$(cat test-complete.json)" \
111
+ -H 'Content-Type: application/json' \
112
+ http://localhost:9880/api/v1/lineage
113
+ ```
114
+
115
+ After that you should see entities in Marquez (http://localhost:3000/) in the `my-namespace` namespace.
116
+
117
+ To clean up, run
118
+ ```shell
119
+ docker-compose down
120
+ ```
121
+
122
+ ### Configuration
123
+
124
+ Although Openlineage event is specified according to Json-Schema, its real-life validation may
125
+ vary and backends like Marquez may have less strict approach to validating certain types of facets.
126
+ For example, Marquez allows a non-valid `DataQualityMetricsInputDatasetFacet`.
127
+ To give more flexibility, fluentd parser allows following configuration parameters:
128
+ ```ruby
129
+ validate_input_dataset_facets => true/false
130
+ validate_output_dataset_facets => true/false
131
+ validate_dataset_facets => true/false
132
+ validate_run_facets => true/false
133
+ validate_job_facets => true/false
134
+ ```
135
+ By default, only `validate_run_facets` and `validate_job_facets` are set to `true`/
136
+
137
+ ### Development
138
+
139
+ To build dependencies:
140
+ ```shell
141
+ bundle install
142
+ bundle
143
+ ```
144
+
145
+ To run the tests:
146
+ ```shell
147
+ bundle exec rake test
148
+ ```
149
+
150
+ #### Installation
151
+
152
+ The easiest way to install the plugin is to install the main application Fluentd and along with it, these external packages for example in a Dockerfile:
153
+ * `rusty_json_schema` installs a JSON validation library for Rust,
154
+ * `fluent-plugin-out-http` allows non-bulk HTTP out requests (sending each OpenLineage event in a separate request).
155
+ ```shell
156
+ fluent-gem install rusty_json_schema
157
+ fluent-gem install fluent-plugin-out-http
158
+ fluent-gem install fluent-plugin-openlineage
159
+ ```
160
+
161
+ ## Fluentd proxy setup
162
+ ### Monitoring with Prometheus and some other configs you can try by running a separate fluent.conf file
163
+
164
+ You may also want to check how Fluentd application itself is doing using Prometheus and for that, you may want to add the plugin: fluent-plugin-prometheus at https://github.com/fluent/fluent-plugin-prometheus and include the following setup in your prometheus.yml file:
165
+
166
+ ```yml
167
+ global:
168
+ scrape_interval: 10s # Set the scrape interval to every 10 seconds. Default is every 1 minute.
169
+
170
+ #### A scrape configuration containing exactly one endpoint to scrape:
171
+ #### Here it's Prometheus itself.
172
+ scrape_configs:
173
+ - job_name: 'fluentd'
174
+ static_configs:
175
+ - targets: ['localhost:24231']
176
+ ````
177
+
178
+ You may also want to include the following additional parameters to your fluent.conf file:
179
+
180
+ ```xml
181
+ #### source
182
+ <source>
183
+ @type forward
184
+ bind 0.0.0.0
185
+ port 24224
186
+ </source>
187
+
188
+ #### count the number of incoming records per tag
189
+ <filter company.*>
190
+ @type prometheus
191
+ <metric>
192
+ name fluentd_input_status_num_records_total
193
+ type counter
194
+ desc The total number of incoming records
195
+ <labels>
196
+ tag ${tag}
197
+ hostname ${hostname}
198
+ </labels>
199
+ </metric>
200
+ </filter>
201
+
202
+ #### count the number of outgoing records per tag
203
+ <match company.*>
204
+ @type copy
205
+
206
+ <store>
207
+ @type forward
208
+ <server>
209
+ name myserver1
210
+ host 192.168.1.3
211
+ port 24224
212
+ weight 60
213
+ </server>
214
+ </store>
215
+
216
+ <store>
217
+ @type prometheus
218
+ <metric>
219
+ name fluentd_output_status_num_records_total
220
+ type counter
221
+ desc The total number of outgoing records
222
+ <labels>
223
+ tag ${tag}
224
+ hostname ${hostname}
225
+ </labels>
226
+ </metric>
227
+ </store>
228
+
229
+ </match>
230
+
231
+ #### expose metrics in prometheus format
232
+
233
+ <source>
234
+ @type prometheus
235
+ bind 0.0.0.0
236
+ port 24231
237
+ metrics_path /metrics
238
+ </source>
239
+
240
+ <source>
241
+ @type prometheus_output_monitor
242
+ interval 10
243
+ <labels>
244
+ hostname ${hostname}
245
+ </labels>
246
+ </source>
247
+ ```
248
+ ### You can check the docker file for some other examples related to configurations
249
+
250
+ For any additional information, you can check out Fluentd official documentation on https://docs.fluentd.org/monitoring-fluentd/monitoring-prometheus#example-prometheus-queries# fluentd-openlineage-parser
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require "bundler"
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs.push("lib", "test")
8
+ t.test_files = FileList["spec/test/**/test_*.rb"]
9
+ t.verbose = true
10
+ t.warning = true
11
+ end
12
+
13
+ task default: [:test]
@@ -0,0 +1,28 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = "fluent-plugin-openlineage"
6
+ spec.version = "0.1.3"
7
+ spec.authors = ["Pawel Leszczynski"]
8
+ spec.email = ["leszczynski.pawel@gmail.com"]
9
+
10
+ spec.summary = %q{Parser to validate Openlineage events.}
11
+ spec.description = %q{Fluentd parser that validates if JSON is a valid Openlineage event.}
12
+ spec.homepage = "http://openlineage.io"
13
+ spec.license = "Apache-2.0"
14
+
15
+ test_files, files = `git ls-files -z`.split("\x0").partition do |f|
16
+ f.match(%r{^(test|spec|features)/})
17
+ end
18
+ spec.files = files
19
+ spec.executables = files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.test_files = test_files
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "test-unit"
26
+ spec.add_runtime_dependency "fluentd", [">= 0.14.10", "< 2"]
27
+ spec.add_dependency "rusty_json_schema"
28
+ end