Module: Datadog::DataStreams

Defined in:
lib/datadog/data_streams.rb,
lib/datadog/data_streams/ext.rb,
lib/datadog/data_streams/processor.rb,
lib/datadog/data_streams/extensions.rb,
lib/datadog/data_streams/configuration.rb,
lib/datadog/data_streams/transport/http.rb,
lib/datadog/data_streams/pathway_context.rb,
lib/datadog/data_streams/transport/stats.rb,
lib/datadog/data_streams/transport/http/api.rb,
lib/datadog/data_streams/transport/http/stats.rb,
lib/datadog/data_streams/transport/http/client.rb,
lib/datadog/data_streams/configuration/settings.rb

Overview

Datadog Data Streams Monitoring public API.

The Datadog team ensures that public methods in this module only receive backwards compatible changes, and breaking changes will only occur in new major versions releases.

Defined Under Namespace

Modules: Ext

Class Method Summary collapse

Class Method Details

.enabled?Boolean

Check if Data Streams Monitoring is enabled and available

Returns:

  • (Boolean)

    true if the processor is available



82
83
84
# File 'lib/datadog/data_streams.rb', line 82

def enabled?
  !processor.nil?
end

.set_consume_checkpoint(type:, source:, auto_instrumentation: false, tags: {}) {|key| ... } ⇒ String?

Set a consume checkpoint for Data Streams Monitoring

Parameters:

  • type (String)

    The type of the checkpoint (e.g., 'kafka', 'kinesis', 'sns')

  • source (String)

    The source (e.g., topic, exchange, stream name)

  • auto_instrumentation (Boolean) (defaults to: false)

    Whether this checkpoint was set by auto-instrumentation (default: false)

  • tags (Hash) (defaults to: {})

    Additional tags to include

Yields:

  • (key)

    Block to extract context from carrier

Returns:

  • (String, nil)

    Base64 encoded pathway context or nil if disabled



46
47
48
49
50
51
52
53
54
# File 'lib/datadog/data_streams.rb', line 46

def set_consume_checkpoint(type:, source:, auto_instrumentation: false, tags: {}, &block)
  processor&.set_consume_checkpoint(
    type: type,
    source: source,
    manual_checkpoint: !auto_instrumentation,
    tags: tags,
    &block
  )
end

.set_produce_checkpoint(type:, destination:, auto_instrumentation: false, tags: {}) {|key, value| ... } ⇒ String?

Set a produce checkpoint for Data Streams Monitoring

Parameters:

  • type (String)

    The type of the checkpoint (e.g., 'kafka', 'kinesis', 'sns')

  • destination (String)

    The destination (e.g., topic, exchange, stream name)

  • auto_instrumentation (Boolean) (defaults to: false)

    Whether this checkpoint was set by auto-instrumentation (default: false)

  • tags (Hash) (defaults to: {})

    Additional tags to include

Yields:

  • (key, value)

    Block to inject context into carrier

Returns:

  • (String, nil)

    Base64 encoded pathway context or nil if disabled



27
28
29
30
31
32
33
34
35
# File 'lib/datadog/data_streams.rb', line 27

def set_produce_checkpoint(type:, destination:, auto_instrumentation: false, tags: {}, &block)
  processor&.set_produce_checkpoint(
    type: type,
    destination: destination,
    manual_checkpoint: !auto_instrumentation,
    tags: tags,
    &block
  )
end