Skip to content

Commit

Permalink
chore: update lts plugins schema (#92)
Browse files Browse the repository at this point in the history
* update lts plugins schema

* update dependencies
  • Loading branch information
nicolasparada authored May 8, 2024
1 parent 1edf46e commit 803cb80
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 19 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Go
on:
workflow_dispatch:
push:
branches: [main]
tags:
Expand All @@ -12,13 +13,13 @@ jobs:
steps:
# Checkout your project with git
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# Install Go on the VM running the action.
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "^1.20"
go-version: "^1.22"

# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
Expand All @@ -28,11 +29,11 @@ jobs:
- name: Run tests
run: |
set -euo pipefail
go test -json -race -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt -hide all
go test -json -fullpath -race -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt -hide all
# Upload the original go test log as an artifact for later review.
- name: Upload test log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: test-log
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/calyptia/go-fluentbit-config/v2

go 1.20
go 1.22

require (
github.com/alecthomas/assert/v2 v2.3.0
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df
github.com/alecthomas/assert/v2 v2.9.0
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/alecthomas/repr v0.2.0 // indirect
github.com/alecthomas/repr v0.4.0 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0=
github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/assert/v2 v2.9.0 h1:ZcLG8ccMEtlMLkLW4gwGpBWBb0N8MUCmsy1lYBVd1xQ=
github.com/alecthomas/assert/v2 v2.9.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
285 changes: 281 additions & 4 deletions schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (s Schema) findSections(kind SectionKind) ([]SchemaSection, bool) {

func (s *Schema) InjectLTSPlugins() {
s.Inputs = append(s.Inputs, SchemaSection{
// See https://github.com/calyptia/lts-advanced-plugin-s3-replay
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-s3-replay
Type: "input",
Name: "go-s3-replay-plugin",
Description: "Calyptia LTS advanced plugin providing logs replay from s3",
Expand Down Expand Up @@ -147,12 +147,12 @@ func (s *Schema) InjectLTSPlugins() {
},
},
}, SchemaSection{
// See https://github.com/calyptia/lts-advanced-plugin-dummy
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-dummy
Type: "input",
Name: "gdummy",
Description: "dummy GO!",
}, SchemaSection{
// See https://github.com/calyptia/lts-advanced-plugin-gsuite-reporter
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-gsuite-reporter
Type: "input",
Name: "gsuite-reporter",
Description: "A Calyptia LTS advanced plugin providing activity streams from Gsuite",
Expand Down Expand Up @@ -204,7 +204,7 @@ func (s *Schema) InjectLTSPlugins() {
},
},
}, SchemaSection{
// See https://github.com/calyptia/core-fluent-bit-plugin-http-loader
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-plugin-http-loader
Type: "input",
Name: "http_loader",
Description: "HTTP Loader plugin provides a way to load/dump data from a paginated HTTP endpoint.",
Expand Down Expand Up @@ -326,6 +326,46 @@ func (s *Schema) InjectLTSPlugins() {
Description: "Controls when to stop collecting, supports templating. Defaults to never stop.",
Default: "false",
},
{
Name: "proxy",
Type: "string",
Description: "Proxy URL, allows comma separated list of URLs.",
},
{
Name: "no_proxy",
Type: "string",
Description: "Exclude URLs from proxy, allows comma separated list of URLs.",
},
{
Name: "tls_cert_file",
Type: "string",
Description: "TLS certificate file path.",
},
{
Name: "tls_key_file",
Type: "string",
Description: "TLS key file path.",
},
{
Name: "tls_cert",
Type: "string",
Description: "TLS certificate in PEM format.",
},
{
Name: "tls_key",
Type: "string",
Description: "TLS key in PEM format.",
},
{
Name: "ca_cert_file",
Type: "string",
Description: "CA certificate file path.",
},
{
Name: "ca_cert",
Type: "string",
Description: "CA certificate in PEM format.",
},
{
Name: "data_dir",
Type: "string",
Expand All @@ -338,6 +378,243 @@ func (s *Schema) InjectLTSPlugins() {
Description: "Controls for how much time data can be used after resume.",
Default: "0s",
},
{
Name: "store_response_body",
Type: "string",
Description: "JSON value to store as response body, supports templating.",
Default: "{{toJson .Response.Body}}",
},
},
},
}, SchemaSection{
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-azure-event-grid
Type: "input",
Name: "azeventgrid",
Description: "A Calyptia Core fluent-bit plugin providing input from Azure Event Grid.",
Properties: SchemaProperties{
Options: []SchemaOptions{
{
Name: "topicName",
Type: "string",
Description: "The name of the topic to subscribe to.",
},
{
Name: "eventSubscriptionName",
Type: "string",
Description: "The name of the event subscription to subscribe to.",
},
{
Name: "endpoint",
Type: "string",
Description: "The endpoint domain to use for the subscription.",
},
{
Name: "key",
Type: "string",
Description: "The key to use to authenticate.",
},
},
},
}, SchemaSection{
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-aws-kinesis-stream-input
Type: "input",
Name: "aws_kinesis_stream",
Description: "AWS Kinesis stream input plugin.",
Properties: SchemaProperties{
Options: []SchemaOptions{
{
Name: "aws_access_key_id",
Type: "string",
Description: "AWS access key ID.",
},
{
Name: "aws_secret_access_key",
Type: "string",
Description: "AWS secret access key.",
},
{
Name: "aws_region",
Type: "string",
Description: "AWS region.",
},
{
Name: "stream_name",
Type: "string",
Description: "AWS Kinesis stream name.",
},
{
Name: "empty_interval",
Type: "string",
Description: "Interval to wait for new records when the stream is empty, string duration.",
Default: "10s",
},
{
Name: "limit",
Type: "integer",
Description: "Maximum number of records to read per request, integer.",
},
{
Name: "data_dir",
Type: "string",
Description: "Directory to store data. It holds a 1MB cache.",
Default: "/data/storage",
},
},
},
}, SchemaSection{
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-azure-blob-input
Type: "input",
Name: "flb_core_fluent_bit_azure_blob",
Description: "Calyptia LTS Azure Blob Storage Input Plugin",
Properties: SchemaProperties{
Options: []SchemaOptions{
{
Name: "account_name",
Type: "string",
Description: "Azure Storage Account Name",
},
{
Name: "container",
Type: "string",
Description: "If set, the plugin will only read from this container. Otherwise, it will read from all containers in the account.",
},
{
Name: "bucket",
Type: "string",
Description: "-",
},
},
},
}, SchemaSection{
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-plugin-input-s3-sqs
Type: "input",
Name: "s3_sqs",
Description: "Calyptia LTS advanced plugin providing logs replay from sqs events",
Properties: SchemaProperties{
Options: []SchemaOptions{
{
Name: "delete_messages",
Type: "boolean",
Description: "If true, messages will be deleted from the queue after being processed.",
Default: "true",
},
{
Name: "aws_s3_role_arn",
Type: "string",
Description: "The role ARN to assume when reading from S3.",
},
{
Name: "aws_s3_role_session_name",
Type: "string",
Description: "The session name to use when assuming the role.",
},
{
Name: "aws_s3_role_external_id",
Type: "string",
Description: "The external ID to use when assuming the role.",
},
{
Name: "aws_s3_role_duration",
Type: "string",
Description: "The duration to assume the role for, string duration.",
},
{
Name: "aws_sqs_role_arn",
Type: "string",
Description: "The role ARN to assume when reading from SQS.",
},
{
Name: "aws_sqs_role_session_name",
Type: "string",
Description: "The session name to use when assuming the role.",
},
{
Name: "aws_sqs_role_external_id",
Type: "string",
Description: "The external ID to use when assuming the role.",
},
{
Name: "aws_sqs_role_duration",
Type: "string",
Description: "The duration to assume the role for, string duration.",
},
{
Name: "aws_access_key",
Type: "string",
Description: "AWS access key.",
},
{
Name: "aws_secret_key",
Type: "string",
Description: "AWS secret key.",
},
{
Name: "aws_bucket_name",
Type: "string",
Description: "AWS S3 bucket name.",
},
{
Name: "aws_bucket_region",
Type: "string",
Description: "AWS S3 bucket region.",
},
{
Name: "match_regexp",
Type: "string",
Description: "The regular expression to match against the SQS message body.",
Default: ".*",
},
{
Name: "aws_s3_enable_imds",
Type: "boolean",
Description: "If true, the plugin will use the Instance Metadata Service to retrieve credentials.",
},
{
Name: "sqs_queue_name",
Type: "string",
Description: "The name of the SQS queue to read from.",
},
{
Name: "sqs_queue_region",
Type: "string",
Description: "The region of the SQS queue to read from.",
},
{
Name: "aws_sqs_endpoint",
Type: "string",
Description: "The endpoint to use when reading from SQS.",
},
{
Name: "max_line_buffer_size",
Type: "size",
Description: "The maximum size of the line buffer, size.",
Default: "10 MB",
},
{
Name: "s3_read_concurrency",
Type: "integer",
Description: "The number of concurrent S3 reads, integer. Defaults to the number of CPUs.",
},
},
},
}, SchemaSection{
// See https://github.com/chronosphereio/calyptia-core-fluent-bit-plugin-datagen
Type: "input",
Name: "datagen",
Description: "Datagen input plugin generates fake logs at a given interval",
Properties: SchemaProperties{
Options: []SchemaOptions{
{
Name: "template",
Type: "string",
Description: "Golang template that evaluates into a JSON string.",
},
{
Name: "rate",
Type: "string",
Description: "Duration rate at which records are produced.",
Default: "1s",
},
},
},
})
Expand Down

0 comments on commit 803cb80

Please sign in to comment.