Skip to content

Commit

Permalink
remove provider prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchezgavier committed Sep 2, 2020
1 parent 5ea583c commit 5e8aae9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions internal/integration/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type Specs struct {

// SpecDef contains the rules to group metrics into entities
type SpecDef struct {
Provider string `yaml:"provider"`
Service string `yaml:"service"`
Entities []EntityDef `yaml:"entities"`
}
Expand Down Expand Up @@ -98,7 +97,7 @@ func (s *Specs) getEntity(m Metric) (entityName string, entityType string, err e
return "", "", fmt.Errorf("metric: %s is not defined in service:%s", m.name, spec.Service)
}

entityType = strings.Title(spec.Provider) + strings.Title(spec.Service) + strings.Title(e.Type)
entityType = strings.Title(spec.Service) + strings.Title(e.Type)

entityName = e.Type

Expand Down
10 changes: 5 additions & 5 deletions internal/integration/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestSpecs_getEntity(t *testing.T) {
},
}},
wantEntityName: "database:test",
wantEntityType: "PrometheusRavendbDatabase",
wantEntityType: "RavendbDatabase",
wantErr: false,
},
{
Expand All @@ -64,7 +64,7 @@ func TestSpecs_getEntity(t *testing.T) {
attributes: labels.Set{},
}},
wantEntityName: "node",
wantEntityType: "PrometheusRavendbNode",
wantEntityType: "RavendbNode",
wantErr: false,
},
{
Expand All @@ -79,7 +79,7 @@ func TestSpecs_getEntity(t *testing.T) {
},
}},
wantEntityName: "testentity:first:second",
wantEntityType: "PrometheusRavendbTestentity",
wantEntityType: "RavendbTestentity",
wantErr: false,
},
{
Expand All @@ -91,7 +91,7 @@ func TestSpecs_getEntity(t *testing.T) {
attributes: labels.Set{},
}},
wantEntityName: "instance",
wantEntityType: "PrometheusRedisInstance",
wantEntityType: "RedisInstance",
wantErr: false,
},
{
Expand All @@ -103,7 +103,7 @@ func TestSpecs_getEntity(t *testing.T) {
attributes: labels.Set{},
}},
wantEntityName: "instance",
wantEntityType: "PrometheusRedisInstance",
wantEntityType: "RedisInstance",
wantErr: false,
},
{
Expand Down
1 change: 0 additions & 1 deletion internal/integration/test/prometheus_ibmmq.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
provider: prometheus
service: ibmmq
display_name: IBM MQ
entities:
Expand Down
1 change: 0 additions & 1 deletion internal/integration/test/prometheus_ravendb.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
provider: prometheus
service: ravendb
display_name: Raven Db
entities:
Expand Down
1 change: 0 additions & 1 deletion internal/integration/test/prometheus_redis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
provider: prometheus
service: redis
display_name: Redis
entities:
Expand Down

0 comments on commit 5e8aae9

Please sign in to comment.