axiomhq / axiom-lambda-extension Goto Github PK
View Code? Open in Web Editor NEWIngest logs and platform events from your lambda functions
Ingest logs and platform events from your lambda functions
also, this is separate but how do we feel about using a struct instead of this global variable?
like, instead of this:
var (
runtimeAPI = os.Getenv("AWS_LAMBDA_RUNTIME_API")
extensionName = filepath.Base(os.Args[0])
isFirstInvocation = true
runtimeDone = make(chan struct{})
// API Port
logsPort = "8080"
// Buffering Config
defaultMaxItems = 1000
defaultMaxBytes = 262144
defaultTimeoutMS = 1000
developmentMode = false
logger *zap.Logger
)
something more like:
type Config struct {
RuntimeAPI string
ExtensionName string
IsFirstInvocation bool
LogsPort string
MaxItems int
MaxBytes int
TimeoutMS int
DevelopmentMode bool
Logger *zap.Logger
RuntimeDone chan struct{}
}
var cfg = Config{
RuntimeAPI: os.Getenv("AWS_LAMBDA_RUNTIME_API"),
ExtensionName: filepath.Base(os.Args[0]),
IsFirstInvocation: true,
LogsPort: "8080",
MaxItems: 1000,
MaxBytes: 262144,
TimeoutMS: 1000,
DevelopmentMode: false,
RuntimeDone: make(chan struct{}),
}
and then used like
cfg.Logger.Error('ex')
Originally posted by @flbn in #17 (comment)
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
Any idea what's wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.