From 01595576990fa00492590bf9f9f8892352560374 Mon Sep 17 00:00:00 2001 From: Rodrigo Arguello Date: Mon, 11 Dec 2023 18:25:44 +0100 Subject: [PATCH 1/3] Extend AgentPayload model --- semantic-core/gen_semantic_defs.py | 248 +++++++++++++++++++++++++++- semantic-core/v1/agent_payload.json | 248 +++++++++++++++++++++++++++- 2 files changed, 493 insertions(+), 3 deletions(-) diff --git a/semantic-core/gen_semantic_defs.py b/semantic-core/gen_semantic_defs.py index 24ac806..2833d69 100644 --- a/semantic-core/gen_semantic_defs.py +++ b/semantic-core/gen_semantic_defs.py @@ -417,6 +417,244 @@ class IntakeResolvedDbSpan(BaseModel): ] = None +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[ + TraceId, + 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", + description="The ID of this span" + ) + ] + 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" + # TODO: this can probably be validated better + ) + ] + 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[ + str, + 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 + + +class TraceChunk(BaseModel): + priority: Annotated[ + int, + Field( + alias="priority", + title="Priority", + description="Specifies the sampling priority of the trace" + ) + ] + origin: Annotated[ + str, + Field( + alias="origin", + title="Origin", + description="Specifies the origin product (`lambda`, `rum`, etc.) of the trace" + ) + ] = None + spans: Annotated[ + List[Span], + Field( + alias="spans", + title="Spans", + description="Specifies the list of containing spans" + ) + ] + tags: Annotated[ + dict[str, str], + Field( + alias="tags", + title="Tags", + description="Specifies the list of tags common in all Spans", + ) + ] = None + droppedTrace: Annotated[ + bool, + Field( + alias="droppedTrace", + title="Dropped Trace", + description="Specifies whether the trace was dropped by samplers or not", + ) + ] = None + + +class TracerPayload(BaseModel): + containerID: Annotated[ + str, + Field( + alias="containerID", + title="Container ID", + description="Specifies the ID of the container where the tracer is running on" + ) + ] = None + languageName: Annotated[ + str, + Field( + alias="languageName", + title="Language Name", + description="Specifies the language of the tracer", + pattern=r"^(golang|python|php|ruby|jvm|dotnet|js)$", + ) + ] + languageVersion: Annotated[ + str, + Field( + alias="languageVersion", + title="Language Version", + description="Specifies the language version of the tracer", + # TODO: add pattern to validate version string + ) + ] + tracerVersion: Annotated[ + str, + Field( + alias="tracerVersion", + title="Tracer Version", + description="Specifies the version of the tracer", + # TODO: add pattern to validate version string + ) + ] + runtimeID: Annotated[ + str, + Field( + alias="runtimeID", + title="Runtime ID", + description="Specifies V4 UUID representation of a tracer session", + # TODO: add pattern to validate UUID + ) + ] = None + chunks: Annotated[ + List[TraceChunk], + Field( + alias="chunks", + title="Trace Chunks", + description="Specifies the list of containing trace chunks", + ) + ] + tags: Annotated[ + dict[str, str], + Field( + alias="tags", + title="Trace Tags", + description="Specifies the list of tags common in all Trace Chunks", + ) + ] = None + env: Annotated[ + str, + Field( + alias="env", + title="Env", + description="Specifies the `env` tag that is set in the tracer configuration", + ) + ] + hostname: Annotated[ + str, + Field( + alias="hostname", + title="Hostname", + description="Specifies the hostname where the tracer is running", + ) + ] = None + appVersion: Annotated[ + str, + Field( + alias="appVersion", + title="App Version", + description="Specifies the `version` tag that set in the tracer configuration", + ) + ] + + class SpanLink(BaseModel): traceID: Annotated[TraceId, Field(alias="traceID", title="Trace ID")] = ... traceID_High: Annotated[ @@ -518,8 +756,14 @@ class AgentPayload(BaseModel): description="""Holds `RareSamplerEnabled` value in AgentConfig""", ), ] = None - - # TODO: tracerPayloads + tracerPayloads: Annotated[ + List[TracerPayload], + Field( + alias="tracerPayloads", + title="Tracer Payloads", + description="""Specifies the list of the payloads received from tracers""", + ) + ] def generate_schema(payload_type, version): diff --git a/semantic-core/v1/agent_payload.json b/semantic-core/v1/agent_payload.json index 7c65512..ead9a36 100644 --- a/semantic-core/v1/agent_payload.json +++ b/semantic-core/v1/agent_payload.json @@ -1,4 +1,241 @@ { + "$defs": { + "Span": { + "properties": { + "service": { + "description": "The name of the service with which this span is associated", + "title": "Service", + "type": "string" + }, + "name": { + "description": "The operation name of this span", + "title": "Name", + "type": "string" + }, + "resource": { + "description": "The resource name of this span, also sometimes called the endpoint (for web spans)", + "title": "Resource", + "type": "string" + }, + "traceID": { + "description": "The ID of the trace to which this span belongs", + "examples": [ + 0, + 12345, + 543210, + 9999999 + ], + "is_sensitive": false, + "title": "Trace ID", + "type": "integer" + }, + "spanID": { + "description": "The ID of this span", + "examples": [ + 0, + 12345, + 543210, + 9999999 + ], + "is_sensitive": false, + "title": "Span ID", + "type": "integer" + }, + "parentID": { + "default": null, + "description": "The ID of this span's parent, or zero if this span has no parent", + "examples": [ + 0, + 12345, + 543210, + 9999999 + ], + "is_sensitive": false, + "title": "Parent ID", + "type": "integer" + }, + "start": { + "description": "The number of nanoseconds between the Unix epoch and the beginning of this span", + "title": "Start", + "type": "integer" + }, + "duration": { + "description": "The time length of this span in nanoseconds", + "title": "Duration", + "type": "integer" + }, + "error": { + "default": null, + "description": "Error is 1 if there is an error associated with this span, or 0 if there is not", + "title": "Error", + "type": "integer" + }, + "meta": { + "additionalProperties": { + "type": "string" + }, + "default": null, + "description": "Meta is a mapping from tag name to tag value for string-valued tags", + "title": "Meta", + "type": "object" + }, + "metrics": { + "additionalProperties": { + "type": "number" + }, + "default": null, + "description": "Metrics is a mapping from tag name to tag value for numeric-valued tags", + "title": "Metrics", + "type": "object" + }, + "type": { + "default": null, + "description": "Represents the type of the service with which this span is associated. Example values: `web`, `db`, `lambda`", + "title": "Type", + "type": "string" + }, + "meta_struct": { + "additionalProperties": { + "type": "integer" + }, + "default": null, + "description": "Represents a registry of structured \"other\" data used by, e.g., AppSec", + "title": "Meta Struct", + "type": "object" + } + }, + "required": [ + "service", + "name", + "resource", + "traceID", + "spanID", + "start", + "duration" + ], + "title": "Span", + "type": "object" + }, + "TraceChunk": { + "properties": { + "priority": { + "description": "Specifies the sampling priority of the trace", + "title": "Priority", + "type": "integer" + }, + "origin": { + "default": null, + "description": "Specifies the origin product (`lambda`, `rum`, etc.) of the trace", + "title": "Origin", + "type": "string" + }, + "spans": { + "description": "Specifies the list of containing spans", + "items": { + "$ref": "#/$defs/Span" + }, + "title": "Spans", + "type": "array" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "default": null, + "description": "Specifies the list of tags common in all Spans", + "title": "Tags", + "type": "object" + }, + "droppedTrace": { + "default": null, + "description": "Specifies whether the trace was dropped by samplers or not", + "title": "Dropped Trace", + "type": "boolean" + } + }, + "required": [ + "priority", + "spans" + ], + "title": "TraceChunk", + "type": "object" + }, + "TracerPayload": { + "properties": { + "containerID": { + "default": null, + "description": "Specifies the ID of the container where the tracer is running on", + "title": "Container ID", + "type": "string" + }, + "languageName": { + "description": "Specifies the language of the tracer", + "pattern": "^(golang|python|php|ruby|jvm|dotnet|js)$", + "title": "Language Name", + "type": "string" + }, + "languageVersion": { + "description": "Specifies the language version of the tracer", + "title": "Language Version", + "type": "string" + }, + "tracerVersion": { + "description": "Specifies the version of the tracer", + "title": "Tracer Version", + "type": "string" + }, + "runtimeID": { + "default": null, + "description": "Specifies V4 UUID representation of a tracer session", + "title": "Runtime ID", + "type": "string" + }, + "chunks": { + "description": "Specifies the list of containing trace chunks", + "items": { + "$ref": "#/$defs/TraceChunk" + }, + "title": "Trace Chunks", + "type": "array" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "default": null, + "description": "Specifies the list of tags common in all Trace Chunks", + "title": "Trace Tags", + "type": "object" + }, + "env": { + "description": "Specifies the `env` tag that is set in the tracer configuration", + "title": "Env", + "type": "string" + }, + "hostname": { + "default": null, + "description": "Specifies the hostname where the tracer is running", + "title": "Hostname", + "type": "string" + }, + "appVersion": { + "description": "Specifies the `version` tag that set in the tracer configuration", + "title": "App Version", + "type": "string" + } + }, + "required": [ + "languageName", + "languageVersion", + "tracerVersion", + "chunks", + "env", + "appVersion" + ], + "title": "TracerPayload", + "type": "object" + } + }, "description": "Represents the generic semantics for the agent payload, structurally defined here: https://github.com/DataDog/datadog-agent/blob/main/pkg/proto/datadog/trace/agent_payload.proto", "properties": { "hostName": { @@ -51,12 +288,21 @@ "description": "Holds `RareSamplerEnabled` value in AgentConfig", "title": "Rare Sampler Flag", "type": "boolean" + }, + "tracerPayloads": { + "description": "Specifies the list of the payloads received from tracers", + "items": { + "$ref": "#/$defs/TracerPayload" + }, + "title": "Tracer Payloads", + "type": "array" } }, "required": [ "agentVersion", "targetTPS", - "errorTPS" + "errorTPS", + "tracerPayloads" ], "title": "AgentPayload", "type": "object" From 1595ae232b4d86c063f21255480b907ef219e494 Mon Sep 17 00:00:00 2001 From: Rodrigo Arguello Date: Thu, 14 Dec 2023 14:19:36 +0100 Subject: [PATCH 2/3] tests --- semantic-core/gen_semantic_defs.py | 75 ++-- semantic-core/v1/agent_payload.json | 80 +++-- semantic-core/v1/agent_payload_modified.json | 341 +++++++++++++++++++ 3 files changed, 451 insertions(+), 45 deletions(-) create mode 100644 semantic-core/v1/agent_payload_modified.json diff --git a/semantic-core/gen_semantic_defs.py b/semantic-core/gen_semantic_defs.py index 2833d69..711dff4 100644 --- a/semantic-core/gen_semantic_defs.py +++ b/semantic-core/gen_semantic_defs.py @@ -5,6 +5,7 @@ from typing import List, Dict from pydantic import BaseModel, Field +from pydantic.config import ConfigDict from typing_extensions import Annotated # Semantic Types @@ -12,7 +13,6 @@ NonEmptyString = Annotated[str, Field(min_length=1)] PositiveFloat = Annotated[float, Field(gt=0)] - TraceId = Annotated[ int, Field( @@ -417,7 +417,45 @@ class IntakeResolvedDbSpan(BaseModel): ] = None +class HTTPTags(BaseModel): + span_kind: Annotated[ + str, + Field( + alias="span.kind", + title="span.kind", + description="", + pattern=r"^(client|server)$", + ) + ] + http_status_code: Annotated[ + HttpStatusCode, + Field( + alias="http.status_code", + title="http.status_code", + ) + ] + + +class DBTags(BaseModel): + pass + + class Span(BaseModel): + model_config = ConfigDict( + # json_schema_extra={ + # 'allOf': [ + # { + # 'if': {'properties': {'type': {'const': 'web'}}}, + # 'then': {'properties': {'meta': {'$ref': '#/$defs/HTTPTags'}}}, + # }, + # { + # 'if': {'properties': {'type': {'const': 'db'}}}, + # 'then': {'properties': {'meta': {'$ref': '#/$defs/DBTags'}}}, + # }, + # ] + # } + ) + service: Annotated[ str, Field( @@ -443,7 +481,7 @@ class Span(BaseModel): ) ] traceID: Annotated[ - TraceId, + str, # TODO: find out why these are sent as string Field( alias="traceID", title="Trace ID", @@ -451,7 +489,7 @@ class Span(BaseModel): ) ] spanID: Annotated[ - SpanId, + str, # TODO: find out why these are sent as string Field( alias="spanID", title="Span ID", @@ -459,7 +497,7 @@ class Span(BaseModel): ) ] parentID: Annotated[ - SpanId, + str, # TODO: find out why these are sent as string Field( alias="parentID", title="Parent ID", @@ -467,7 +505,7 @@ class Span(BaseModel): ) ] = None start: Annotated[ - int, + str, # TODO: find out why these are sent as string Field( alias="start", title="Start", @@ -476,7 +514,7 @@ class Span(BaseModel): ) ] duration: Annotated[ - int, + str, # TODO: find out why these are sent as string Field( alias="duration", title="Duration", @@ -695,6 +733,9 @@ class AgentPayload(BaseModel): """ Represents the generic semantics for the agent payload, structurally defined here: https://github.com/DataDog/datadog-agent/blob/main/pkg/proto/datadog/trace/agent_payload.proto """ + # adding this here since otherwise these models are not included in the $defs object + http_tags: HTTPTags = None + db_tags: DBTags = None hostName: Annotated[ Hostname, @@ -767,7 +808,6 @@ class AgentPayload(BaseModel): def generate_schema(payload_type, version): - json_schema_str = json.dumps(payload_type.model_json_schema(), indent=2) # Create the directory if it doesn't exist @@ -796,17 +836,14 @@ def generate_schema(payload_type, version): args = parser.parse_args() - try: - payload_types = [ - IntakeResolvedSpan, - IntakeResolvedHttpSpan, - IntakeResolvedDbSpan, - AgentPayload, - ] + payload_types = [ + IntakeResolvedSpan, + IntakeResolvedHttpSpan, + IntakeResolvedDbSpan, + AgentPayload, + ] - for pt in payload_types: - generate_schema(pt, version=args.version) + for pt in payload_types: + generate_schema(pt, version=args.version) - logger.info(f"Schema successfully generated for version: {args.version}") - except Exception as e: - logger.error(f"Error generating schema: {e}") + logger.info(f"Schema successfully generated for version: {args.version}") diff --git a/semantic-core/v1/agent_payload.json b/semantic-core/v1/agent_payload.json index ead9a36..441ec4e 100644 --- a/semantic-core/v1/agent_payload.json +++ b/semantic-core/v1/agent_payload.json @@ -1,5 +1,38 @@ { "$defs": { + "DBTags": { + "properties": {}, + "title": "DBTags", + "type": "object" + }, + "HTTPTags": { + "properties": { + "span.kind": { + "description": "", + "pattern": "^(client|server)$", + "title": "span.kind", + "type": "string" + }, + "http.status_code": { + "description": "\n The HTTP response status code.", + "examples": [ + "200", + "404", + "500" + ], + "is_sensitive": false, + "pattern": "^[12345]\\d\\d$", + "title": "http.status_code", + "type": "string" + } + }, + "required": [ + "span.kind", + "http.status_code" + ], + "title": "HTTPTags", + "type": "object" + }, "Span": { "properties": { "service": { @@ -19,50 +52,29 @@ }, "traceID": { "description": "The ID of the trace to which this span belongs", - "examples": [ - 0, - 12345, - 543210, - 9999999 - ], - "is_sensitive": false, "title": "Trace ID", - "type": "integer" + "type": "string" }, "spanID": { "description": "The ID of this span", - "examples": [ - 0, - 12345, - 543210, - 9999999 - ], - "is_sensitive": false, "title": "Span ID", - "type": "integer" + "type": "string" }, "parentID": { "default": null, "description": "The ID of this span's parent, or zero if this span has no parent", - "examples": [ - 0, - 12345, - 543210, - 9999999 - ], - "is_sensitive": false, "title": "Parent ID", - "type": "integer" + "type": "string" }, "start": { "description": "The number of nanoseconds between the Unix epoch and the beginning of this span", "title": "Start", - "type": "integer" + "type": "string" }, "duration": { "description": "The time length of this span in nanoseconds", "title": "Duration", - "type": "integer" + "type": "string" }, "error": { "default": null, @@ -238,6 +250,22 @@ }, "description": "Represents the generic semantics for the agent payload, structurally defined here: https://github.com/DataDog/datadog-agent/blob/main/pkg/proto/datadog/trace/agent_payload.proto", "properties": { + "http_tags": { + "allOf": [ + { + "$ref": "#/$defs/HTTPTags" + } + ], + "default": null + }, + "db_tags": { + "allOf": [ + { + "$ref": "#/$defs/DBTags" + } + ], + "default": null + }, "hostName": { "default": null, "description": "\nHostname of where the agent is running.", diff --git a/semantic-core/v1/agent_payload_modified.json b/semantic-core/v1/agent_payload_modified.json new file mode 100644 index 0000000..b780b0f --- /dev/null +++ b/semantic-core/v1/agent_payload_modified.json @@ -0,0 +1,341 @@ +{ + "$defs": { + "DBTags": { + "properties": {}, + "title": "DBTags", + "type": "object" + }, + "HTTPTags": { + "properties": { + "span.kind": { + "description": "", + "pattern": "^(client|server)$", + "title": "span.kind", + "type": "string" + }, + "http.status_code": { + "description": "\nThe HTTP response status code.\nWhen span.kind: client the response status code received.\nWhen span.kind: server the response status code sent.\nNote: Although this is an integer, it must be sent as a string.", + "examples": [ + "200", + "404", + "500" + ], + "is_sensitive": false, + "pattern": "^[12345]\\d\\d$", + "title": "HTTP Status Code", + "type": "string" + } + }, + "required": [ + "span.kind", + "http.status_code" + ], + "title": "HTTPTags", + "type": "object" + }, + "Span": { + "properties": { + "service": { + "description": "The name of the service with which this span is associated", + "title": "Service", + "type": "string" + }, + "name": { + "description": "The operation name of this span", + "title": "Name", + "type": "string" + }, + "resource": { + "description": "The resource name of this span, also sometimes called the endpoint (for web spans)", + "title": "Resource", + "type": "string" + }, + "traceID": { + "description": "The ID of the trace to which this span belongs", + "title": "Trace ID", + "type": "integer" + }, + "spanID": { + "description": "The ID of this span", + "title": "Span ID", + "type": "integer" + }, + "parentID": { + "default": null, + "description": "The ID of this span's parent, or zero if this span has no parent", + "title": "Parent ID", + "type": "integer" + }, + "start": { + "description": "The number of nanoseconds between the Unix epoch and the beginning of this span", + "title": "Start", + "type": "integer" + }, + "duration": { + "description": "The time length of this span in nanoseconds", + "title": "Duration", + "type": "integer" + }, + "error": { + "default": null, + "description": "Error is 1 if there is an error associated with this span, or 0 if there is not", + "title": "Error", + "type": "integer" + }, + "meta": { + "additionalProperties": { + "type": "string" + }, + "default": null, + "description": "Meta is a mapping from tag name to tag value for string-valued tags", + "title": "Meta", + "type": "object" + }, + "metrics": { + "additionalProperties": { + "type": "number" + }, + "default": null, + "description": "Metrics is a mapping from tag name to tag value for numeric-valued tags", + "title": "Metrics", + "type": "object" + }, + "type": { + "default": null, + "description": "Represents the type of the service with which this span is associated. Example values: `web`, `db`, `lambda`", + "title": "Type", + "type": "string" + }, + "meta_struct": { + "additionalProperties": { + "type": "integer" + }, + "default": null, + "description": "Represents a registry of structured \"other\" data used by, e.g., AppSec", + "title": "Meta Struct", + "type": "object" + } + }, + "required": [ + "service", + "name", + "resource", + "traceID", + "spanID", + "start", + "duration" + ], + "title": "Span", + "type": "object", + "allOf": [ + { + "if": {"not": {"properties": {"type": {"enum": ["web", "db"]}}}}, + "then": {"properties": {"meta": {"type": "object", "additionalProperties": {"type": "string"}}}} + }, + { + "if": { + "properties": {"type": {"const": "web"}}, + "required": ["type"] + }, + "then": {"properties": {"meta": {"$ref": "#/$defs/HTTPTags"}}} + }, + { + "if": { + "properties": {"type": {"const": "db"}}, + "required": ["type"] + }, + "then": {"properties": {"meta": {"$ref": "#/$defs/DBTags"}}} + } + ] + }, + "TraceChunk": { + "properties": { + "priority": { + "description": "Specifies the sampling priority of the trace", + "title": "Priority", + "type": "integer" + }, + "origin": { + "default": null, + "description": "Specifies the origin product (`lambda`, `rum`, etc.) of the trace", + "title": "Origin", + "type": "string" + }, + "spans": { + "description": "Specifies the list of containing spans", + "items": { + "$ref": "#/$defs/Span" + }, + "title": "Spans", + "type": "array" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "default": null, + "description": "Specifies the list of tags common in all Spans", + "title": "Tags", + "type": "object" + }, + "droppedTrace": { + "default": null, + "description": "Specifies whether the trace was dropped by samplers or not", + "title": "Dropped Trace", + "type": "boolean" + } + }, + "required": [ + "priority", + "spans" + ], + "title": "TraceChunk", + "type": "object" + }, + "TracerPayload": { + "properties": { + "containerID": { + "default": null, + "description": "Specifies the ID of the container where the tracer is running on", + "title": "Container ID", + "type": "string" + }, + "languageName": { + "description": "Specifies the language of the tracer", + "pattern": "^(go|python|php|ruby|jvm|dotnet|js)$", + "title": "Language Name", + "type": "string" + }, + "languageVersion": { + "description": "Specifies the language version of the tracer", + "title": "Language Version", + "type": "string" + }, + "tracerVersion": { + "description": "Specifies the version of the tracer", + "title": "Tracer Version", + "type": "string" + }, + "runtimeID": { + "default": null, + "description": "Specifies V4 UUID representation of a tracer session", + "title": "Runtime ID", + "type": "string" + }, + "chunks": { + "description": "Specifies the list of containing trace chunks", + "items": { + "$ref": "#/$defs/TraceChunk" + }, + "title": "Trace Chunks", + "type": "array" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "default": null, + "description": "Specifies the list of tags common in all Trace Chunks", + "title": "Trace Tags", + "type": "object" + }, + "env": { + "description": "Specifies the `env` tag that is set in the tracer configuration", + "title": "Env", + "type": "string" + }, + "hostname": { + "default": null, + "description": "Specifies the hostname where the tracer is running", + "title": "Hostname", + "type": "string" + }, + "appVersion": { + "description": "Specifies the `version` tag that set in the tracer configuration", + "title": "App Version", + "type": "string" + } + }, + "required": [ + "languageName", + "languageVersion", + "tracerVersion", + "chunks", + "env", + "appVersion" + ], + "title": "TracerPayload", + "type": "object" + } + }, + "description": "Represents the generic semantics for the agent payload, structurally defined here: https://github.com/DataDog/datadog-agent/blob/main/pkg/proto/datadog/trace/agent_payload.proto", + "properties": { + "hostName": { + "default": null, + "description": "\nHostname of where the agent is running.", + "examples": [ + "my-hostname" + ], + "is_sensitive": false, + "minLength": 0, + "title": "Hostname", + "type": "string" + }, + "env": { + "default": null, + "description": "Specifies the 'env' set in the agent's configuration.", + "minLength": 1, + "title": "Env", + "type": "string" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "default": null, + "description": "Tags specifies tags common in all `tracerPayloads`", + "title": "Tags", + "type": "object" + }, + "agentVersion": { + "description": "Specifies version of the agent", + "minLength": 1, + "title": "Agent Version", + "type": "string" + }, + "targetTPS": { + "description": "Holds `TargetTPS` value in AgentConfig", + "exclusiveMinimum": 0.0, + "title": "Target TPS", + "type": "number" + }, + "errorTPS": { + "description": "Holds `ErrorTPS` value in AgentConfig", + "exclusiveMinimum": 0.0, + "title": "Error TPS", + "type": "number" + }, + "rareSamplerEnabled": { + "default": null, + "description": "Holds `RareSamplerEnabled` value in AgentConfig", + "title": "Rare Sampler Flag", + "type": "boolean" + }, + "tracerPayloads": { + "description": "Specifies the list of the payloads received from tracers", + "items": { + "$ref": "#/$defs/TracerPayload" + }, + "title": "Tracer Payloads", + "type": "array" + } + }, + "required": [ + "agentVersion", + "targetTPS", + "errorTPS", + "tracerPayloads" + ], + "title": "AgentPayload", + "type": "object" +} From 193268b64490ed43659d95a3d498784ea4d26ba8 Mon Sep 17 00:00:00 2001 From: Rodrigo Arguello Date: Thu, 14 Dec 2023 15:19:54 +0100 Subject: [PATCH 3/3] fix pattern --- semantic-core/v1/agent_payload_modified.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantic-core/v1/agent_payload_modified.json b/semantic-core/v1/agent_payload_modified.json index b780b0f..0f69c48 100644 --- a/semantic-core/v1/agent_payload_modified.json +++ b/semantic-core/v1/agent_payload_modified.json @@ -202,7 +202,7 @@ }, "languageName": { "description": "Specifies the language of the tracer", - "pattern": "^(go|python|php|ruby|jvm|dotnet|js)$", + "pattern": "^(go|python|php|ruby|java|dotnet|js)$", "title": "Language Name", "type": "string" },