Package io.micrometer.influx
Interface InfluxConfig
- All Superinterfaces:
io.micrometer.core.instrument.config.MeterRegistryConfig,io.micrometer.core.instrument.push.PushRegistryConfig,io.micrometer.core.instrument.step.StepRegistryConfig
public interface InfluxConfig
extends io.micrometer.core.instrument.step.StepRegistryConfig
Configuration for
InfluxMeterRegistry.
Since Micrometer 1.7, InfluxDB v2 and v1 are supported.-
Field Summary
Fields Modifier and Type Field Description static InfluxConfigDEFAULTAccept configuration defaults -
Method Summary
Modifier and Type Method Description default InfluxApiVersionapiVersion()Specifies the API version used to send metrics.default booleanautoCreateDb()Auto-creating the database is only supported with InfluxDB v1.default java.lang.Stringbucket()Specifies the destination bucket for writes.default booleancompressed()default InfluxConsistencyconsistency()Must be one of 'any', 'one', 'quorum', or 'all'.default java.lang.Stringdb()default java.lang.Stringorg()Specifies the destination organization for writes.default java.lang.Stringpassword()Authentication by 'userName' and 'password' is not supported for InfluxDB v2.default java.lang.Stringprefix()default java.lang.StringretentionDuration()This retention configuration will only be used with InfluxDB v1.default java.lang.StringretentionPolicy()This retention configuration will only be used with InfluxDB v1.default java.lang.IntegerretentionReplicationFactor()This retention configuration will only be used with InfluxDB v1.default java.lang.StringretentionShardDuration()This retention configuration will only be used with InfluxDB v1.default java.lang.Stringtoken()Authentication token for the InfluxDB API.default java.lang.Stringuri()default java.lang.StringuserName()Authentication by 'userName' and 'password' is not supported for InfluxDB v2.default io.micrometer.core.instrument.config.validate.Validated<?>validate()Methods inherited from interface io.micrometer.core.instrument.config.MeterRegistryConfig
get, requireValidMethods inherited from interface io.micrometer.core.instrument.push.PushRegistryConfig
batchSize, connectTimeout, enabled, numThreads, readTimeout, step
-
Field Details
-
DEFAULT
Accept configuration defaults
-
-
Method Details
-
prefix
default java.lang.String prefix()- Specified by:
prefixin interfaceio.micrometer.core.instrument.config.MeterRegistryConfig
-
db
default java.lang.String db()- Returns:
- The db to send metrics to. Defaults to "mydb".
-
consistency
Must be one of 'any', 'one', 'quorum', or 'all'. Only available for InfluxEnterprise clusters.- Returns:
- Sets the write consistency for each point. The default is 'one'.
-
userName
@Nullable default java.lang.String userName()Authentication by 'userName' and 'password' is not supported for InfluxDB v2.- Returns:
- Authenticate requests with this user. By default is
null, and the registry will not attempt to present credentials to Influx.
-
password
@Nullable default java.lang.String password()Authentication by 'userName' and 'password' is not supported for InfluxDB v2.- Returns:
- Authenticate requests with this password. By default is
null, and the registry will not attempt to present credentials to Influx.
-
retentionPolicy
@Nullable default java.lang.String retentionPolicy()This retention configuration will only be used with InfluxDB v1.- Returns:
- Influx writes to the DEFAULT retention policy if one is not specified.
-
retentionDuration
@Nullable default java.lang.String retentionDuration()This retention configuration will only be used with InfluxDB v1.- Returns:
- Time period for which influx should retain data in the current database (e.g. 2h, 52w).
-
retentionReplicationFactor
@Nullable default java.lang.Integer retentionReplicationFactor()This retention configuration will only be used with InfluxDB v1.- Returns:
- How many copies of the data are stored in the cluster. Must be 1 for a single node instance.
-
retentionShardDuration
@Nullable default java.lang.String retentionShardDuration()This retention configuration will only be used with InfluxDB v1.- Returns:
- The time range covered by a shard group (e.g. 2h, 52w).
-
uri
default java.lang.String uri()- Returns:
- The URI for the Influx backend. The default is
http://localhost:8086.
-
compressed
default boolean compressed()- Returns:
trueif metrics publish batches should be GZIP compressed,falseotherwise.
-
autoCreateDb
default boolean autoCreateDb()Auto-creating the database is only supported with InfluxDB v1.- Returns:
trueif Micrometer should check ifdb()exists before attempting to publish metrics to it, creating it if it does not exist.
-
apiVersion
Specifies the API version used to send metrics. Use 'v1' or 'v2' based on the version of your InfluxDB. Defaults to 'v1' unless anorg()is configured. If anorg()is configured, defaults to 'v2'.- Returns:
- The API version used to send metrics.
- Since:
- 1.7
-
org
@Nullable default java.lang.String org()Specifies the destination organization for writes. Takes either the ID or Name interchangeably. This is only used with InfluxDB v2.- Returns:
- The destination organization for writes.
- Since:
- 1.7
- See Also:
- How to retrieve the org parameter in the InfluxDB UI.
-
bucket
default java.lang.String bucket()Specifies the destination bucket for writes. Takes either the ID or Name interchangeably. This is only used with InfluxDB v2.- Returns:
- The destination bucket (or db) for writes.
- Since:
- 1.7
- See Also:
- How to retrieve the bucket parameter in the InfluxDB UI.
-
token
@Nullable default java.lang.String token()Authentication token for the InfluxDB API. This takes precedence over userName/password if configured.- Returns:
- Authentication token to authorize API requests.
- Since:
- 1.7
- See Also:
- InfluxDB v1: Include the token in HTTP requests, InfluxDB v2: Authentication API
-
validate
default io.micrometer.core.instrument.config.validate.Validated<?> validate()- Specified by:
validatein interfaceio.micrometer.core.instrument.config.MeterRegistryConfig- Specified by:
validatein interfaceio.micrometer.core.instrument.push.PushRegistryConfig
-