-
Notifications
You must be signed in to change notification settings - Fork 291
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
base: main
Are you sure you want to change the base?
Add support for semantic convention 1_20 and 1_23 #1903
Conversation
- attribute: span.kind | ||
anyOf: [ "producer" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With regards to span.kind
the conventions state
A producer of a message should set the span kind to PRODUCER unless it synchronously waits for a response: then it should use CLIENT. The processor of the message should set the kind to CONSUMER, unless it always sends back a reply that is directed to the producer of the message (as opposed to e.g., a queue on which the producer happens to listen): then it should use SERVER.
All span.kind conditions should be updated as follows:
For relationshipType=PRODUCES
- attribute: span.kind
anyOf: [ "producer", "client" ]
For relationshipType=CONSUMES
- attribute: span.kind
anyOf: [ "consumer", "server" ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the name of this file be EXT-SERVICE-to-INFRA-AWSMQBROKER
? Or do we anticipate that in the future this file will contain relationship definitions for MQ Brokers other than AWS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let's keep it scoped to the domain/types involved, we can create another file if we need to extend beyond of AWS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sanjalee-NewRelic please rename the file to be specific to AWS EXT-SERVICE-to-INFRA-AWSMQBROKER.yml
conditions: | ||
- attribute: eventType | ||
anyOf: [ "Span" ] | ||
- attribute: span.kind | ||
anyOf: [ "consumer" ] | ||
- attribute: messaging.system | ||
anyOf: [ "rabbitmq", "activemq" ] | ||
- attribute: server.address | ||
present: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditions for all the rules in this file are not sufficient for constraining them to target only EXT-SERVICE
entities.
I suggest we add these additional conditions to all rules similar to what we have done for our infra-host to ext-service relationship:
- attribute: newrelic.source | |
anyOf: [ "api.traces.otlp" ] | |
- attribute: entity.type | |
anyOf: [ "SERVICE" ] |
Constraining both on newrelic.source
and entity.type
give us higher confidence that this rule specifically targets OpenTelemetry instrumented services.
target: | ||
lookupGuid: | ||
candidateCategory: AWSMQBROKER | ||
fields: | ||
- field: endpoint | ||
attribute: net.peer.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, this lookup onMiss
will create an an uninstrumented MQBROKER
entity.
entity-definitions/relationships/candidates/AWSMQBROKER.yml
Lines 13 to 16 in dbf47cc
onMiss: | |
action: CREATE_UNINSTRUMENTED | |
uninstrumented: | |
type: MQBROKER |
In the future if we add new relationships supporting messaging systems besides AWS (e.g., RabbitMQ hosted elsewhere), will this rule cause us to falsely create uninstrumented relationships?
If so, then we may need to constrain this rule to be AWS specific. Maybe like so?
conditions:
- attribute: net.peer.name
regex: <regex that identifies this is AWS>
origins: | ||
- Distributed Tracing | ||
- OpenTelemetry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not entirely clear what origins
should be used here. In reviewing other rules it seems we are inconsistent.
For example, the infra-host to ext-service rule derived from span data only uses an origin of Distributed Tracing
:
origins: | |
- Distributed Tracing |
Whereas the the infra-host to ext-service rule derived from metric data only uses an origin of OpenTelemetry
:
origins: | |
- OpenTelemetry |
I can see the following origins being relevant to the rules in this PR:
Distributed Tracing
because these rules target span data.OpenTelemetry
because these rules are meant to target OpenTelemetry instrumented servicesAWS Integration
because these rules target our AWS Metric Streams integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@otaviocarvalho can you provide some guidance here? From what I can tell these origins have been inconsistently applied across other relationship rules, so it doesn't seem like they're very important.
All three origins are relevant to the domain of these rules. Is the practice that we should list all relevant origins? Or does it not really matter?
- field: topic | ||
attribute: messaging.destination.name |
There was a problem hiding this comment.
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
attribute: net.peer.name | ||
regex: "^[^\\.]+\\.([^\\.]+)\\.[^\\.]+\\.[^\\.]+\\.kafka\\.[^\\.]+\\.amazonaws\\.com:[0-9]+.*" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This PR needs detailed attention from Entity Platform, to make sure we are disabling all sub-rules before it goes into production (to avoid enabling it automatically by mistake).
555c259
conditions: | ||
- attribute: eventType | ||
anyOf: [ "Span" ] | ||
- attribute: db.system | ||
anyOf: [ "memcached" ] | ||
- attribute: net.peer.name | ||
present: true | ||
- attribute: net.peer.port | ||
present: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sanjalee-NewRelic These rules for memcached should also be constrained by entity.type
and newrelic.source
- attribute: newrelic.source | |
anyOf: [ "api.traces.otlp" ] | |
- attribute: entity.type | |
anyOf: [ "SERVICE" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the conditions @alanwest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good now. @Sanjalee-NewRelic please handle this last piece of feedback #1903 (comment)
- attribute: db.system | ||
anyOf: [ "memcached" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sanjalee-NewRelic After reviewing the rules for redis, it looks like they are restricted to AWS.
I think it makes sense to do the same for memcached, right?
Something like
- attribute: server.address
regex: <regex constraining this to AWS>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, This can be done. Made the change.
…Sanjalee-NewRelic/entity-definitions into Part2-Update-Attributes-As-Per-Semantic-Convention
Relevant information
Modified relationships to support otel semantic conventions version 1.20 and 1.23
Checklist
identifier
will be unique and valid.