Document and add support to input plugins for logging alias (#6357)

This commit is contained in:
Greg
2019-09-23 16:39:50 -06:00
committed by Daniel Nelson
parent e42d2e39c6
commit 817c9a69a9
111 changed files with 961 additions and 659 deletions

View File

@@ -265,7 +265,7 @@ func (c *httpClient) Write(ctx context.Context, metrics []telegraf.Metric) error
if !c.config.SkipDatabaseCreation && !c.createdDatabases[db] {
err := c.CreateDatabase(ctx, db)
if err != nil {
c.log.Warnf("when writing to [%s]: database %q creation failed: %v",
c.log.Warnf("When writing to [%s]: database %q creation failed: %v",
c.config.URL, db, err)
}
}
@@ -331,7 +331,7 @@ func (c *httpClient) writeBatch(ctx context.Context, db string, metrics []telegr
// discarded for being older than the retention policy. Usually this not
// a cause for concern and we don't want to retry.
if strings.Contains(desc, errStringPointsBeyondRP) {
c.log.Warnf("when writing to [%s]: received error %v",
c.log.Warnf("When writing to [%s]: received error %v",
c.URL(), desc)
return nil
}
@@ -340,7 +340,7 @@ func (c *httpClient) writeBatch(ctx context.Context, db string, metrics []telegr
// correctable at this point and so the point is dropped instead of
// retrying.
if strings.Contains(desc, errStringPartialWrite) {
c.log.Errorf("when writing to [%s]: received error %v; discarding points",
c.log.Errorf("When writing to [%s]: received error %v; discarding points",
c.URL(), desc)
return nil
}
@@ -348,7 +348,7 @@ func (c *httpClient) writeBatch(ctx context.Context, db string, metrics []telegr
// This error indicates a bug in either Telegraf line protocol
// serialization, retries would not be successful.
if strings.Contains(desc, errStringUnableToParse) {
c.log.Errorf("when writing to [%s]: received error %v; discarding points",
c.log.Errorf("When writing to [%s]: received error %v; discarding points",
c.URL(), desc)
return nil
}

View File

@@ -221,13 +221,13 @@ func (i *InfluxDB) Write(metrics []telegraf.Metric) error {
if !i.SkipDatabaseCreation {
err := client.CreateDatabase(ctx, apiError.Database)
if err != nil {
i.Log.Errorf("when writing to [%s]: database %q not found and failed to recreate",
i.Log.Errorf("When writing to [%s]: database %q not found and failed to recreate",
client.URL(), apiError.Database)
}
}
}
i.Log.Errorf("when writing to [%s]: %v", client.URL(), err)
i.Log.Errorf("When writing to [%s]: %v", client.URL(), err)
}
return errors.New("could not write any address")
@@ -283,7 +283,7 @@ func (i *InfluxDB) httpClient(ctx context.Context, url *url.URL, proxy *url.URL)
if !i.SkipDatabaseCreation {
err = c.CreateDatabase(ctx, c.Database())
if err != nil {
i.Log.Warnf("when writing to [%s]: database %q creation failed: %v",
i.Log.Warnf("When writing to [%s]: database %q creation failed: %v",
c.URL(), i.Database, err)
}
}

View File

@@ -95,7 +95,7 @@ func (c *udpClient) Write(ctx context.Context, metrics []telegraf.Metric) error
if err != nil {
// Since we are serializing multiple metrics, don't fail the
// entire batch just because of one unserializable metric.
c.log.Errorf("when writing to [%s] could not serialize metric: %v",
c.log.Errorf("When writing to [%s] could not serialize metric: %v",
c.URL(), err)
continue
}