Skip to content

Commit

Permalink
Add support for kafka manual instrumentation (#1932)
Browse files Browse the repository at this point in the history
* fix: Add support for kafka manual instrumentation

* fix: arn should be false in non explicit cases

---------

Co-authored-by: Otávio Carvalho <[email protected]>
  • Loading branch information
Sanjalee-NewRelic and otaviocarvalho authored Feb 21, 2025
1 parent 90add05 commit b3e0844
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
16 changes: 16 additions & 0 deletions relationships/candidates/KAFKATOPIC_EXPLICIT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
category: KAFKATOPIC_EXPLICIT
lookups:
- entityTypes:
- domain: INFRA
type: AWSMSKTOPIC
tags:
matchingMode: ALL
predicates:
- tagKeys: ["aws.Arn"]
field: cloudResourceId
onMatch:
onMultipleMatches: RELATE_ALL
onMiss:
action: CREATE_UNINSTRUMENTED
uninstrumented:
type: KAFKATOPIC
36 changes: 36 additions & 0 deletions relationships/synthesis/EXT-SERVICE-to-KAFKATOPIC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ relationships:
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- attribute: messaging.destination.name
present: true
- attribute: newrelic.aws_metric_streams.arn
present: false
relationship:
expires: P75M
relationshipType: PRODUCES
Expand Down Expand Up @@ -58,6 +60,8 @@ relationships:
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- attribute: messaging.destination.name
present: true
- attribute: newrelic.aws_metric_streams.arn
present: false
relationship:
expires: P75M
relationshipType: CONSUMES
Expand Down Expand Up @@ -98,6 +102,8 @@ relationships:
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- attribute: messaging.destination.name
present: true
- attribute: newrelic.aws_metric_streams.arn
present: false
relationship:
expires: P75M
relationshipType: PRODUCES
Expand Down Expand Up @@ -138,6 +144,8 @@ relationships:
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- attribute: messaging.destination.name
present: true
- attribute: newrelic.aws_metric_streams.arn
present: false
relationship:
expires: P75M
relationshipType: CONSUMES
Expand All @@ -159,3 +167,31 @@ relationships:
- field: topic
attribute: messaging.destination.name

- name: extServiceCallsAwsMskTopic_Explicit
version: "1"
origins:
- Distributed Tracing
- OpenTelemetry
conditions:
- attribute: eventType
anyOf: [ "Span", "Log" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp", "api.logs.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: newrelic.aws_metric_streams.arn
regex: "^arn:aws:kafka:([^:]*):([^:]*):cluster/([^:]*)"
present: true
relationship:
expires: P75M
relationshipType: CALLS
source:
extractGuid:
attribute: entity.guid
target:
lookupGuid:
candidateCategory: KAFKATOPIC_EXPLICIT
fields:
- field: cloudResourceId
attribute: newrelic.aws_metric_streams.arn

0 comments on commit b3e0844

Please sign in to comment.