Skip to content

Commit

Permalink
Tags definitions are now a map instead of a list (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
naxhh authored Feb 19, 2021
1 parent a4fb8fa commit b9c6e43
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 29 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ During synthesis, the tags will be created using the attribute name as key and i

If some of the tags' attributes are not present on the telemetry message received, the entity will still be synthesized with the available tags (if any).

```yaml
tags:
attributeNameB:
multiValue: false # declare if the value for this tag should be a list of string values (accumulated) or a single value (replaced). defaults to true
attributeNameC:
```

#### Golden tags

The `goldenTags` field accepts an array of tag-keys which are considered the most important for the entity's DOMAIN and TYPE,
Expand Down
2 changes: 1 addition & 1 deletion definitions/ext-fastly_pop/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ synthesis:
# value: value

tags:
- fastly_region
fastly_region:

# Template that can be used to generate a dashboard for the entity.
# dashboardTemplates:
Expand Down
4 changes: 2 additions & 2 deletions definitions/ext-redis/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ synthesis:
prefix: redis_

tags:
- clusterName
- targetName
clusterName:
targetName:

compositeMetrics:
goldenMetrics:
Expand Down
2 changes: 1 addition & 1 deletion definitions/ext-tinyproxy/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ synthesis:
prefix: tinyproxy_

tags:
- instrumentation.name
instrumentation.name:

dashboardTemplates:
- dashboard.json
Expand Down
12 changes: 6 additions & 6 deletions definitions/infra-container/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ synthesis:
- attribute: docker.containerId

tags:
- container.state
- docker.state
- docker.containerId
- newrelic.integrationName
- newrelic.integrationVersion
- newrelic.agentVersion
container.state:
docker.state:
docker.containerId:
newrelic.integrationName:
newrelic.integrationVersion:
newrelic.agentVersion:

goldenTags:
- environment
Expand Down
14 changes: 7 additions & 7 deletions definitions/infra-etcd_cluster/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ synthesis:
- attribute: metricName
prefix: etcd_
tags:
- label.topology.kubernetes.io/region
- label.topology.kubernetes.io/zone
- label.eks.amazonaws.com/compute-type
- k8s.cluster.name
- label.kubernetes.io/arch
- label.kubernetes.io/hostname
- label.kubernetes.io/os
'label.topology.kubernetes.io/region':
'label.topology.kubernetes.io/zone':
'label.eks.amazonaws.com/compute-type':
'k8s.cluster.name':
'label.kubernetes.io/arch':
'label.kubernetes.io/hostname':
'label.kubernetes.io/os':
dashboardTemplates:
- dashboard.json
goldenTags:
Expand Down
14 changes: 7 additions & 7 deletions definitions/infra-kubernetes_apiserver/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ synthesis:
- attribute: metricName
prefix: apiserver_
tags:
- label.topology.kubernetes.io/region
- label.topology.kubernetes.io/zone
- label.eks.amazonaws.com/compute-type
- k8s.cluster.name
- label.kubernetes.io/arch
- label.kubernetes.io/hostname
- label.kubernetes.io/os
'label.topology.kubernetes.io/region':
'label.topology.kubernetes.io/zone':
'label.eks.amazonaws.com/compute-type':
'k8s.cluster.name':
'label.kubernetes.io/arch':
'label.kubernetes.io/hostname':
'label.kubernetes.io/os':
goldenTags:
- label.kubernetes.io/os
compositeMetrics:
Expand Down
4 changes: 2 additions & 2 deletions docs/example-entity-definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ synthesis:

# Tags associated with the entity that can be extracted from the telemetry attributes.
tags:
- attributeNameB
- attributeNameC
attributeNameB:
attributeNameC:

# Template that can be used to generate a dashboard for the entity.
dashboardTemplates:
Expand Down
17 changes: 14 additions & 3 deletions validator/schemas/entity-schema-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
},
"tags": {
"$id": "#/properties/tags",
"type": "array",
"type": "object",
"title": "An array of tags.",
"description": "Tags associated to the entity that can be extracted from the metrics information received.",
"examples": [
Expand All @@ -174,8 +174,19 @@
"anyOf": [
{
"$id": "#/properties/tags/items/anyOf/0",
"type": "string",
"title": "Reference to a tag extracted from metrics"
"type": "object",
"title": "Tag configuration",
"description": "The configuration of the tag being synthesized",
"examples": [
{"multiValue": "false"}
],
"properties": {
"multiValue": {
"$id": "#/properties/tags/items/anyOf/0/properties/multiValue",
"type": "boolean",
"title": "If the tag should allow a list of string values or a single string value"
}
}
}
]
}
Expand Down

0 comments on commit b9c6e43

Please sign in to comment.