Skip to content

Commit d2f789f

Browse files
authored
Documentation cleanup (#3486)
* Split upgrade guide into different pages * Move some metrics under data stores * Make some nested paths more consistent
1 parent ec72304 commit d2f789f

File tree

21 files changed

+1455
-1458
lines changed

21 files changed

+1455
-1458
lines changed

docs/user/appendix/metrics.rst

Lines changed: 6 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,8 @@
1-
.. _geomesa_metrics:
2-
31
Micrometer Metrics
42
==================
53

6-
GeoMesa has initial support for `Micrometer <https://docs.micrometer.io/micrometer/reference/>`__ metrics. Currently,
7-
metrics can integrate with either Prometheus or Cloudwatch. Creating registries is idempotent, as long as the
8-
configuration does not change.
9-
10-
Most GeoMesa data stores support the parameters ``geomesa.metrics.registry`` and ``geomesa.metrics.registry.config``, which are
11-
used to start up a registry for publishing metrics. Configuration is described below.
12-
13-
When enabled, various GeoMesa components will publish metrics, including the :ref:`kafka_index` and :ref:`converters`.
14-
15-
Prometheus Registry
16-
-------------------
17-
18-
The Prometheus registry can be configured through the following environment variables:
19-
20-
+--------------------------------------+---------+----------------------------------------------+
21-
| Environment Variable | Default | Description |
22-
+======================================+=========+==============================================+
23-
| ``RENAME_PROMETHEUS_METRICS`` | true | `Rename`__ metrics |
24-
+--------------------------------------+---------+----------------------------------------------+
25-
| ``METRICS_APPLICATION_NAME`` | geomesa | Add a tag for ``application`` to all metrics |
26-
+--------------------------------------+---------+----------------------------------------------+
27-
| ``METRICS_PORT`` | 9090 | Set the port used to host metrics |
28-
+--------------------------------------+---------+----------------------------------------------+
29-
30-
__ https://docs.micrometer.io/micrometer/reference/implementations/prometheus.html#_the_prometheus_rename_filter
31-
32-
Instead of environment variables, the registry can be fully configured using using the data store parameter
33-
``geomesa.metrics.registry.config``, which takes `Lightbend Config <https://github.com/lightbend/config/tree/main>`__:
34-
35-
::
36-
37-
# port used to serve metrics - not used if push-gateway is defined
38-
port = 9090
39-
# tags applied to all metrics, may be any key-value string pairs
40-
common-tags = { "application" = "my-app" }
41-
# use prometheus "standard" names - see https://docs.micrometer.io/micrometer/reference/implementations/prometheus.html#_the_prometheus_rename_filter
42-
rename = false
43-
# additional config - can also be done via sys props, see https://prometheus.github.io/client_java/config/config/
44-
properties = {}
45-
# optional - enable pushgateway for short-lived jobs, instead of the standard metrics server for scraping
46-
push-gateway = {
47-
host = "localhost:9091"
48-
job = "my-job"
49-
scheme = "http"
50-
format = "PROMETHEUS_PROTOBUF" # or PROMETHEUS_TEXT
51-
}
52-
53-
If using Pushgateway, the following dependency is required:
54-
55-
.. code-block:: xml
56-
57-
<dependency>
58-
<groupId>io.prometheus</groupId>
59-
<artifactId>prometheus-metrics-exporter-pushgateway</artifactId>
60-
<version>{{prometheus_version}}</version>
61-
</dependency>
62-
63-
Cloudwatch Registry
64-
-------------------
65-
66-
The Cloudwatch registry can be configured through the following environment variables:
67-
68-
+--------------------------------------+---------+----------------------------------------------+
69-
| Environment Variable | Default | Description |
70-
+======================================+=========+==============================================+
71-
| ``METRICS_NAMESPACE`` | geomesa | Cloudwatch namespace |
72-
+--------------------------------------+---------+----------------------------------------------+
73-
74-
Instead of environment variables, the registry can be fully configured using using the data store parameter
75-
``geomesa.metrics.registry.config``, which takes `Lightbend Config <https://github.com/lightbend/config/tree/main>`__:
76-
77-
::
78-
79-
# cloudwatch namespace
80-
namespace = "geomesa"
81-
# properties for the cloudwatch client
82-
properties = {}
83-
84-
For Cloudwatch, the following dependency is required:
85-
86-
.. code-block:: xml
87-
88-
<dependency>
89-
<groupId>io.micrometer</groupId>
90-
<artifactId>micrometer-registry-cloudwatch2</artifactId>
91-
<version>{{micrometer_version}}</version>
92-
</dependency>
93-
94-
Instrumentations
95-
----------------
96-
97-
When adding a registry, additional JVM metrics can be exposed with the following environment variables:
98-
99-
+--------------------------------------+---------+----------------------------------------------+
100-
| Environment Variable | Default | Description |
101-
+======================================+=========+==============================================+
102-
| ``METRICS_INSTRUMENTATIONS_ENABLED`` | true | Enable all JVM instrumentations |
103-
+--------------------------------------+---------+----------------------------------------------+
104-
105-
Individual instrumentations can be enabled or disabled through the following environment variables:
106-
107-
+--------------------------------------+---------+----------------------------------------------+
108-
| Environment Variable | Default | Description |
109-
+======================================+=========+==============================================+
110-
| ``METRICS_INSTRUMENT_CLASSLOADER`` | | Enable metrics on JVM class loading |
111-
+--------------------------------------+---------+----------------------------------------------+
112-
| ``METRICS_INSTRUMENT_MEMORY`` | | Enable metrics on JVM memory usage |
113-
+--------------------------------------+---------+----------------------------------------------+
114-
| ``METRICS_INSTRUMENT_GC`` | | Enable metrics on JVM garbage collection |
115-
+--------------------------------------+---------+----------------------------------------------+
116-
| ``METRICS_INSTRUMENT_PROCESSOR`` | | Enable metrics on processor usage |
117-
+--------------------------------------+---------+----------------------------------------------+
118-
| ``METRICS_INSTRUMENT_THREADS`` | | Enable metrics on JVM thread usage |
119-
+--------------------------------------+---------+----------------------------------------------+
120-
| ``METRICS_INSTRUMENT_COMMONS_POOL`` | | Enable metrics on Apache commons-pool pools |
121-
+--------------------------------------+---------+----------------------------------------------+
122-
| ``METRICS_INSTRUMENT_POSTGRES`` | | Enable metrics on PostgreSQL |
123-
+--------------------------------------+---------+----------------------------------------------+
124-
125-
Or, when using ``geomesa.metrics.registry.config``, use the following keys:
126-
127-
::
128-
129-
# tags are key-value string pairs added to metrics from the given instrumentation
130-
classloader = { enabled = true, tags = {} }
131-
memory = { enabled = true, tags = {} }
132-
gc = { enabled = true, tags = {} }
133-
processor = { enabled = true, tags = {} }
134-
threads = { enabled = true, tags = {} }
135-
commons-pool = { enabled = true, tags = {} }
136-
postgres = { enabled = true, tags = {} }
137-
138-
.. note::
139-
140-
PostgreSQL metrics are only available in the :ref:`postgis_index_page`.
141-
142-
Standalone Usage
143-
----------------
144-
145-
Registries can also be managed programmatically. This allows for greater flexibility and usage outside the normal GeoMesa
146-
workflows. Configuration can be managed as detailed above.
4+
GeoMesa provide built-in :ref:`geomesa_metrics` integrations. However, registries can also be managed programmatically, which
5+
allows for greater flexibility and usage outside the normal GeoMesa workflows. Configuration is detailed in :ref:`geomesa_metrics`.
1476

1487
Prometheus
1498
^^^^^^^^^^
@@ -183,7 +42,7 @@ To idempotently create a Prometheus registry and attach it to the global registr
18342
import com.typesafe.config.ConfigFactory;
18443
import org.locationtech.geomesa.metrics.micrometer.prometheus.PrometheusFactory;
18544

186-
// call close() on the result to shut down the server
45+
// call close() on the result to deregister the server
18746
// this call uses environment variables to configure the registry
18847
Closeable registry = PrometheusFactory.register();
18948
// alternatively, use the method that accepts configuration directly
@@ -199,7 +58,7 @@ To idempotently create a Prometheus registry and attach it to the global registr
19958
import com.typesafe.config.ConfigFactory
20059
import org.locationtech.geomesa.metrics.micrometer.prometheus.PrometheusFactory
20160

202-
// call close() on the result to shut down the server
61+
// call close() on the result to deregister the server
20362
// this call uses environment variables to configure the registry
20463
val registry: Closeable = PrometheusFactory.register()
20564
// alternatively, use the method that accepts configuration directly
@@ -279,7 +138,7 @@ To idempotently start a Cloudwatch registry and attach it to the global registry
279138
import com.typesafe.config.ConfigFactory;
280139
import org.locationtech.geomesa.metrics.micrometer.cloudwatch.CloudwatchFactory;
281140

282-
// call close() on the result to shut down the server
141+
// call close() on the result to deregister the server
283142
// this call uses environment variables to configure the registry (see below)
284143
Closeable registry = CloudwatchFactory.register();
285144
// or, for full control pass in a configuration
@@ -290,7 +149,7 @@ To idempotently start a Cloudwatch registry and attach it to the global registry
290149
import com.typesafe.config.ConfigFactory
291150
import org.locationtech.geomesa.metrics.micrometer.cloudwatch.CloudwatchFactory
292151

293-
// call close() on the result to shut down the server
152+
// call close() on the result to deregister the server
294153
// this call uses environment variables to configure the registry (see below)
295154
val registry: Closeable = CloudwatchFactory.register()
296155
// or, for full control pass in a configuration
@@ -315,9 +174,3 @@ pooling. First, ensure that the ``commons-pool`` instrumentation is enabled (abo
315174
import org.locationtech.geomesa.metrics.micrometer.dbcp2.MetricsDataSource
316175

317176
val dataSource = new MetricsDataSource()
318-
319-
Custom Registries
320-
-----------------
321-
322-
If the provided registries are not sufficient, metrics can be exposed by programmatically adding any Micrometer registry to the
323-
`global registry <https://docs.micrometer.io/micrometer/reference/concepts/registry.html#_global_registry>`__.

docs/user/datastores/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Not sure where to begin? Take a look at :doc:`/user/getting_started`.
1616
json
1717
index_overview
1818
index_basics
19-
index_ext
2019
index_config
2120
runtime_config
2221
query_planning
@@ -26,6 +25,7 @@ Not sure where to begin? Take a look at :doc:`/user/getting_started`.
2625
analytic_queries
2726
security
2827
auditing
28+
metrics
2929
data
3030
reserved_words
3131

docs/user/datastores/index_basics.rst

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ To prioritize certain attributes over others, see :ref:`attribute_cardinality`.
106106
.. _index_versioning:
107107

108108
Index Versioning
109-
================
109+
----------------
110110

111111
In order to ensure cross-compatibility, each index created by GeoMesa has a version number that identifies
112112
the layout of data on disk, which is fixed at the time of creation. Updating GeoMesa versions
@@ -215,3 +215,32 @@ back-end-specific index version numbers.
215215

216216
Note that GeoMesa versions prior to 1.2.2 included a geohash index. That index has been replaced with
217217
the Z indices and is no longer supported.
218+
219+
Additional Index Implementations
220+
--------------------------------
221+
222+
GeoMesa supports additional index formats at runtime, using
223+
`Java service providers <https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html>`__. To add a new
224+
index, implement ``org.locationtech.geomesa.index.api.GeoMesaFeatureIndexFactory`` and register your class under
225+
``META-INF/services``, as described in the
226+
`Java documentation <https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html>`__.
227+
228+
Once an index is registered, it can be enabled through the ``SimpleFeatureType`` user data, as described in
229+
:ref:`customizing_index_creation`.
230+
231+
Some additional indices are provided out-of-the-box:
232+
233+
S2/S3 Index
234+
^^^^^^^^^^^
235+
236+
The S2 and S3 indices are based on the `S2 library <https://github.com/google/s2geometry>`__:
237+
238+
.. pull-quote::
239+
240+
The S2 library represents all data on a three-dimensional sphere (similar to a globe). This makes it
241+
possible to build a worldwide geographic database with no seams or singularities, using a single coordinate
242+
system, and with low distortion everywhere compared to the true shape of the Earth.
243+
244+
The S2 index is a spatial index, identified by the name ``s2``. The S3 index is a composite spatial and time index,
245+
identified by the name ``s3``. The default time period for the S3 index can be configured through the user data
246+
key ``geomesa.s3.interval`` (see :ref:`customizing_z_index` for reference).

docs/user/datastores/index_ext.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)