Module: Datadog::CI::Transport::Telemetry
- Defined in:
- lib/datadog/ci/transport/telemetry.rb
Class Method Summary collapse
- .api_requests(metric_name, count, compressed:) ⇒ Object
- .api_requests_errors(metric_name, count, error_type:, status_code:) ⇒ Object
- .endpoint_payload_bytes(bytesize, endpoint:) ⇒ Object
- .endpoint_payload_dropped(count, endpoint:) ⇒ Object
- .endpoint_payload_events_count(count, endpoint:) ⇒ Object
- .endpoint_payload_requests(count, endpoint:, compressed:) ⇒ Object
- .endpoint_payload_requests_errors(count, endpoint:, error_type:, status_code:) ⇒ Object
- .endpoint_payload_requests_ms(duration_ms, endpoint:) ⇒ Object
- .endpoint_payload_serialization_ms(duration_ms, endpoint:) ⇒ Object
- .events_enqueued_for_serialization(count) ⇒ Object
- .set_error_tags(tags, error_type:, status_code:) ⇒ Object
- .tags(endpoint:) ⇒ Object
Class Method Details
.api_requests(metric_name, count, compressed:) ⇒ Object
68 69 70 71 72 73 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 68 def self.api_requests(metric_name, count, compressed:) = {} [Ext::Telemetry::TAG_REQUEST_COMPRESSED] = "true" if compressed Utils::Telemetry.inc(metric_name, count, ) end |
.api_requests_errors(metric_name, count, error_type:, status_code:) ⇒ Object
75 76 77 78 79 80 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 75 def self.api_requests_errors(metric_name, count, error_type:, status_code:) = {} (, error_type: error_type, status_code: status_code) Utils::Telemetry.inc(metric_name, count, ) end |
.endpoint_payload_bytes(bytesize, endpoint:) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 53 def self.endpoint_payload_bytes(bytesize, endpoint:) Utils::Telemetry.distribution( Ext::Telemetry::METRIC_ENDPOINT_PAYLOAD_BYTES, bytesize.to_f, (endpoint: endpoint) ) end |
.endpoint_payload_dropped(count, endpoint:) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 30 def self.endpoint_payload_dropped(count, endpoint:) Utils::Telemetry.inc( Ext::Telemetry::METRIC_ENDPOINT_PAYLOAD_DROPPED, count, (endpoint: endpoint) ) end |
.endpoint_payload_events_count(count, endpoint:) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 14 def self.endpoint_payload_events_count(count, endpoint:) Utils::Telemetry.distribution( Ext::Telemetry::METRIC_ENDPOINT_PAYLOAD_EVENTS_COUNT, count.to_f, (endpoint: endpoint) ) end |
.endpoint_payload_requests(count, endpoint:, compressed:) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 38 def self.endpoint_payload_requests(count, endpoint:, compressed:) = (endpoint: endpoint) [Ext::Telemetry::TAG_REQUEST_COMPRESSED] = "true" if compressed Utils::Telemetry.inc(Ext::Telemetry::METRIC_ENDPOINT_PAYLOAD_REQUESTS, count, ) end |
.endpoint_payload_requests_errors(count, endpoint:, error_type:, status_code:) ⇒ Object
61 62 63 64 65 66 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 61 def self.endpoint_payload_requests_errors(count, endpoint:, error_type:, status_code:) = (endpoint: endpoint) (, error_type: error_type, status_code: status_code) Utils::Telemetry.inc(Ext::Telemetry::METRIC_ENDPOINT_PAYLOAD_REQUESTS_ERRORS, count, ) end |
.endpoint_payload_requests_ms(duration_ms, endpoint:) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 45 def self.endpoint_payload_requests_ms(duration_ms, endpoint:) Utils::Telemetry.distribution( Ext::Telemetry::METRIC_ENDPOINT_PAYLOAD_REQUESTS_MS, duration_ms, (endpoint: endpoint) ) end |
.endpoint_payload_serialization_ms(duration_ms, endpoint:) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 22 def self.endpoint_payload_serialization_ms(duration_ms, endpoint:) Utils::Telemetry.distribution( Ext::Telemetry::METRIC_ENDPOINT_PAYLOAD_EVENTS_SERIALIZATION_MS, duration_ms, (endpoint: endpoint) ) end |
.events_enqueued_for_serialization(count) ⇒ Object
10 11 12 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 10 def self.events_enqueued_for_serialization(count) Utils::Telemetry.inc(Ext::Telemetry::METRIC_EVENTS_ENQUEUED, count) end |
.set_error_tags(tags, error_type:, status_code:) ⇒ Object
86 87 88 89 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 86 def self.(, error_type:, status_code:) [Ext::Telemetry::TAG_ERROR_TYPE] = error_type if error_type [Ext::Telemetry::TAG_STATUS_CODE] = status_code.to_s if status_code end |
.tags(endpoint:) ⇒ Object
82 83 84 |
# File 'lib/datadog/ci/transport/telemetry.rb', line 82 def self.(endpoint:) {Ext::Telemetry::TAG_ENDPOINT => endpoint} end |