Skip to content

Ability to distribute Fabric templates inside a plugin #151

Description

@traut

Background

With the content libraries, like Fabric Templates, accumulating useful templates for various use cases, and vendors producing integration-specific templates, there should be an easy way for the users to access the templates.

Design

Utilize our existing plugin infrastructure (plugin registry and dependency installation logic) to deliver content by including the templates inside the plugins.

Requirements

  • the plugins may include Fabric templates
  • it should be possible to add templates to existing plugins without breaking the current installation / upgrade flow. For example, we should be able to add Elastic-specific templates inside blackstork/elastic plugin
  • it should be possible to have content-only plugins -- plugins that contain only templates, without any data sources / content provides / data sinks. For example, we might build blackstork/fabric-templates plugin that would represent Fabric Template release.
  • the templates / blocks defined in the Fabric configuration files inside the plugin should be accessible for the user -- for example, it should be possible to reference a block with ref syntax:
    • To Estimate: if it is possible to namespace the block id (for example, section.ctid_executive_summary) without breaking the parsing, we should do it. If it would require significant refactoring or breaking changes, we should postpone it.
    • For example, a namespaced section ID for a section in blackstork/fabric_tempaltes plugin would look like this:
      document "my-doc" {
        section ref {
          base = fabric_templates/section.ctid_executive_summary
        }
      }

Full example:

fabric {
  plugin_versions = {
    "blackstork/elastic" = ">= 1.2.3",
    "blackstork/fabric_templates" = ">= 0.1.1",
  }
}

document "my-doc" {

  data ref "my_alerts" {
    base = elastic/data.elasticsearch.alerts_with_aggregations
    query = "@timestamp:[now-7d TO now]"
  }

  section ref {
    base = fabric_templates/section.ctid_executive_summary
  }
}

Implementation

TBD in the comments

Constraints

  • storage is cheaper than computing, so it is better to unpack the configs to the FS for use during fabric execution instead of unpacking-on-the-fly

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions