Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix Spans endpoint schemas #1241

Merged
merged 1 commit into from
Jul 14, 2023
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.5",
"regenerated": "2023-07-14 13:32:03.054187",
"spec_repo_commit": "2bd58701"
"regenerated": "2023-07-14 14:04:17.404156",
"spec_repo_commit": "3868f953"
},
"v2": {
"apigentools_version": "1.6.5",
"regenerated": "2023-07-14 13:32:03.073621",
"spec_repo_commit": "2bd58701"
"regenerated": "2023-07-14 14:04:17.421016",
"spec_repo_commit": "3868f953"
}
}
}
26 changes: 26 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
@@ -15010,6 +15010,17 @@ components:
$ref: '#/components/schemas/SpansType'
type: object
SpansAggregateBucket:
description: Spans aggregate.
properties:
attributes:
$ref: '#/components/schemas/SpansAggregateBucketAttributes'
id:
description: ID of the spans aggregate.
type: string
type:
$ref: '#/components/schemas/SpansAggregateBucketType'
type: object
SpansAggregateBucketAttributes:
description: A bucket values.
properties:
by:
@@ -15020,13 +15031,24 @@ components:
'@state': success
'@version': abc
type: object
compute:
description: The compute data.
type: object
computes:
additionalProperties:
$ref: '#/components/schemas/SpansAggregateBucketValue'
description: A map of the metric name -> value for regular compute or list
of values for a timeseries.
type: object
type: object
SpansAggregateBucketType:
description: The spans aggregate bucket type.
enum:
- bucket
example: bucket
type: string
x-enum-varnames:
- BUCKET
SpansAggregateBucketValue:
description: A bucket value, can be either a timeseries or a single value.
oneOf:
@@ -15214,6 +15236,10 @@ components:
customAttribute: 123
duration: 2345
type: object
custom:
additionalProperties: {}
description: JSON object of custom spans data.
type: object
end_timestamp:
description: End timestamp of your span.
example: '2023-01-02T09:42:36.420Z'
2 changes: 2 additions & 0 deletions packages/datadog-api-client-v2/index.ts
Original file line number Diff line number Diff line change
@@ -1333,6 +1333,8 @@ export { SlackIntegrationMetadata } from "./models/SlackIntegrationMetadata";
export { SlackIntegrationMetadataChannelItem } from "./models/SlackIntegrationMetadataChannelItem";
export { Span } from "./models/Span";
export { SpansAggregateBucket } from "./models/SpansAggregateBucket";
export { SpansAggregateBucketAttributes } from "./models/SpansAggregateBucketAttributes";
export { SpansAggregateBucketType } from "./models/SpansAggregateBucketType";
export { SpansAggregateBucketValue } from "./models/SpansAggregateBucketValue";
export { SpansAggregateBucketValueTimeseriesPoint } from "./models/SpansAggregateBucketValueTimeseriesPoint";
export { SpansAggregateData } from "./models/SpansAggregateData";
3 changes: 3 additions & 0 deletions packages/datadog-api-client-v2/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
@@ -720,6 +720,7 @@ import { SlackIntegrationMetadata } from "./SlackIntegrationMetadata";
import { SlackIntegrationMetadataChannelItem } from "./SlackIntegrationMetadataChannelItem";
import { Span } from "./Span";
import { SpansAggregateBucket } from "./SpansAggregateBucket";
import { SpansAggregateBucketAttributes } from "./SpansAggregateBucketAttributes";
import { SpansAggregateBucketValueTimeseriesPoint } from "./SpansAggregateBucketValueTimeseriesPoint";
import { SpansAggregateData } from "./SpansAggregateData";
import { SpansAggregateRequest } from "./SpansAggregateRequest";
@@ -1258,6 +1259,7 @@ const enumsMap: { [key: string]: any[] } = {
ServiceDefinitionV2OpsgenieRegion: ["US", "EU"],
ServiceDefinitionV2SlackType: ["slack"],
ServiceDefinitionV2Version: ["v2"],
SpansAggregateBucketType: ["bucket"],
SpansAggregateRequestType: ["aggregate_request"],
SpansAggregateResponseStatus: ["done", "timeout"],
SpansAggregateSortType: ["alphabetical", "measure"],
@@ -2117,6 +2119,7 @@ const typeMap: { [index: string]: any } = {
SlackIntegrationMetadataChannelItem: SlackIntegrationMetadataChannelItem,
Span: Span,
SpansAggregateBucket: SpansAggregateBucket,
SpansAggregateBucketAttributes: SpansAggregateBucketAttributes,
SpansAggregateBucketValueTimeseriesPoint:
SpansAggregateBucketValueTimeseriesPoint,
SpansAggregateData: SpansAggregateData,
33 changes: 21 additions & 12 deletions packages/datadog-api-client-v2/models/SpansAggregateBucket.ts
Original file line number Diff line number Diff line change
@@ -3,22 +3,27 @@
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { SpansAggregateBucketValue } from "./SpansAggregateBucketValue";
import { SpansAggregateBucketAttributes } from "./SpansAggregateBucketAttributes";
import { SpansAggregateBucketType } from "./SpansAggregateBucketType";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* A bucket values.
* Spans aggregate.
*/
export class SpansAggregateBucket {
/**
* The key, value pairs for each group by.
* A bucket values.
*/
"by"?: { [key: string]: any };
"attributes"?: SpansAggregateBucketAttributes;
/**
* A map of the metric name -> value for regular compute or list of values for a timeseries.
* ID of the spans aggregate.
*/
"computes"?: { [key: string]: SpansAggregateBucketValue };
"id"?: string;
/**
* The spans aggregate bucket type.
*/
"type"?: SpansAggregateBucketType;

/**
* @ignore
@@ -29,13 +34,17 @@ export class SpansAggregateBucket {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
by: {
baseName: "by",
type: "{ [key: string]: any; }",
attributes: {
baseName: "attributes",
type: "SpansAggregateBucketAttributes",
},
id: {
baseName: "id",
type: "string",
},
computes: {
baseName: "computes",
type: "{ [key: string]: SpansAggregateBucketValue; }",
type: {
baseName: "type",
type: "SpansAggregateBucketType",
},
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { SpansAggregateBucketValue } from "./SpansAggregateBucketValue";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* A bucket values.
*/
export class SpansAggregateBucketAttributes {
/**
* The key, value pairs for each group by.
*/
"by"?: { [key: string]: any };
/**
* The compute data.
*/
"compute"?: any;
/**
* A map of the metric name -> value for regular compute or list of values for a timeseries.
*/
"computes"?: { [key: string]: SpansAggregateBucketValue };

/**
* @ignore
*/
"_unparsed"?: boolean;

/**
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
by: {
baseName: "by",
type: "{ [key: string]: any; }",
},
compute: {
baseName: "compute",
type: "any",
},
computes: {
baseName: "computes",
type: "{ [key: string]: SpansAggregateBucketValue; }",
},
};

/**
* @ignore
*/
static getAttributeTypeMap(): AttributeTypeMap {
return SpansAggregateBucketAttributes.attributeTypeMap;
}

public constructor() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/

import { UnparsedObject } from "../../datadog-api-client-common/util";

/**
* The spans aggregate bucket type.
*/

export type SpansAggregateBucketType = typeof BUCKET | UnparsedObject;
export const BUCKET = "bucket";
8 changes: 8 additions & 0 deletions packages/datadog-api-client-v2/models/SpansAttributes.ts
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@ export class SpansAttributes {
* JSON object of attributes from your span.
*/
"attributes"?: { [key: string]: any };
/**
* JSON object of custom spans data.
*/
"custom"?: { [key: string]: any };
/**
* End timestamp of your span.
*/
@@ -90,6 +94,10 @@ export class SpansAttributes {
baseName: "attributes",
type: "{ [key: string]: any; }",
},
custom: {
baseName: "custom",
type: "{ [key: string]: any; }",
},
endTimestamp: {
baseName: "end_timestamp",
type: "Date",