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

Entity relationship synthesis with the New Relic eBPF agent #1421

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

benkilimnik
Copy link
Contributor

@benkilimnik benkilimnik commented Jan 23, 2024

Relevant information

This PR provides initial prototype entity definitions for the eBPF agent.

Main ideas:

  1. Construct guid from self information, e.g. the “local” IP addr., port, and pid.
  2. Enable relationship synthesis from tags that include local IP addr. and port, i.e. because those columns will be available as “remote IP addr. & port”

Note that in the agent, one span represents both a request and response. Currently, we cannot create two entities from a single span with NR synthesis rules. We can, however, trace a span from the client’s perspective and from the server’s point of view, as long as the ebpf agent is deployed on all hosts. Thus for entity and relationship synthesis, we can connect these two spans, one client-side and one server-side. If one side of the connection is missing, we create an uninstrumented entity for it. Ideally, we'd want to create both entities from one span, but we cannot have two rules that match the same thing with current NR entity synthesis rules.

In the current prototype, we create a server entity from the server-captured span, and a client entity from the client-captured span.

Cases:

1. Both client and server-side spans present

image
%%{init: {'mirrorActors': true, 'height':38, 'width': 35}}%%
flowchart TD
    C[Server-side Span] -->|Definition rule| D(Server entity)
    A[Client-side Span] -->|Definition rule| B(Client entity)
    D -->|remoteIP = clientIP| E[Relationship Synthesis]
    B <--> |lookup via ClientIP| E
Loading

Note that the direction of the connection is arbitrary, we could flip it and see the same result.

image

Likewise, if the client and server are on the same host, the ebpf agent will still provide two spans.

image

2. Span missing on the client-side

If we fail to capture a client-side span because, for instance, there is no ebpf agent deployed on that host, then we create a server entity from the server-side span, and an uninstrumented entity for the client.

image
%%{init: {'mirrorActors': true, 'height':38, 'width': 35}}%%
flowchart TD
    C[Server-side Span] -->|Definition rule| D(Server entity)
    D -->|remoteIP = clientIP| E[Relationship Synthesis]
    B[Uninstrumented client entity] <--> |lookup via ClientIP| E
Loading

3. Span missing on the server-side

If the server-side span is missing, then we create a client entity from the client-side span, and an uninstrumented entity for the server.

image
%%{init: {'mirrorActors': true, 'height':38, 'width': 35}}%%
flowchart TD
    C[Client-side Span] -->|Definition rule| D(Client entity)
    D -->|remoteIP = serverIP, remotePort = serverPort| E[Relationship Synthesis]
    B[Uninstrumented server entity] <--> |lookup via serverIP, serverPort| E
Loading

Checklist

  • I've read the guidelines and understand the acceptance criteria.
  • The value of the attribute marked as identifier will be unique and valid.
  • I've confirmed that my entity type wasn't already defined. If it is I'm providing an explanation above.

@CLAassistant
Copy link

CLAassistant commented Jan 23, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

@entityBot entityBot left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-client' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Missing required creator property 'name' (index 0)
at [Source: (StringReader); line: 37, column: 38] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[0]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["name"])

* Error PARSING domainType: 'ebpf-redis_server' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Missing required creator property 'name' (index 0)
at [Source: (StringReader); line: 44, column: 34] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[0]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["name"])

Copy link
Contributor

@naxhh naxhh left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-client' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Missing required creator property 'name' (index 0)
at [Source: (StringReader); line: 37, column: 38] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[0]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["name"])

* Error PARSING domainType: 'ebpf-redis_server' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Missing required creator property 'name' (index 0)
at [Source: (StringReader); line: 44, column: 34] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[0]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["name"])

@entityBot entityBot dismissed their stale review January 24, 2024 19:43

Let's validate those changes.

Copy link

@entityBot entityBot left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-client' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.JsonMappingException: while scanning for the next token
found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
in 'reader', line 5, column 1:
   		# Client Entity for Server-Cap ... 
   ^

at [Source: (StringReader); line: 4, column: 8] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"])

* Error PARSING domainType: 'ebpf-redis_server' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.JsonMappingException: while scanning for the next token
found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
in 'reader', line 5, column 1:
   		# Server Entity for Server-Cap ... 
   ^

at [Source: (StringReader); line: 4, column: 8] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"])

@entityBot entityBot dismissed their stale review January 24, 2024 19:43

Let's validate those changes.

Copy link

@entityBot entityBot left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-client' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.JsonMappingException: while scanning for the next token
found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
in 'reader', line 5, column 1:
   		# Client Entity for Server-Cap ... 
   ^

at [Source: (StringReader); line: 4, column: 8] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"])

* Error PARSING domainType: 'ebpf-redis_server' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.JsonMappingException: while scanning for the next token
found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
in 'reader', line 5, column 1:
   		# Server Entity for Server-Cap ... 
   ^

at [Source: (StringReader); line: 4, column: 8] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"])

entityBot
entityBot previously approved these changes Jan 24, 2024
@entityBot entityBot dismissed stale reviews from themself January 24, 2024 19:47

Let's validate those changes.

Copy link

@entityBot entityBot left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-client' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `String` from Object value (token `JsonToken.START_OBJECT`)
at [Source: (StringReader); line: 8, column: 9] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[0]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["identifier"])

@entityBot entityBot dismissed stale reviews from themself January 24, 2024 19:48

Let's validate those changes.

Copy link

@entityBot entityBot left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-client' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `String` from Object value (token `JsonToken.START_OBJECT`)
at [Source: (StringReader); line: 8, column: 9] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[0]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["identifier"])

Copy link

@entityBot entityBot left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-client' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `String` from Object value (token `JsonToken.START_OBJECT`)
at [Source: (StringReader); line: 8, column: 9] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[0]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["identifier"])

entityBot
entityBot previously approved these changes Jan 24, 2024
entityBot
entityBot previously approved these changes Jan 24, 2024
@entityBot entityBot dismissed stale reviews from themself January 30, 2024 07:21

Let's validate those changes.

Copy link

@entityBot entityBot left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-client' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Missing required creator property 'name' (index 0)
at [Source: (StringReader); line: 37, column: 36] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[1]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["name"])

* Error PARSING domainType: 'ebpf-redis_server' on entitydefinitionemitter.models.BaseEntityDefinition - jackson.databind.exc.MismatchedInputException: Missing required creator property 'name' (index 0)
at [Source: (StringReader); line: 44, column: 32] (through reference chain: entitydefinitionemitter.models.BaseEntityDefinition["synthesis"]->entitydefinitionemitter.models.CustomEntitySynthesisRules["rules"]->ArrayList[1]->entitydefinitionsclientsynthesis.models.definitions.EntitySynthesisRule["name"])

entityBot
entityBot previously approved these changes Feb 14, 2024
@entityBot entityBot dismissed stale reviews from themself February 14, 2024 01:54

Let's validate those changes.

Copy link

@entityBot entityBot left a comment

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

* Error PARSING domainType: 'ebpf-redis_server' on dashboards for key 'newRelic' - entitydefinitionemitter.repositories.github.FileNotFoundException: No file dashboard.json on repository folder ebpf-redis_server

@rodolfocal rodolfocal merged commit 68c3043 into newrelic:main Feb 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal review Being reviewed by NR teams / Coordination needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants