-
Notifications
You must be signed in to change notification settings - Fork 18
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
Extend agent payload definitions #53
Open
rarguelloF
wants to merge
1
commit into
main
Choose a base branch
from
rarguelloF/AIT-9507/extend-agent-payload
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ | |
from .trace_flags import TraceFlags | ||
from .trace_state import TraceState | ||
from .tags import Tags | ||
|
11 changes: 11 additions & 0 deletions
11
semantic-core/generation/semantic_model/registry/types/language_name.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from enum import Enum | ||
|
||
|
||
class LanguageName(str, Enum): | ||
go = 'go' | ||
python = 'python' | ||
php = 'php' | ||
ruby = 'ruby' | ||
jvm = 'jvm' | ||
dotnet = 'dotnet' | ||
js = 'js' |
111 changes: 111 additions & 0 deletions
111
semantic-core/generation/semantic_model/registry/types/span.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
from pydantic import BaseModel, Field | ||
from typing_extensions import Annotated | ||
|
||
from semantic_model.registry.types import SpanId | ||
from semantic_model.registry.types.span_type import SpanType | ||
|
||
|
||
class Span(BaseModel): | ||
service: Annotated[ | ||
str, | ||
Field( | ||
alias="service", | ||
title="Service", | ||
description="The name of the service with which this span is associated" | ||
) | ||
] | ||
name: Annotated[ | ||
str, | ||
Field( | ||
alias="name", | ||
title="Name", | ||
description="The operation name of this span" | ||
) | ||
] | ||
resource: Annotated[ | ||
str, | ||
Field( | ||
alias="resource", | ||
title="Resource", | ||
description="The resource name of this span, also sometimes called the endpoint (for web spans)" | ||
) | ||
] | ||
traceID: Annotated[ | ||
str, | ||
Field( | ||
alias="traceID", | ||
title="Trace ID", | ||
description="The ID of the trace to which this span belongs" | ||
) | ||
] | ||
spanID: Annotated[ | ||
SpanId, | ||
Field( | ||
alias="spanID", | ||
title="Span ID", | ||
), | ||
] = None | ||
parentID: Annotated[ | ||
SpanId, | ||
Field( | ||
alias="parentID", | ||
title="Parent ID", | ||
description="The ID of this span's parent, or zero if this span has no parent" | ||
) | ||
] = None | ||
start: Annotated[ | ||
int, | ||
Field( | ||
alias="start", | ||
title="Start", | ||
description="The number of nanoseconds between the Unix epoch and the beginning of this span" | ||
) | ||
] | ||
duration: Annotated[ | ||
int, | ||
Field( | ||
alias="duration", | ||
title="Duration", | ||
description="The time length of this span in nanoseconds" | ||
) | ||
] | ||
error: Annotated[ | ||
int, | ||
Field( | ||
alias="error", | ||
title="Error", | ||
description="Error is 1 if there is an error associated with this span, or 0 if there is not" | ||
) | ||
] = None | ||
meta: Annotated[ | ||
dict[str, str], | ||
Field( | ||
alias="meta", | ||
title="Meta", | ||
description="Meta is a mapping from tag name to tag value for string-valued tags" | ||
) | ||
] = None | ||
metrics: Annotated[ | ||
dict[str, float], | ||
Field( | ||
alias="metrics", | ||
title="Metrics", | ||
description="Metrics is a mapping from tag name to tag value for numeric-valued tags" | ||
) | ||
] = None | ||
type: Annotated[ | ||
SpanType, | ||
Field( | ||
alias="type", | ||
title="Type", | ||
description="Represents the type of the service with which this span is associated. Example values: `web`, `db`, `lambda`" | ||
) | ||
] = None | ||
meta_struct: Annotated[ | ||
dict[str, int], | ||
Field( | ||
alias="meta_struct", | ||
title="Meta Struct", | ||
description="Represents a registry of structured \"other\" data used by, e.g., AppSec" | ||
) | ||
] = None |
9 changes: 9 additions & 0 deletions
9
semantic-core/generation/semantic_model/registry/types/span_kind.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from enum import Enum | ||
|
||
|
||
class SpanKind(str, Enum): | ||
internal = 'internal' | ||
client = 'client' | ||
server = 'server' | ||
producer = 'producer' | ||
consumer = 'consumer' |
22 changes: 22 additions & 0 deletions
22
semantic-core/generation/semantic_model/registry/types/span_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from enum import Enum | ||
|
||
|
||
class SpanType(str, Enum): | ||
"""Span types have similar behaviour to "app types" and help categorize | ||
traces in the Datadog application. They can also help fine grain agent | ||
level behaviours such as obfuscation and quantization, when these are | ||
enabled in the agent's configuration.""" | ||
|
||
web = 'web' | ||
http = 'http' | ||
sql = 'sql' | ||
cassandra = 'cassandra' | ||
redis = 'redis' | ||
memcached = 'memcached' | ||
mongodb = 'mongodb' | ||
elasticsearch = 'elasticsearch' | ||
leveldb = 'leveldb' | ||
dns = 'dns' | ||
queue = 'queue' | ||
consul = 'consul' | ||
graphql = 'graphql' |
16 changes: 16 additions & 0 deletions
16
semantic-core/generation/semantic_model/registry/types/tags_base.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from pydantic import BaseModel, Field | ||
|
||
from typing_extensions import Annotated | ||
|
||
from semantic_model.registry.types.span_kind import SpanKind | ||
|
||
|
||
class TagsBase(BaseModel): | ||
span_kind: Annotated[ | ||
SpanKind, | ||
Field( | ||
alias="span.kind", | ||
title="span.kind", | ||
description="", | ||
) | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can this be defined as an
Annotated
Field
type? Something along these lines: https://github.com/DataDog/schema/blob/main/semantic-core/generation/semantic_model/registry/properties/data_policies.py#L12-L16This way we can leverage the
Fields
type to define in here all of the common properties that should apply to wherever this type is used.