Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change [tags] to [global_tags] to deal with toml bug #667

Merged
merged 1 commit into from
Feb 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

### Bugfixes
- [#443](https://github.com/influxdata/telegraf/issues/443): Fix Ping command timeout parameter on Linux.
- [#662](https://github.com/influxdata/telegraf/pull/667): Change `[tags]` to `[global_tags]` to fix multiple-plugin tags bug.

## v0.10.2 [2016-02-04]

Expand Down
6 changes: 3 additions & 3 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ To generate a file with specific inputs and outputs, you can use the
-input-filter and -output-filter flags:
`telegraf -sample-config -input-filter cpu:mem:net:swap -output-filter influxdb:kafka`

## `[tags]` Configuration
## `[global_tags]` Configuration

Global tags can be specific in the `[tags]` section of the config file in
Global tags can be specific in the `[global_tags]` section of the config file in
key="value" format. All metrics being gathered on this host will be tagged
with the tags specified here.

Expand Down Expand Up @@ -76,7 +76,7 @@ measurements at a 10s interval and will collect per-cpu data, dropping any
fields which begin with `time_`.

```toml
[tags]
[global_tags]
dc = "denver-1"

[agent]
Expand Down
2 changes: 1 addition & 1 deletion etc/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# file would generate.

# Global tags can be specified here in key="value" format.
[tags]
[global_tags]
# dc = "us-east-1" # will tag all metrics with dc=us-east-1
# rack = "1a"

Expand Down
6 changes: 3 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var header = `# Telegraf configuration
# file would generate.

# Global tags can be specified here in key="value" format.
[tags]
[global_tags]
# dc = "us-east-1" # will tag all metrics with dc=us-east-1
# rack = "1a"

Expand Down Expand Up @@ -333,9 +333,9 @@ func (c *Config) LoadConfig(path string) error {
log.Printf("Could not parse [agent] config\n")
return err
}
case "tags":
case "global_tags", "tags":
if err = config.UnmarshalTable(subTable, c.Tags); err != nil {
log.Printf("Could not parse [tags] config\n")
log.Printf("Could not parse [global_tags] config\n")
return err
}
case "outputs":
Expand Down
2 changes: 1 addition & 1 deletion internal/config/testdata/telegraf-agent.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# with 'required'. Be sure to edit those to make this configuration work.

# Tags can also be specified via a normal map, but only one form at a time:
[tags]
[global_tags]
dc = "us-east-1"

# Configuration for telegraf agent
Expand Down