From 33da81907513360760206e88ac4f88ddf16b314c Mon Sep 17 00:00:00 2001 From: Martin Helmich Date: Mon, 31 Oct 2016 19:18:18 +0100 Subject: [PATCH] Extend configuration structs --- config/structs.go | 7 ++++--- example-config.hcl | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/structs.go b/config/structs.go index edc3d91..b860b2f 100644 --- a/config/structs.go +++ b/config/structs.go @@ -24,7 +24,8 @@ type ListenConfig struct { // NamespaceConfig is a struct describing single metric namespaces type NamespaceConfig struct { - Name string `hcl:",key"` - SourceFiles []string `hcl:"source_files"` - Format string `hcl:"format"` + Name string `hcl:",key"` + SourceFiles []string `hcl:"source_files"` + Format string `hcl:"format"` + Labels map[string]string `hcl:"labels"` } diff --git a/example-config.hcl b/example-config.hcl index 87c427a..b85fc10 100644 --- a/example-config.hcl +++ b/example-config.hcl @@ -6,4 +6,8 @@ namespace "nginx" { "foo.log" ] format = "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"" + labels { + app = "magicapp" + foo = "bar" + } }