Options used by InfluxDBClient.default.write .

      client
.write(point, DATABASE, 'cpu', {
headers: {
'channel-lane': 'reserved',
'notify-central': '30m',
},
precision: 'ns',
gzipThreshold: 1000,
})
interface WriteOptions {
    defaultTags?: { [key: string]: string };
    gzipThreshold?: number;
    headers?: Record<string, string>;
    precision?: WritePrecision;
}

Properties

defaultTags?: { [key: string]: string }

default tags

const client = new InfluxDBClient({
host: 'https://eu-west-1-1.aws.cloud2.influxdata.com',
writeOptions: {
defaultTags: {
device: 'nrdc-th-52-fd889e03',
},
},
})

const p = Point.measurement('measurement').setField('num', 3)

// this will write point with device=device-a tag
await client.write(p, 'my-db')
const client = new InfluxDBClient({
host: 'https://eu-west-1-1.aws.cloud2.influxdata.com',
})

const defaultTags = {
device: 'rpi5_0_0599e8d7',
}

const p = Point.measurement('measurement').setField('num', 3)

// this will write point with device=device-a tag
await client.write(p, 'my-db', undefined, {defaultTags})
gzipThreshold?: number

When specified, write bodies larger than the threshold are gzipped

headers?: Record<string, string>

HTTP headers that will be sent with every write request

precision?: WritePrecision

Precision to use in writes for timestamp. default ns