Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Apr 5, 2022
1 parent bb788ba commit 7703c88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/translator/prometheusremotewrite/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func addResourceTargetInfo(resource pdata.Resource, settings Settings, timestamp
}
// Use resource attributes (other than those used for job+instance) as the
// metric labels for the target info metric
attributes := pdata.NewAttributeMap()
attributes := pdata.NewMap()
resource.Attributes().CopyTo(attributes)
attributes.RemoveIf(func(k string, _ pdata.Value) bool {
switch k {
Expand Down
12 changes: 6 additions & 6 deletions pkg/translator/prometheusremotewrite/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,14 @@ func Test_getPromExemplars(t *testing.T) {
}

func TestAddResourceTargetInfo(t *testing.T) {
resourceAttrMap := map[string]pdata.Value{
conventions.AttributeServiceName: pdata.NewValueString("service-name"),
conventions.AttributeServiceNamespace: pdata.NewValueString("service-namespace"),
conventions.AttributeServiceInstanceID: pdata.NewValueString("service-instance-id"),
"resource_attr": pdata.NewValueString("resource-attr-val-1"),
resourceAttrMap := map[string]interface{}{
conventions.AttributeServiceName: "service-name",
conventions.AttributeServiceNamespace: "service-namespace",
conventions.AttributeServiceInstanceID: "service-instance-id",
"resource_attr": "resource-attr-val-1",
}
resourceWithServiceAttrs := pdata.NewResource()
pdata.NewAttributeMapFromMap(resourceAttrMap).CopyTo(resourceWithServiceAttrs.Attributes())
pdata.NewMapFromRaw(resourceAttrMap).CopyTo(resourceWithServiceAttrs.Attributes())
for _, tc := range []struct {
desc string
resource pdata.Resource
Expand Down

0 comments on commit 7703c88

Please sign in to comment.