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

bin: add support for full config JSON schema (-J) #5064

Merged
merged 4 commits into from
Mar 11, 2022
Merged

Conversation

edsiper
Copy link
Member

@edsiper edsiper commented Mar 11, 2022

The following patch introduces an extension to the config helper by providing a full JSON schema. It can be triggered as follows:

fluent-bit -J

This is the pretty printed version of the JSON output:

{
  "fluent-bit": {
    "version": "1.9.0",
    "schema_version": "1",
    "os": "linux"
  },
  "customs": [
    {
      "type": "custom",
      "name": "calyptia",
      "description": "Calyptia Cloud",
      "properties": {
        "options": [
          {
            "name": "api_key",
            "description": "Calyptia Cloud API Key.",
            "default": null,
            "type": "string"
          },
          {
            "name": "store_path",
            "description": "",
            "default": null,
            "type": "string"
          },
          {
            "name": "calyptia_host",
            "description": "",
            "default": null,
            "type": "string"
          },
          {
            "name": "calyptia_port",
            "description": "",
            "default": null,
            "type": "string"
          },
          {
            "name": "calyptia_tls",
            "description": "",
            "default": "true",
            "type": "boolean"
          },
          {
            "name": "calyptia_tls.verify",
            "description": "",
            "default": "true",
            "type": "boolean"
          },
          {
            "name": "add_label",
            "description": "Label to append to the generated metric.",
            "default": null,
            "type": "space delimited strings (minimum 1)"
          },
          {
            "name": "machine_id",
            "description": "Custom machine_id to be used when registering agent",
            "default": null,
            "type": "string"
          }
        ]
      }
    }
  ],
  "inputs": [
    {
      "type": "input",
      "name": "cpu",
      "description": "CPU Usage",
      "properties": {
        "options": [
          {
            "name": "pid",
            "description": "Configure a single process to measure usage via their PID",
            "default": "-1",
            "type": "integer"
          },
          {
            "name": "interval_sec",
            "description": "Set the collector interval",
            "default": "1",
            "type": "integer"
          },
          {
            "name": "interval_nsec",
            "description": "Set the collector interval (sub seconds)",
            "default": "0",
            "type": "integer"
          }
        ]
      }
    },
    ......(redacted).......
            }
        ]
      }
    }
  ]
}

attached is tarball with the full content: 1.9.0.schema.json.tar.gz


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.

Signed-off-by: Eduardo Silva <eduardo@calyptia.com>
Signed-off-by: Eduardo Silva <eduardo@calyptia.com>
Signed-off-by: Eduardo Silva <eduardo@calyptia.com>
Signed-off-by: Eduardo Silva <eduardo@calyptia.com>
@edsiper edsiper changed the title Json schema bin: add support for full config JSON schema (-J) Mar 11, 2022
@edsiper edsiper merged commit 07f5ea4 into master Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant