This plugin allow you to enhance the ElasticSearch data schema with the API name / application name.
The plugin get these additional data from the Gravitee.io Management REST API. A cache mechanism allows to call the API only once as these data not change often. Default time to live is set to 24 hours.
As a new ES processor is available, we have to enable it from the gateway configuration on the gravitee.yml
:
gravitee.reporters.elasticsearch.pipeline.plugins.ingest=gravitee
First of all you have to install the plugin within ElasticSearch:
/usr/share/elasticsearch/bin/elasticsearch-plugin install file:///path_to_the_plugin/gravitee-elasticsearch-ingest-plugin-${version}.zip
And configure the endpoint information on the elasticsearch.yml
:
ingest.gravitee:
endpoint: https://gravitee_management_host/management
username: admin
password: admin
cache:
maxElement: 1000
# 1 hour
ttl: 3600
headers:
- "key: value"
- "Custom-Header: HeaderValue"
By default the plugin will try to call the REST API on http://localhost:8083/management
with username admin
and password admin
.
By default, this plugin provides a Processor to enhance Ingest documents with both API and application names. If you need to enhance Ingest documents with more than those properties, you can extend this plugin to add extra processors:
-
implementing extra
io.gravitee.elasticsearch.ingest.plugin.IngestDocumentEnhancer
responsible for enhancing Ingest document with some new properties. -
extending the
io.gravitee.elasticsearch.ingest.plugin.EnhanceGraviteeAttributionProcessor.Factory
class and overridinginitializeDocumentEnhancers()
method to initialize extraIngestDocumentEnhancer
. -
extending the
io.gravitee.elasticsearch.ingest.plugin.IngestGraviteePlugin
class and overridingbuildProcessorFactory()
to initialize the processor factory.