|
| 1 | +package v1 |
| 2 | + |
| 3 | +type BackendsConfig struct { |
| 4 | + // If specified, enables the LocalFile backend. |
| 5 | + LocalFile LocalFileBackendConfig `json:"localFile,omitempty"` |
| 6 | + // If specified, enables the InfluxDB backend. |
| 7 | + InfluxDB InfluxdbBackendConfig `json:"influxdb,omitempty"` |
| 8 | +} |
| 9 | + |
| 10 | +type LocalFileBackendConfig struct { |
| 11 | + // Whether the LocalFile backend is enabled. |
| 12 | + // Defaults to false. |
| 13 | + Enabled bool `json:"enabled"` |
| 14 | + // Output path to write metrics, with one metric per file. Required. |
| 15 | + // All data will be aggregated by timestamp. |
| 16 | + // Any existing data will be merged together. |
| 17 | + MetricsPath string `json:"metricsPath"` |
| 18 | +} |
| 19 | + |
| 20 | +type InfluxdbBackendConfig struct { |
| 21 | + // Whether the InfluxDB backend is enabled. |
| 22 | + // Defaults to false. |
| 23 | + Enabled bool `json:"enabled"` |
| 24 | + // The URL to the InfluxDB server. |
| 25 | + ServerURL string `json:"serverURL" env:"INFLUXDB_SERVER_URL"` |
| 26 | + // If true, skips TLS verification of the certificate chain and host name for |
| 27 | + // the InfluxDB server. |
| 28 | + InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty" env:"INFLUXDB_INSECURE_SKIP_VERIFY"` |
| 29 | + // Auth token to connect to InfluxDB. |
| 30 | + AuthToken string `json:"authToken,omitempty" env:"INFLUXDB_AUTH_TOKEN"` |
| 31 | + // InfluxDB organization name. |
| 32 | + OrgName string `json:"orgName" env:"INFLUXDB_ORG_NAME"` |
| 33 | + // Configuration for InfluxDB bucket names for various data points. |
| 34 | + BucketNames InfluxdbBucketNamesConfig `json:"bucketNames"` |
| 35 | + // Additional tags to add to InfluxDB for every single request, in key=value format. |
| 36 | + StaticTags map[string]string `json:"staticTags,omitempty"` |
| 37 | +} |
| 38 | + |
| 39 | +type InfluxdbBucketNamesConfig struct { |
| 40 | + // InfluxDB bucket name for metrics. |
| 41 | + Metrics string `json:"metrics" env:"INFLUXDB_METRICS_BUCKET"` |
| 42 | + // InfluxDB bucket name for workouts. |
| 43 | + Workouts string `json:"workouts" env:"INFLUXDB_WORKOUTS_BUCKET"` |
| 44 | +} |
0 commit comments