LogoLogo
HomeProductsDownload Community Edition
5.5
  • Lenses DevX
  • Kafka Connectors
  • Kafka to Kafka Replicator
  • Overview
  • Learn
  • What’s New?
  • Getting Started
    • Quick Start
    • Connecting Lenses to your environment
      • Prerequisites
      • Kafka
        • Apache Kafka
        • AWS MSK
        • AWS MSK Serverless
        • Aiven
        • Azure HDInsight
        • Confluent Cloud
        • Confluent Platform
        • IBM Event Streams
      • Adding a License
      • Kafka Connect
      • Schema Registries
        • AWS Glue
        • Confluent
        • Apicurio
        • IBM Event Streams Registry
      • Zookeeper
      • Alert & Audit Integrations
      • AWS
  • Deployment
    • Installation
      • Helm
      • Docker
      • Linux
      • AWS Marketplace
      • Lenses Box
      • Automating Connections
        • File Watcher Provisioning
        • API Provisioning
        • Provisioning examples
          • Kafka
          • Zookeeper
          • Schema Registry
          • Kafka Connect
          • Kerberos
          • JMX Metrics
        • Provisioning API reference
        • CLI Import & Export
    • Configuration
      • Identity & Access Management
        • Authentication
          • Admin Account
          • Azure AD
          • Basic Authentication
          • Custom Http
          • LDAP
          • SSO & SAML
            • Azure SSO
            • Google SSO
            • Keycloak SSO
            • Okta SSO
            • Onelogin SSO
            • FAQs
          • Kerberos
        • Groups
        • Users
        • Service accounts
        • Permission Reference
      • Lenses Metadata Database
      • Enable TLS on Lenses
      • Required Kafka ACLs
      • SQL Processor Deployment
      • Lenses JVM Options
      • Lenses JMX Metrics
      • Rate Limiting
      • Networking with Load Balancers
      • Logs
      • Plugins
      • Configuration Reference
  • User Guide
    • Topics
      • Finding topics & fields
      • Searching for messages
      • Inserting & deleting messages
      • Viewing topic metrics
      • Viewing topic partitions
      • Topic Settings
      • Adding metadata & tags to topics
      • Managing topic configurations
      • Approval requests
      • Downloading messages
      • Backup & Restore
    • Schemas
    • Connectors
      • Sources
      • Sinks
      • Secret Providers
    • Monitoring & Alerting
      • Infrastructure Health
      • Alerting
        • Alert Reference
      • Integrations
      • Consumer Groups
    • Self Service & Governance
      • Data policies
      • Audits
      • Kafka ACLs
      • Kafka Quotas
    • Lenses SQL
      • SQL Studio
        • Concepts
        • Best practices
        • Creating & deleting Kafka topics
        • Filtering
        • Limit & Sampling
        • Joins
        • Inserting & deleting data
        • Aggregations
        • Metadata fields
        • Views & synonyms
        • Arrays
        • Managing queries
      • SQL Processors
        • Concepts
        • Projections
        • Joins
        • Lateral Joins
        • Aggregations
        • Time & Windows
        • Storage format
        • Nullibility
        • Settings
      • SQL Reference
        • Expressions
        • Functions
          • Aggregate
            • AVG
            • BOTTOMK
            • COLLECT
            • COLLECT_UNIQUE
            • COUNT
            • FIRST
            • LAST
            • MAXK
            • MAXK_UNIQUE
            • MINK
            • MINK_UNIQUE
            • SUM
            • TOPK
          • Array
            • ELEMENT_OF
            • FLATTEN
            • IN_ARRAY
            • REPEAT
            • SIZEOF
            • ZIP_ALL
            • ZIP
          • Conditions
          • Conversion
          • Date & Time
            • CONVERT_DATETIME
            • DATE
            • DATETIME
            • EXTRACT_TIME
            • EXTRACT_DATE
            • FORMAT_DATE
            • FORMAT_TIME
            • FORMAT_TIMESTAMP
            • HOUR
            • MONTH_TEXT
            • MINUTE
            • MONTH
            • PARSE_DATE
            • PARSE_TIME_MILLIS
            • PARSE_TIME_MICROS
            • PARSE_TIMESTAMP_MILLIS
            • PARSE_TIMESTAMP_MICROS
            • SECOND
            • TIMESTAMP
            • TIME_MICROS
            • TIMESTAMP_MICROS
            • TIME_MILLIS
            • TIMESTAMP_MILLIS
            • TO_DATE
            • TO_DATETIME
            • TOMORROW
            • TO_TIMESTAMP
            • YEAR
            • YESTERDAY
          • Headers
            • HEADERASSTRING
            • HEADERASINT
            • HEADERASLONG
            • HEADERASDOUBLE
            • HEADERASFLOAT
            • HEADERKEYS
          • JSON
            • JSON_EXTRACT_FIRST
            • JSON_EXTRACT_ALL
          • Numeric
            • ABS
            • ACOS
            • ASIN
            • ATAN
            • CBRT
            • CEIL
            • COSH
            • COS
            • DEGREES
            • DISTANCE
            • FLOOR
            • MAX
            • MIN
            • MOD
            • NEG
            • POW
            • RADIANS
            • RANDINT
            • ROUND
            • SIGN
            • SINH
            • SIN
            • SQRT
            • TANH
            • TAN
          • Nulls
            • ISNULL
            • ISNOTNULL
            • COALESCE
            • AS_NULLABLE
            • AS_NON_NULLABLE
          • Obfuscation
            • ANONYMIZE
            • MASK
            • EMAIL
            • FIRST1
            • FIRST2
            • FIRST3
            • FIRST4
            • LAST1
            • LAST2
            • LAST3
            • LAST4
            • INITIALS
          • Offsets
          • Schema
            • TYPEOF
            • DUMP
          • String
            • ABBREVIATE
            • BASE64
            • CAPITALIZE
            • CENTER
            • CHOP
            • CONCAT
            • CONTAINS
            • DECODE64
            • DELETEWHITESPACE
            • DIGITS
            • DROPLEFT
            • DROPRIGHT
            • ENDSWITH
            • INDEXOF
            • LEN
            • LOWER
            • LPAD
            • MKSTRING
            • REGEXP
            • REGEX_MATCHES
            • REPLACE
            • REVERSE
            • RPAD
            • STARTSWITH
            • STRIPACCENTS
            • SUBSTR
            • SWAPCASE
            • TAKELEFT
            • TAKERIGHT
            • TRIM
            • TRUNCATE
            • UNCAPITALIZE
            • UPPER
            • UUID
          • User Defined Functions
          • User Defined Aggregate Functions
        • Deserializers
        • Supported data formats
          • Protobuf
    • Topology
      • Registering via SDK
      • Registring via REST
    • License
    • CLI
      • Data
        • Datasets
        • Data Policies
        • Elasticsearch
        • Kafka topics
        • Querying data
      • Admin
        • Alerts
        • Alert Channels
        • Audit Channels
        • Connections
        • Groups
        • Schemas
        • Service Accounts
        • License
        • Users
      • Applications
        • Kafka Connectors
        • SQL Processors
      • Manage Kafka
        • ACLs
        • Consumers
        • Quotas
      • Golang client
  • Resources
    • Support & Community
    • Tutorials
      • SQL Studio
        • Querying data
        • Accessing headers
        • Deleting data from compacted topics
        • Working with JSON
      • SQL Processors
        • Data formats
          • Changing data formats
          • Rekeying data
          • Controlling AVRO record names and namespaces
          • Changing the shape of data
        • Filtering & Joins
          • Filtering data
          • Enriching data streams
          • Joining streams of data
          • Using multiple topics
        • Aggregations
          • Aggregating data in a table
          • Aggregating streams
          • Time window aggregations
        • Complex types
          • Unwrapping complex types
          • Working with Arrays
        • Controlling event time
    • Downloads
    • API Reference
      • Authentication API
      • Lenses API Spec
      • Websocket Spec
      • Provisioning API Spec
