Skip to content

Commit

Permalink
feat: Add infraevent synthesis for OS K8s entities (#1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettj-newrelic authored Mar 19, 2024
1 parent 231f2a5 commit fcc1bd6
Show file tree
Hide file tree
Showing 9 changed files with 264 additions and 7 deletions.
32 changes: 31 additions & 1 deletion entity-types/infra-kubernetes_cronjob/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,34 @@ synthesis:
k8s.cluster.name:
entityTagNames: [k8s.clusterName]
schedule:
entityTagNames: [k8s.cronjob.schedule]
entityTagNames: [k8s.cronjob.schedule]
# Infrastructure event data via opentelemetry
- compositeIdentifier:
separator: ":"
attributes:
- k8s.cluster.name
- k8.namespace.name
- k8s.object.name
encodeIdentifierInGUID: true
name: k8s.object.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: CronJob
# identifier attributes
- attribute: k8s.object.name
present: true
- attribute: k8.namespace.name
present: true
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
32 changes: 31 additions & 1 deletion entity-types/infra-kubernetes_daemonset/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,34 @@ synthesis:
namespace:
entityTagNames: [k8s.namespaceName]
k8s.cluster.name:
entityTagNames: [k8s.clusterName]
entityTagNames: [k8s.clusterName]
# Infrastructure event data via opentelemetry
- compositeIdentifier:
separator: ":"
attributes:
- k8s.cluster.name
- k8.namespace.name
- k8s.object.name
encodeIdentifierInGUID: true
name: k8s.object.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: DaemonSet
# identifier attributes
- attribute: k8s.object.name
present: true
- attribute: k8.namespace.name
present: true
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
30 changes: 30 additions & 0 deletions entity-types/infra-kubernetes_deployment/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,33 @@ synthesis:
entityTagNames: [k8s.namespaceName]
k8s.cluster.name:
entityTagNames: [k8s.clusterName]
# Infrastructure event data via opentelemetry
- compositeIdentifier:
separator: ":"
attributes:
- k8s.cluster.name
- k8.namespace.name
- k8s.object.name
encodeIdentifierInGUID: true
name: k8s.object.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: Deployment
# identifier attributes
- attribute: k8s.object.name
present: true
- attribute: k8.namespace.name
present: true
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
32 changes: 31 additions & 1 deletion entity-types/infra-kubernetes_job/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,34 @@ synthesis:
namespace:
entityTagNames: [k8s.namespaceName]
k8s.cluster.name:
entityTagNames: [k8s.clusterName]
entityTagNames: [k8s.clusterName]
# Infrastructure event data via opentelemetry
- compositeIdentifier:
separator: ":"
attributes:
- k8s.cluster.name
- k8.namespace.name
- k8s.object.name
encodeIdentifierInGUID: true
name: k8s.object.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: Job
# identifier attributes
- attribute: k8s.object.name
present: true
- attribute: k8.namespace.name
present: true
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
29 changes: 28 additions & 1 deletion entity-types/infra-kubernetes_persistentvolume/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,31 @@ synthesis:
persistentvolume:
entityTagNames: [k8s.volumeName]
k8s.cluster.name:
entityTagNames: [k8s.clusterName]
entityTagNames: [k8s.clusterName]
# Infrastructure event data via opentelemetry
- compositeIdentifier:
separator: ":"
attributes:
- k8s.cluster.name
- k8s.object.name
encodeIdentifierInGUID: true
name: k8s.object.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: PersistentVolume
# identifier attributes
- attribute: k8s.object.name
present: true
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,34 @@ synthesis:
multiValue: false
entityTagNames: [k8s.persistentvolumeclaim.statusPhase]
volumename:
entityTagNames: [k8s.persistentvolumeclaim.volumeName]
entityTagNames: [k8s.persistentvolumeclaim.volumeName]
# Infrastructure event data via opentelemetry
- compositeIdentifier:
separator: ":"
attributes:
- k8s.cluster.name
- k8.namespace.name
- k8s.object.name
encodeIdentifierInGUID: true
name: k8s.object.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: PersistentVolumeClaim
# identifier attributes
- attribute: k8s.object.name
present: true
- attribute: k8.namespace.name
present: true
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
31 changes: 30 additions & 1 deletion entity-types/infra-kubernetes_pod/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,36 @@ synthesis:
created_by_kind:
# from kube-state-metrics kube_pod_info
entityTagNames: [k8s.createdKind]

# Infrastructure event data via opentelemetry
- compositeIdentifier:
separator: ":"
attributes:
- k8s.cluster.name
- k8.namespace.name
- k8s.object.name
encodeIdentifierInGUID: true
name: k8s.object.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: Pod
# identifier attributes
- attribute: k8s.object.name
present: true
- attribute: k8.namespace.name
present: true
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
- compositeIdentifier:
separator: ":"
attributes:
Expand Down
32 changes: 31 additions & 1 deletion entity-types/infra-kubernetes_statefulset/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,34 @@ synthesis:
namespace:
entityTagNames: [k8s.namespaceName]
k8s.cluster.name:
entityTagNames: [k8s.clusterName]
entityTagNames: [k8s.clusterName]
# Infrastructure event data via opentelemetry
- compositeIdentifier:
separator: ":"
attributes:
- k8s.cluster.name
- k8.namespace.name
- k8s.object.name
encodeIdentifierInGUID: true
name: k8s.object.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: StatefulSet
# identifier attributes
- attribute: k8s.object.name
present: true
- attribute: k8.namespace.name
present: true
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
21 changes: 21 additions & 0 deletions entity-types/infra-kubernetescluster/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,26 @@ synthesis:
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"
# Infrastructure event data via opentelemetry
- identifier: k8s.cluster.name
encodeIdentifierInGUID: true
name: k8s.cluster.name
conditions:
- attribute: event.name
value: InfrastructureEvent
- attribute: k8s.object.kind
value: Cluster
# identifier attributes
- attribute: k8s.cluster.name
present: true
# open telemetry
- attribute: newrelic.source
value: api.metrics.otlp
# if service.name is present, handle as one
- attribute: service.name
present: false
# value added for test entities only
- attribute: newrelicOnly
value: "true"

0 comments on commit fcc1bd6

Please sign in to comment.