axiomhq / axiom-lambda-extension

Ingest logs and platform events from your lambda functions
14 stars 2 forks source link

Serverless and axiom-lambda-extension #16

Closed mits87 closed 1 week ago

mits87 commented 1 year ago

Hi there,

I'm trying to use your plugin with the serverless framework. Basically I'm doing something like:

service: app

frameworkVersion: '3'
useDotenv: true

plugins:
  - serverless-plugin-typescript
  - serverless-plugin-optimize
  - serverless-extra-parameters
  - serverless-offline

package:
  excludeDevDependencies: true
  individually: true
  patterns:
    - '!**/node_modules/@aws-sdk/**'

provider:
  name: aws
  runtime: nodejs18.x
  architecture: arm64
  region: ${opt:region, 'eu-central-1'}
  stage: ${opt:stage, 'dev'}
  stackName: dev-app
  layers:
    axiom:
      path: arn:aws:lambda:${self:provider.region}:694952825951:layer:axiom-extension-arm64:4
      name: axiom-layer
      description: Axiom unlocks observability at any scale.
  environment:
    AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
    AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE: 1
    LOG_LEVEL: debug
    NODE_ENV: production
    NODE_OPTIONS: '--enable-source-maps --stack-trace-limit=1000'
    AXIOM_TOKEN: ${ssm:/${self:provider.stage}/AXIOM_TOKEN}
    AXIOM_DATASET: 'app'

functions:
  api:
    handler: ./src/events/api.handler
    description: 'REST API / GraphQL handler'
    events:
      - httpApi:
          path: /{proxy+}
          method: ANY

But unfortunately when I'm trying to deploy my lambda (using sls deploy command) I'm getting error:

Error:
No file matches include / exclude patterns
image

Any idea what's wrong?

dasfmi commented 4 months ago

@mits87 have you been able to fix this, I don't think it's related to Axiom, looks like an error related to setting up the function correctly.

dasfmi commented 1 week ago

closing due to inactivity