-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add back ecs and kubernetes merge rules. (#221)
- Loading branch information
Showing
9 changed files
with
89 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ | |
"metrics_collected": { | ||
"kubernetes": { | ||
"cluster_name": "TestCluster" | ||
}, | ||
"ecs": { | ||
} | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package ecs | ||
|
||
import ( | ||
"github.com/aws/private-amazon-cloudwatch-agent-staging/translator/jsonconfig/mergeJsonRule" | ||
"github.com/aws/private-amazon-cloudwatch-agent-staging/translator/jsonconfig/mergeJsonUtil" | ||
parent "github.com/aws/private-amazon-cloudwatch-agent-staging/translator/translate/logs/metrics_collected" | ||
) | ||
|
||
const SectionKey = "ecs" | ||
|
||
type ECS struct { | ||
} | ||
|
||
func GetCurPath() string { | ||
curPath := parent.GetCurPath() + SectionKey + "/" | ||
return curPath | ||
} | ||
|
||
var MergeRuleMap = map[string]mergeJsonRule.MergeRule{} | ||
|
||
func (e *ECS) Merge(source map[string]interface{}, result map[string]interface{}) { | ||
mergeJsonUtil.MergeMap(source, result, SectionKey, MergeRuleMap, GetCurPath()) | ||
} | ||
|
||
func init() { | ||
e := new(ECS) | ||
parent.MergeRuleMap[SectionKey] = e | ||
} |
31 changes: 31 additions & 0 deletions
31
translator/translate/logs/metrics_collected/kubernetes/kubernetes.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package kubernetes | ||
|
||
import ( | ||
"github.com/aws/private-amazon-cloudwatch-agent-staging/translator/jsonconfig/mergeJsonRule" | ||
"github.com/aws/private-amazon-cloudwatch-agent-staging/translator/jsonconfig/mergeJsonUtil" | ||
parent "github.com/aws/private-amazon-cloudwatch-agent-staging/translator/translate/logs/metrics_collected" | ||
) | ||
|
||
const SectionKey = "kubernetes" | ||
|
||
type Kubernetes struct { | ||
} | ||
|
||
func GetCurPath() string { | ||
curPath := parent.GetCurPath() + SectionKey + "/" | ||
return curPath | ||
} | ||
|
||
var MergeRuleMap = map[string]mergeJsonRule.MergeRule{} | ||
|
||
func (k *Kubernetes) Merge(source map[string]interface{}, result map[string]interface{}) { | ||
mergeJsonUtil.MergeMap(source, result, SectionKey, MergeRuleMap, GetCurPath()) | ||
} | ||
|
||
func init() { | ||
k := new(Kubernetes) | ||
parent.MergeRuleMap[SectionKey] = k | ||
} |