Powered by GitBook
LogoLogo

Resources

  • Privacy
  • Cookies
  • Terms & Conditions
  • Community EULA

2024 © Lenses.io Ltd. Apache, Apache Kafka, Kafka and associated open source project names are trademarks of the Apache Software Foundation.

On this page
  • Adding plugins
  • SQL Processors in Kubernetes
  • Archive served via HTTP
  • Custom Docker image

Was this helpful?

Export as PDF
  1. Deployment
  2. Configuration

Plugins

This page describes how to install plugins in Lenses.

The following implementations can be specified:

  1. Serializers/Deserializers Plug your serializer and deserializer to enable observability over any data format (i.e., protobuf / thrift)

  2. Custom authentication Authenticate users on your proxy and inject permissions HTTP headers.

  3. LDAP lookup Use multiple LDAP servers or your group mapping logic.

  4. SQL UDFs User Defined Functions (UDF) that extend SQL and streaming SQL capabilities.

Once built, the jar files and any plugin dependencies should be added to Lenses and, in the case of Serializers and UDFs, to the SQL Processors if required.

Adding plugins

On startup, Lenses loads plugins from the $LENSES_HOME/plugins/ directory and any location set in the environment variable LENSES_PLUGINS_CLASSPATH_OPTS. These locations Lenses is watching, and dropping a new plugin will hot-reload it. For the Lenses docker (and Helm chart) you use /data/plugins.

