Sha256: b83f83e7f5e85ece24063c2fcd7f866c56dbea4e9d2310f8a7ac57bd8919eea7

Contents?: true

Size: 1.06 KB

Versions: 20

Compression:

Stored size: 1.06 KB

Contents

# Update a span-based metric returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SpansMetricsAPI.new

# there is a valid "spans_metric" in the system
SPANS_METRIC_DATA_ATTRIBUTES_FILTER_QUERY = ENV["SPANS_METRIC_DATA_ATTRIBUTES_FILTER_QUERY"]
SPANS_METRIC_DATA_ID = ENV["SPANS_METRIC_DATA_ID"]

body = DatadogAPIClient::V2::SpansMetricUpdateRequest.new({
  data: DatadogAPIClient::V2::SpansMetricUpdateData.new({
    attributes: DatadogAPIClient::V2::SpansMetricUpdateAttributes.new({
      compute: DatadogAPIClient::V2::SpansMetricUpdateCompute.new({
        include_percentiles: false,
      }),
      filter: DatadogAPIClient::V2::SpansMetricFilter.new({
        query: "@http.status_code:200 service:my-service-updated",
      }),
      group_by: [
        DatadogAPIClient::V2::SpansMetricGroupBy.new({
          path: "resource_name",
          tag_name: "resource_name",
        }),
      ],
    }),
    type: DatadogAPIClient::V2::SpansMetricType::SPANS_METRICS,
  }),
})
p api_instance.update_spans_metric(SPANS_METRIC_DATA_ID, body)

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
datadog_api_client-2.29.1 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.28.1 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.27.1 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.26.1 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.26.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.25.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.24.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.22.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.21.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.20.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.19.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.18.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.17.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.16.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.15.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.14.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.13.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.12.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.11.0 examples/v2/spans-metrics/UpdateSpansMetric.rb
datadog_api_client-2.10.0 examples/v2/spans-metrics/UpdateSpansMetric.rb