|
| 1 | +import { Fixture } from './general_fixtures' |
| 2 | + |
| 3 | +export const anADOTCloudWatchEvent: Fixture = { |
| 4 | + input: { |
| 5 | + deliveryStreamArn: 'someDeliveryStreamArn', |
| 6 | + invocationId: 'someId', |
| 7 | + region: 'eu-west-1', |
| 8 | + records: [{ |
| 9 | + approximateArrivalTimestamp: 1234, |
| 10 | + recordId: 'LogEvent-1', |
| 11 | + data: Buffer.from(JSON.stringify({ |
| 12 | + owner: '223851549868', |
| 13 | + logGroup: 'test-12_adot_frontend', |
| 14 | + logStream: 'logStream', |
| 15 | + subscriptionFilters: [], |
| 16 | + messageType: 'DATA_MESSAGE', |
| 17 | + logEvents: [ |
| 18 | + { |
| 19 | + id: 'cloudwatch-log-message-id-1', |
| 20 | + timestamp: 1234, |
| 21 | + message: '2025/05/28 10:13:36 ADOT Collector version: v0.43.3' |
| 22 | + }, |
| 23 | + { |
| 24 | + id: 'cloudwatch-log-gmessage-id-2', |
| 25 | + timestamp: 1235, |
| 26 | + message: '2025-05-28T10:13:36.838Z warn awsemfexporter@v0.117.0/emf_exporter.go:92 the default value for DimensionRollupOption will be changing to NoDimensionRollupin a future release. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23997 for moreinformation {"kind": "exporter", "data_type": "metrics", "name": "awsemf"}' |
| 27 | + } |
| 28 | + ] |
| 29 | + })).toString('base64') |
| 30 | + }] |
| 31 | + }, |
| 32 | + expected: { |
| 33 | + records: [{ |
| 34 | + result: 'Ok', |
| 35 | + recordId: 'LogEvent-1', |
| 36 | + data: Buffer.from([ |
| 37 | + { |
| 38 | + host: 'logStream', |
| 39 | + source: 'adot', |
| 40 | + sourcetype: 'generic_single_line', |
| 41 | + index: 'pay_devops', |
| 42 | + event: '2025/05/28 10:13:36 ADOT Collector version: v0.43.3', |
| 43 | + fields: { |
| 44 | + account: 'test', |
| 45 | + environment: 'test-12', |
| 46 | + service: 'frontend' |
| 47 | + }, |
| 48 | + time: 1234.000 |
| 49 | + }, |
| 50 | + { |
| 51 | + host: 'logStream', |
| 52 | + source: 'adot', |
| 53 | + sourcetype: 'generic_single_line', |
| 54 | + index: 'pay_devops', |
| 55 | + event: '2025-05-28T10:13:36.838Z warn awsemfexporter@v0.117.0/emf_exporter.go:92 the default value for DimensionRollupOption will be changing to NoDimensionRollupin a future release. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23997 for moreinformation {"kind": "exporter", "data_type": "metrics", "name": "awsemf"}', |
| 56 | + fields: { |
| 57 | + account: 'test', |
| 58 | + environment: 'test-12', |
| 59 | + service: 'frontend' |
| 60 | + }, |
| 61 | + time: 1235.000 |
| 62 | + } |
| 63 | + ].map(x => JSON.stringify(x)).join('\n')).toString('base64') |
| 64 | + }] |
| 65 | + } |
| 66 | +} |
0 commit comments