vectordotdev / vector

A high-performance observability data pipeline.
https://vector.dev
Mozilla Public License 2.0
17.48k stars 1.53k forks source link

DataDog Lambda Extension Integration - ERROR: invalid type: map, expected byte array #19658

Open olsib opened 8 months ago

olsib commented 8 months ago

A note for the community

Problem

Hello,

I'm trying to post logs/metrics from Lambda function to Vector Aggregator using DataDog lambda extension. This should be now supported see this

I get an error when i test this:

The error is:

024-01-16 15:26:14 UTC | DD_EXTENSION | DEBUG | The payload was not too big, returning the full payload
2024-01-16 15:26:14 UTC | DD_EXTENSION | DEBUG | The payload was not too big, returning the full payload
2024-01-16 15:26:14 UTC | DD_EXTENSION | INFO | Successfully posted payload to "https://vector-agg.test.com/api/v1/series", the agent will only log transaction success every 500 transactions
2024-01-16 15:26:14 UTC | DD_EXTENSION | DEBUG | SyncForwarder has flushed 1 transactions
2024-01-16 15:26:14 UTC | DD_EXTENSION | DEBUG | Demultiplexer: sendIterableSeries: stop routine
2024-01-16 15:26:14 UTC | DD_EXTENSION | WARN | failed to post http payload. code=400 host=vector-agg.test.com response=
{
    "code": 400,
    "message": "Error parsing JSON: Error("invalid type: map, expected byte array", line: 1, column: 12)"
}

Configuration

I'm injecting the Vector URL to the Lambda function as environment variable as below:

DD_VECTOR_LOGS_ENABLED    true
DD_VECTOR_LOGS_URL    https://vector-agg.test.com/
DD_VECTOR_METRICS_ENABLED    true
DD_VECTOR_METRICS_URL    https://vector-agg.test.com/

The lambda code I'm testing with is forked from here.

In Vector Aggregator there's a DataDog agent source configured as below that sinks to stdout:

  sources:
    datadog_agent:
      address: 0.0.0.0:8282
      type: datadog_agent
      multiple_outputs: true


### Version

vector 0.32.1 (x86_64-apple-darwin 9965884 2023-08-21 14:52:38.330227446)

### Additional Context

https://discord.com/channels/742820443487993987/1196848735188177087
jszwedko commented 8 months ago

I changed this to a feature since the datadog_agent source wasn't designed to receive data from the Datadog Lambda Extension. Thanks for opening!

bharathiram commented 4 months ago

Any update on this feature?

bharathiram commented 4 months ago

Is there a workaround solution for this error we can rely upon till we get the datadog_lambda_extension as a source?

jszwedko commented 4 months ago

As a workaround, though I haven't tested this, I think you could likely use the http source to receive the log events and the datadog_agent source to receive metric events. The http source just doesn't do the same parsing of incoming payloads.

mentos1386 commented 2 days ago

Hey all, any news on this? Is it still unsupported?