Any first-level directories under the paths mentioned above, detected on startup will also be monitored for new files. During startup, the list of monitored locations will be shown in the logs to help confirm the setup.

...
Initializing (pre-run) Lenses
Installation directory autodetected: /opt/lenses
Current directory: /data
Logback configuration file autodetected: logback.xml
These directories will be monitored for new jar files:
 - /opt/lenses/plugins
 - /data/plugins
 - /opt/lenses/serde
Starting application
...

Whilst all jar files may be added to the same directory (e.g /data/plugins), it is suggested to use a directory hierarchy to make management and maintenance easier.

An example hierarchy for a set of plugins:

├── security
│   └── sso_header_decoder.jar
├── serde
│   ├── protobuf_actions.jar
│   └── protobuf_clients.jar
└── udf
    ├── eu_vat.jar
    ├── reverse_geocode.jar
    └── summer_sale_discount.jar

SQL Processors in Kubernetes

There are two ways to add custom plugins (UDFs and Serializers) to the SQL Processors; (1) via making available a tar.gz archive at an HTTP (s) address, or (2) via creating a custom docker image.

Archive served via HTTP

With this method, a tar archive, compressed with gzip, can be created that contains all plugin jars and their dependencies. Then this archive should be uploaded to a web server that the SQL Processors containers can access, and its address should be set with the option lenses.kubernetes.processor.extra.jars.url.

Step by step:

  1. Create a tar.gz file that includes all required jars at its root:

    tar -czf [FILENAME.tar.gz] -C /path/to/jars/ *
  2. Upload to a web server, ie. https://example.net/myfiles/FILENAME.tar.gz

  3. Set

    lenses.kubernetes.processor.extra.jars.url=https://example.net/myfiles/FILENAME.tar.gz

    For the docker image, set the corresponding environment variable

    LENSES_KUBERNETES_PROCESSOR_EXTRA_JARS_URL=https://example.net/myfiles/FILENAME.tar.gz`

Custom Docker image

The SQL Processors that run inside Kubernetes use the docker image lensesio-extra/sql-processor. It is possible to build a custom image and add all the required jar files under the /plugins directory, then set lenses.kubernetes.processor.image.name and lenses.kubernetes.processor.image.tag options to point to the custom image.

Step by step:

  1. Create a Docker image using lensesio-extra/sql-processor:VERSION as a base and add all required jar files under /plugins:

    FROM lensesio-extra/sql-processor:4.2
    ADD jars/* /plugins
    docker build -t example/sql-processor:4.2 .
  2. Upload the docker image to a registry:

    docker push example/sql-processor:4.2
  3. Set

    lenses.kubernetes.processor.image.name=example/sql-processor
    lenses.kubernetes.processor.image.tag=4.2

    For the docker image, set the corresponding environment variables

    LENSES_KUBERNETES_PROCESSOR_IMAGE_NAME=example/sql-processor
    LENSES_KUBERNETES_PROCESSOR_IMAGE_TAG=4.2
PreviousLogsNextConfiguration Reference

Last updated 9 months ago

Was this helpful?