Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for semantic convention 1_20 and 1_23 #1903

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions relationships/synthesis/EXT-SERVICE-to-INFRA-AWSMQBROKER.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
relationships:
- name: extServiceConsumesAwsMqBroker1_20
version: "1"
origins:
- Distributed Tracing
- OpenTelemetry
conditions:
- attribute: eventType
anyOf: [ "Span" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: span.kind
anyOf: [ "consumer", "server" ]
- attribute: messaging.system
anyOf: [ "rabbitmq", "activemq" ]
- attribute: net.peer.name
present: true
regex: "^[^\\.]+\\.mq\\.[^\\.]+\\.amazonaws\\.com"
relationship:
expires: P75M
relationshipType: CONSUMES
source:
extractGuid:
attribute: entity.guid
target:
lookupGuid:
candidateCategory: AWSMQBROKER
fields:
- field: endpoint
attribute: net.peer.name

- name: extServiceProducesAwsMqBroker1_20
version: "1"
origins:
- Distributed Tracing
- OpenTelemetry
conditions:
- attribute: eventType
anyOf: [ "Span" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: span.kind
anyOf: [ "producer", "client" ]
- attribute: messaging.system
anyOf: [ "rabbitmq", "activemq" ]
- attribute: net.peer.name
present: true
regex: "^[^\\.]+\\.mq\\.[^\\.]+\\.amazonaws\\.com"
relationship:
expires: P75M
relationshipType: PRODUCES
source:
extractGuid:
attribute: entity.guid
target:
lookupGuid:
candidateCategory: AWSMQBROKER
fields:
- field: endpoint
attribute: net.peer.name

- name: extServiceConsumesAwsMqBroker1_23
version: "1"
origins:
- Distributed Tracing
- OpenTelemetry
conditions:
- attribute: eventType
anyOf: [ "Span" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: span.kind
anyOf: [ "consumer", "server" ]
- attribute: messaging.system
anyOf: [ "rabbitmq", "activemq" ]
- attribute: server.address
present: true
regex: "^[^\\.]+\\.mq\\.[^\\.]+\\.amazonaws\\.com"
relationship:
expires: P75M
relationshipType: CONSUMES
source:
extractGuid:
attribute: entity.guid
target:
lookupGuid:
candidateCategory: AWSMQBROKER
fields:
- field: endpoint
attribute: server.address

- name: extServiceProducesAwsMqBroker1_23
version: "1"
origins:
- Distributed Tracing
- OpenTelemetry
conditions:
- attribute: eventType
anyOf: [ "Span" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: span.kind
anyOf: [ "producer", "client" ]
- attribute: messaging.system
anyOf: [ "rabbitmq", "activemq" ]
- attribute: server.address
present: true
regex: "^[^\\.]+\\.mq\\.[^\\.]+\\.amazonaws\\.com"
relationship:
expires: P75M
relationshipType: PRODUCES
source:
extractGuid:
attribute: entity.guid
target:
lookupGuid:
candidateCategory: AWSMQBROKER
fields:
- field: endpoint
attribute: server.address
50 changes: 0 additions & 50 deletions relationships/synthesis/EXT-SERVICE-to-INFRA-MQBROKER.yml

This file was deleted.

107 changes: 102 additions & 5 deletions relationships/synthesis/EXT-SERVICE-to-KAFKATOPIC.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
relationships:
- name: extServiceProducesAwsMskTopic
- name: extServiceProducesAwsMskTopic1_20
version: "1"
origins:
- Distributed Tracing
- OpenTelemetry
conditions:
- attribute: eventType
anyOf: [ "Span" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: span.kind
anyOf: [ "producer" ]
anyOf: [ "producer", "client" ]
- attribute: net.peer.name
present: true
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- attribute: messaging.destination.name
present: true
relationship:
expires: P75M
relationshipType: PRODUCES
Expand All @@ -20,7 +30,85 @@ relationships:
fields:
- field: clusterName
capture:
attribute: server.address
attribute: net.peer.name
regex: "^[^\\.]+\\.([^\\.]+)\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
Comment on lines +33 to +34
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my question above, should this rule be constrained by adding a condition that makes it specific to AWS?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably being too pragmatic, but if the domain includes amazonaws...com there is no way it will not be specific to AWS. Alternatively, you can add and check a specific tag for this purpose.

- field: region
capture:
attribute: net.peer.name
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.([^\\.]+)\\.amazonaws\\.com:[0-9]+.*"
- field: topic
attribute: messaging.destination.name

- name: extServiceConsumesAwsMskTopic1_20
version: "1"
origins:
- Distributed Tracing
conditions:
- attribute: eventType
anyOf: [ "Span" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: span.kind
anyOf: [ "consumer", "server" ]
- attribute: net.peer.name
present: true
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- attribute: messaging.destination.name
present: true
relationship:
expires: P75M
relationshipType: CONSUMES
source:
extractGuid:
attribute: entity.guid
target:
lookupGuid:
candidateCategory: KAFKATOPIC
fields:
- field: clusterName
capture:
attribute: net.peer.name
regex: "^[^\\.]+\\.([^\\.]+)\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- field: region
capture:
attribute: net.peer.name
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.([^\\.]+)\\.amazonaws\\.com:[0-9]+.*"
- field: topic
attribute: messaging.destination.name
Comment on lines +78 to +79
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

messaging.destination.name is not guaranteed to exist. If these rules require it be present then it should be added to the conditions

    conditions:
      ...
      - attribute: messaging.destination.name
         present: true


- name: extServiceProducesAwsMskTopic1_23
version: "1"
origins:
- Distributed Tracing
conditions:
- attribute: eventType
anyOf: [ "Span" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: span.kind
anyOf: [ "producer", "client" ]
- attribute: server.address
present: true
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- attribute: messaging.destination.name
present: true
relationship:
expires: P75M
relationshipType: PRODUCES
source:
extractGuid:
attribute: entity.guid
target:
lookupGuid:
candidateCategory: KAFKATOPIC
fields:
- field: clusterName
capture:
attribute: server.address
regex: "^[^\\.]+\\.([^\\.]+)\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- field: region
capture:
Expand All @@ -29,15 +117,24 @@ relationships:
- field: topic
attribute: messaging.destination.name

- name: extServiceConsumesAwsMskTopic
- name: extServiceConsumesAwsMskTopic1_23
version: "1"
origins:
- Distributed Tracing
conditions:
- attribute: eventType
anyOf: [ "Span" ]
- attribute: newrelic.source
anyOf: [ "api.traces.otlp" ]
- attribute: entity.type
anyOf: [ "SERVICE" ]
- attribute: span.kind
anyOf: [ "consumer" ]
anyOf: [ "consumer", "server" ]
- attribute: server.address
present: true
regex: "^[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*"
- attribute: messaging.destination.name
present: true
relationship:
expires: P75M
relationshipType: CONSUMES
Expand Down
Loading